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