summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 08:17:20 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 08:17:20 +0000
commit6a638cc1960548c1e3bc5ceba6a56c1b274ae9b1 (patch)
tree1e1bca008a3522490d231c829e6f0a1ffd1f8a31 /lib
parent703fb3d9becd0626c57f343ce16635c0434f19c6 (diff)
* 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@20149 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 a1a5d00321..5a86194b7e 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