diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-08 08:17:20 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2008-11-08 08:17:20 +0000 |
commit | 8179b310371b4988fb758158ec2e3d8c696aa98e (patch) | |
tree | 1e1bca008a3522490d231c829e6f0a1ffd1f8a31 | |
parent | 391ebe87144e6a0076981db055335766b9fe343a (diff) | |
download | ruby-8179b310371b4988fb758158ec2e3d8c696aa98e.tar.gz ruby-8179b310371b4988fb758158ec2e3d8c696aa98e.tar.xz ruby-8179b310371b4988fb758158ec2e3d8c696aa98e.zip |
* 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/trunk@20149 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/optparse.rb | 2 |
2 files changed, 7 insertions, 1 deletions
@@ -1,3 +1,9 @@ +Sat Nov 8 17:15:08 2008 Yukihiro Matsumoto <matz@ruby-lang.org> + + * lib/optparse.rb (OptionParser#make_switch): 1.9 Symbols respond + to :match. a patch from keith cascio, <keith at ucla.edu>. + [ruby-core:19730] + Sat Nov 8 12:10:15 2008 Yukihiro Matsumoto <matz@ruby-lang.org> * ext/gdbm/gdbm.c (fgdbm_index): make #index warn like Hash. 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 |