summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-26 12:21:24 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-05-26 12:21:24 +0000
commit6e242d868eea16011ca564455b8147cfaf749a09 (patch)
tree6c9e6effe287329024e33865211f85e372ec1f09
parentb4fd4d6018a8ad72f69912606c60ec42ee3b62b8 (diff)
* lib/optparse.rb (OptionParser::Switch::parse,
OptionParser::order): use {Block,Proc}#call instead of deprecated #yield. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3868 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog6
-rw-r--r--lib/optparse.rb6
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 24a3a17c8f0..edb11d707dc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Mon May 26 21:21:20 2003 Nobuyoshi Nakada <nobu.nokada@softhome.net>
+
+ * lib/optparse.rb (OptionParser::Switch::parse,
+ OptionParser::order): use {Block,Proc}#call instead of deprecated
+ #yield.
+
Mon May 26 16:39:10 2003 Yukihiro Matsumoto <matz@ruby-lang.org>
* eval.c (Init_Proc): Block/Proc separation. [huge change]
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 54a92ceff25..cdc8ce44684 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -222,7 +222,7 @@ Individual switch class.
=end #'#"#`#
def parse(arg, *val)
if block
- val = conv.yield(*val) if conv
+ val = conv.call(*val) if conv
return arg, block, val
else
return arg, nil
@@ -1117,7 +1117,7 @@ Default options, which never appear in option summary.
end
begin
opt, sw, val = sw.parse(rest, argv) {|*exc| raise(*exc)}
- sw.yield(val) if sw
+ sw.call(val) if sw
rescue ParseError
raise $!.set_option(arg, rest)
end
@@ -1146,7 +1146,7 @@ Default options, which never appear in option summary.
opt, sw, val = sw.parse(val, argv) {|*exc| raise(*exc) if eq}
raise InvalidOption, arg if has_arg and !eq and arg == "-#{opt}"
argv.unshift(opt) if opt and (opt = opt.sub(/\A-*/, '-')) != '-'
- sw.yield(val) if sw
+ sw.call(val) if sw
rescue ParseError
raise $!.set_option(arg, has_arg)
end