From 4c35d15a3bea5f357e62067fe52b18b30416104c Mon Sep 17 00:00:00 2001 From: Pat Hawks Date: Thu, 26 May 2016 00:07:52 -0500 Subject: [PATCH] Rubocop: lib/jekyll/liquid_renderer/table.rb --- lib/jekyll/liquid_renderer/table.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/jekyll/liquid_renderer/table.rb b/lib/jekyll/liquid_renderer/table.rb index e3e0c8af..d3859647 100644 --- a/lib/jekyll/liquid_renderer/table.rb +++ b/lib/jekyll/liquid_renderer/table.rb @@ -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