diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-21 21:02:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-09-21 21:02:13 +0000 |
commit | 5bc87779fd50ea0cea04c381943d01ab4af6ea31 (patch) | |
tree | c8f12ae3be6aaf595248312f8df2020bcfd3ff7e /lib/optparse.rb | |
parent | 2f4951f01e62f6c30cdeb31a60b6cafae326047d (diff) | |
download | ruby-5bc87779fd50ea0cea04c381943d01ab4af6ea31.tar.gz |
* lib/optparse.rb (OptionParser::List::summarize): use each_line if
defined rather than each. [ruby-Patches-14096]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13483 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/optparse.rb')
-rw-r--r-- | lib/optparse.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/optparse.rb b/lib/optparse.rb index 854805a82a..6fddb81a72 100644 --- a/lib/optparse.rb +++ b/lib/optparse.rb @@ -632,8 +632,10 @@ class OptionParser list.each do |opt| if opt.respond_to?(:summarize) # perhaps OptionParser::Switch opt.summarize(*args, &block) - elsif !opt or opt.empty? + elsif !opt yield("") + elsif opt.respond_to?(:each_line) + opt.each_line(&block) else opt.each(&block) end |