diff options
| author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-20 03:26:19 +0000 |
|---|---|---|
| committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-04-20 03:26:19 +0000 |
| commit | 2a50650ceb893ec7ea22bdab65a39dcc921bafe4 (patch) | |
| tree | f0cb14e36d81f6bfb7feae631f23ffca11700fcc | |
| parent | 47807a7b44ba98fa87d9cee83852c0f6dc7615e9 (diff) | |
* lib/optparse.rb: fix to override conv proc.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@12203 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
| -rw-r--r-- | ChangeLog | 4 | ||||
| -rw-r--r-- | lib/optparse.rb | 4 |
2 files changed, 6 insertions, 2 deletions
@@ -1,3 +1,7 @@ +Fri Apr 20 12:27:04 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/optparse.rb: fix to override conv proc. + Fri Apr 20 12:17:05 2007 Nobuyoshi Nakada <nobu@ruby-lang.org> * eval.c (ruby_cleanup): inversed the order of errinfos. diff --git a/lib/optparse.rb b/lib/optparse.rb index 5013700ae2..0c4b484e02 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -1077,7 +1077,7 @@ class OptionParser # directly specified pattern(any object possible to match) if !(String === o) and o.respond_to?(:match) pattern = notwice(o, pattern, 'pattern') - conv ||= pattern.method(:convert).to_proc if pattern.respond_to?(:convert) + conv = pattern.method(:convert).to_proc if pattern.respond_to?(:convert) next end @@ -1090,7 +1090,7 @@ class OptionParser when CompletingHash when nil pattern = CompletingHash.new - conv ||= pattern.method(:convert).to_proc if pattern.respond_to?(:convert) + conv = pattern.method(:convert).to_proc if pattern.respond_to?(:convert) else raise ArgumentError, "argument pattern given twice" end |
