Rubocop: lib/jekyll/liquid_renderer/table.rb

This commit is contained in:
Pat Hawks 2016-05-26 00:07:52 -05:00
parent 3e42e6d461
commit 4c35d15a3b
1 changed files with 11 additions and 11 deletions

View File

@ -31,8 +31,8 @@ module Jekyll
str = ""
row_data.each_index do |cell_index|
str << '-' * widths[cell_index]
str << '-+-' unless cell_index == row_data.length-1
str << "-" * widths[cell_index]
str << "-+-" unless cell_index == row_data.length-1
end
str << "\n"
@ -40,16 +40,16 @@ module Jekyll
end
def generate_row(row_data, widths)
str = ''
str = ""
row_data.each_with_index do |cell_data, cell_index|
if cell_index == 0
str << cell_data.ljust(widths[cell_index], ' ')
else
str << cell_data.rjust(widths[cell_index], ' ')
end
str << if cell_index == 0
cell_data.ljust(widths[cell_index], " ")
else
cell_data.rjust(widths[cell_index], " ")
end
str << ' | ' unless cell_index == row_data.length-1
str << " | " unless cell_index == row_data.length-1
end
str << "\n"
@ -79,7 +79,7 @@ module Jekyll
row << filename
row << file_stats[:count].to_s
row << format_bytes(file_stats[:bytes])
row << "%.3f" % file_stats[:time]
row << format("%.3f", file_stats[:time])
table << row
end
@ -88,7 +88,7 @@ module Jekyll
def format_bytes(bytes)
bytes /= 1024.0
"%.2fK" % bytes
format("%.2fK", bytes)
end
end
end