diff --git a/ChangeLog b/ChangeLog index d5949aef3f..182ae0b6ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Sat Nov 8 17:15:08 2008 Yukihiro Matsumoto + + * lib/optparse.rb (OptionParser#make_switch): 1.9 Symbols respond + to :match. a patch from keith cascio, . + [ruby-core:19730] + Sat Nov 8 12:10:15 2008 Yukihiro Matsumoto * ext/gdbm/gdbm.c (fgdbm_index): make #index warn like Hash. 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