mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Suppress double dots.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46597 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f28a12734b
commit
1c58954cec
1 changed files with 5 additions and 1 deletions
|
@ -450,7 +450,11 @@ EOT
|
|||
def message(msg = nil, *args, &default) # :nodoc:
|
||||
if Proc === msg
|
||||
super(nil, *args) do
|
||||
[msg.call, (default.call if default)].compact.reject(&:empty?).join(".\n")
|
||||
ary = [msg.call, (default.call if default)].compact.reject(&:empty?)
|
||||
if 1 < ary.length
|
||||
ary[0...-1] = ary[0...-1].map {|str| str.sub(/(?<!\.)\z/, '.') }
|
||||
end
|
||||
ary.join("\n")
|
||||
end
|
||||
else
|
||||
super
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue