完成
This commit is contained in:
parent
e161f37523
commit
7f96e3096c
1 changed files with 2 additions and 2 deletions
4
wc.rb
4
wc.rb
|
@ -51,10 +51,10 @@ def calculate_max_widths(total_stat)
|
||||||
end
|
end
|
||||||
|
|
||||||
def format_row(stats, max_widths, options)
|
def format_row(stats, max_widths, options)
|
||||||
result = %i[lines words bytes].filter_map do |key|
|
row = %i[lines words bytes].filter_map do |key|
|
||||||
stats[key].to_s.rjust(max_widths[key]) if options[key]
|
stats[key].to_s.rjust(max_widths[key]) if options[key]
|
||||||
end
|
end
|
||||||
[*result, stats[:filename]].join(' ')
|
[*row, stats[:filename]].join(' ')
|
||||||
end
|
end
|
||||||
|
|
||||||
main
|
main
|
||||||
|
|
Loading…
Reference in a new issue