Bug #722 ยป optparse.patch
/usr/local/lib/ruby/1.9.1/optparse.rb 2008-11-07 15:27:19.000000000 -0800 | ||
---|---|---|
end
|
||
end
|
||
################################################################
|
||
#
|
||
# author: keith cascio, since: 20081107, keith@ucla.edu
|
||
#
|
||
# fix necessary because Ruby 1.9 Symbols respond to :match
|
||
#
|
||
# 1107140223> /usr/bin/irb
|
||
# irb(main):001:0> RUBY_VERSION
|
||
# => "1.8.5"
|
||
# irb(main):002:0> :keith.respond_to?( :match )
|
||
# => false
|
||
# irb(main):003:0> exit
|
||
# 1107140240> irb
|
||
# irb(main):001:0> RUBY_VERSION
|
||
# => "1.9.1"
|
||
# irb(main):002:0> :keith.respond_to?( :match )
|
||
# => true
|
||
# irb(main):003:0> exit
|
||
#
|
||
################################################################
|
||
# 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
|