summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-07 23:25:56 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-09-07 23:25:56 +0000
commit6cb419c9f65b3b4cdd68f6f2c6330ad5217e5c98 (patch)
tree50a41f4bdb6ca8389d4d3fd22b91bb0453d079b1 /lib
parent2cffea41c6db4926129ec4f79fb9d6e299aadf77 (diff)
downloadruby-6cb419c9f65b3b4cdd68f6f2c6330ad5217e5c98.tar.gz
ruby-6cb419c9f65b3b4cdd68f6f2c6330ad5217e5c98.tar.xz
ruby-6cb419c9f65b3b4cdd68f6f2c6330ad5217e5c98.zip
* lib/optparse.rb: suppress `assigning void value' warning.
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@10883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/optparse.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb
index 5c24eb362..305f828e0 100644
--- a/lib/optparse.rb
+++ b/lib/optparse.rb
@@ -786,7 +786,7 @@ class OptionParser
def add_officious # :nodoc:
list = base()
Officious.each do |opt, block|
- list.long[opt] ||= block.yield(self)
+ list.long[opt] ||= block.call(self)
end
end
@@ -1251,7 +1251,7 @@ class OptionParser
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
@@ -1281,7 +1281,7 @@ class OptionParser
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, arg.length > 2)
end
@@ -1290,9 +1290,9 @@ class OptionParser
else
catch(:prune) do
visit(:each_option) do |sw|
- sw.block.yield(arg) if Switch === sw and sw.match_nonswitch?(arg)
+ sw.block.call(arg) if Switch === sw and sw.match_nonswitch?(arg)
end
- nonopt.yield(arg)
+ nonopt.call(arg)
end
end
end
@@ -1300,7 +1300,7 @@ class OptionParser
nil
}
- visit(:search, :short, nil) {|sw| sw.block.yield(argv) if !sw.pattern}
+ visit(:search, :short, nil) {|sw| sw.block.call(argv) if !sw.pattern}
argv
end