1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Preserve each column positions in gems/bundled_gems

This commit is contained in:
Nobuyoshi Nakada 2022-08-12 23:51:55 +09:00
parent b1799267bf
commit e44445596f
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

View file

@ -16,5 +16,7 @@ unless /^[^#]/ !~ (gem = $F[0])
$F[3..-1] = []
end
end
$_ = [gem.name, gem.version, uri, *$F[3..-1]].join(" ")
f = [gem.name, gem.version.to_s, uri, *$F[3..-1]]
$_.gsub!(/\S+\s*/) {|s| f.shift.ljust(s.size)}
$_ = [$_, *f].join(" ") unless f.empty?
end