summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authoryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-11 11:01:13 +0000
committeryugui <yugui@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-11 11:01:13 +0000
commit050ddca6f67be947f8a29b7eabf3e18130b16177 (patch)
tree516bd3964c4a66ea868618c19ea523354094367c /lib
parent05c763ae7fc49cc762e69b1f38d3d09231e4fcdc (diff)
downloadruby-050ddca6f67be947f8a29b7eabf3e18130b16177.tar.gz
ruby-050ddca6f67be947f8a29b7eabf3e18130b16177.tar.xz
ruby-050ddca6f67be947f8a29b7eabf3e18130b16177.zip
merges r20149 from trunk into ruby_1_9_1.
* lib/optparse.rb (OptionParser#make_switch): 1.9 Symbols respond to :match. a patch from keith cascio, <keith at ucla.edu>. [ruby-core:19730] git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_9_1@20197 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index a1a5d0032..5a86194b7 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -1074,7 +1074,7 @@ class OptionParser
end
# directly specified pattern(any object possible to match)
- if !(String === o) and o.respond_to?(:match)
+ if (!(String === o || Symbol === o)) and o.respond_to?(:match)
pattern = notwice(o, pattern, 'pattern')
conv = pattern.method(:convert).to_proc if pattern.respond_to?(:convert)
next