mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/optparse.rb (OptionParser#to_a): should split by end-of-line
[ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a9917efd5d
commit
4f2b00429e
3 changed files with 8 additions and 5 deletions
|
@ -1,4 +1,7 @@
|
||||||
Tue Apr 24 14:54:03 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Apr 24 15:51:41 2012 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* lib/optparse.rb (OptionParser#to_a): should split by end-of-line
|
||||||
|
[ruby-dev:45568][Bug #6348]
|
||||||
|
|
||||||
* lib/optparse.rb (OptionParser#to_a): String#to_a is no longer
|
* lib/optparse.rb (OptionParser#to_a): String#to_a is no longer
|
||||||
defined. [ruby-dev:45568][Bug #6348]
|
defined. [ruby-dev:45568][Bug #6348]
|
||||||
|
|
|
@ -1071,7 +1071,7 @@ XXX
|
||||||
#
|
#
|
||||||
# Returns option summary list.
|
# Returns option summary list.
|
||||||
#
|
#
|
||||||
def to_a; summarize([*banner]) end
|
def to_a; summarize("#{banner}".split(/$/)) end
|
||||||
|
|
||||||
#
|
#
|
||||||
# Checks if an argument is given twice, in which case an ArgumentError is
|
# Checks if an argument is given twice, in which case an ArgumentError is
|
||||||
|
|
|
@ -31,8 +31,8 @@ class TestOptionParser::SummaryTest < TestOptionParser
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_summary
|
def test_summary
|
||||||
o = OptionParser.new("foo bar")
|
o = OptionParser.new("foo\nbar")
|
||||||
assert_equal("foo bar\n", o.to_s)
|
assert_equal("foo\nbar\n", o.to_s)
|
||||||
assert_equal(["foo bar"], o.to_a)
|
assert_equal(["foo", "bar"], o.to_a)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Reference in a new issue