-l
This commit is contained in:
parent
4d5404ea3b
commit
c325da4d19
1 changed files with 2 additions and 2 deletions
4
ls.rb
4
ls.rb
|
@ -36,7 +36,7 @@ end
|
||||||
|
|
||||||
def output(filenames)
|
def output(filenames)
|
||||||
rows = (filenames.size / COLUMNS)
|
rows = (filenames.size / COLUMNS)
|
||||||
length_limits = init_limit(filenames, rows)
|
length_limits = limiter(filenames, rows)
|
||||||
(0...rows).each do |row|
|
(0...rows).each do |row|
|
||||||
COLUMNS.times do |column|
|
COLUMNS.times do |column|
|
||||||
index = row + column * rows
|
index = row + column * rows
|
||||||
|
@ -46,7 +46,7 @@ def output(filenames)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def init_limit(filenames, rows)
|
def limiter(filenames, rows)
|
||||||
filenames.each_slice(rows).map { _1.map(&:length).max }
|
filenames.each_slice(rows).map { _1.map(&:length).max }
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue