[rubygems/rubygems] Prefer String#each_line in Gem::Command
Replace ``String#split("\n").each`` with ``String#each_line``. https://github.com/rubygems/rubygems/commit/958744807d
This commit is contained in:
parent
12f4e9655e
commit
f792b55b21
@ -489,7 +489,7 @@ class Gem::Command
|
||||
|
||||
@parser.separator nil
|
||||
@parser.separator " Description:"
|
||||
formatted.split("\n").each do |line|
|
||||
formatted.each_line |line|
|
||||
@parser.separator " #{line.rstrip}"
|
||||
end
|
||||
end
|
||||
@ -516,8 +516,8 @@ class Gem::Command
|
||||
|
||||
@parser.separator nil
|
||||
@parser.separator " #{title}:"
|
||||
content.split(/\n/).each do |line|
|
||||
@parser.separator " #{line}"
|
||||
content.each_line do |line|
|
||||
@parser.separator " #{line.rstrip}"
|
||||
end
|
||||
end
|
||||
|
||||
@ -526,7 +526,7 @@ class Gem::Command
|
||||
|
||||
@parser.separator nil
|
||||
@parser.separator " Summary:"
|
||||
wrap(@summary, 80 - 4).split("\n").each do |line|
|
||||
wrap(@summary, 80 - 4).each_line do |line|
|
||||
@parser.separator " #{line.strip}"
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user