1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
matz 2008-11-08 08:17:20 +00:00
parent 703fb3d9be
commit 6a638cc196
2 changed files with 7 additions and 1 deletions

View file

@ -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.

View file

@ -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