diff options
author | Evan Read <eread@gitlab.com> | 2020-11-13 01:46:16 +0300 |
---|---|---|
committer | Evan Read <eread@gitlab.com> | 2020-11-13 01:46:16 +0300 |
commit | cdd20c2bceded5251d47041a7f8dd8795f8e3ff6 (patch) | |
tree | 285e71d674a42adb4f0242b1e8faeb1ff8c55e72 /lib/helpers | |
parent | 1495bb1e6aacd7389155ca48ecaddd221ea0efd7 (diff) |
Fix even more Rubocop problems
Diffstat (limited to 'lib/helpers')
-rw-r--r-- | lib/helpers/child_parent_better.rb | 4 | ||||
-rw-r--r-- | lib/helpers/reading_time.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/lib/helpers/child_parent_better.rb b/lib/helpers/child_parent_better.rb index 86dd6565..7c5f0fbb 100644 --- a/lib/helpers/child_parent_better.rb +++ b/lib/helpers/child_parent_better.rb @@ -35,8 +35,8 @@ module Nanoc::Helpers return get_nearest_parent(parent_dir) else parent_dir = item_identifier.sub(/[^\/]+$/, '').chop - parent = @items[parent_dir + '/README.*'] - alt_parent = @items[parent_dir + '/index.*'] + parent = @items["#{parent_dir}/README.*"] + alt_parent = @items["#{parent_dir}/index.*"] if (parent.nil? && alt_parent.nil?) get_nearest_parent(parent_dir) elsif alt_parent.nil? diff --git a/lib/helpers/reading_time.rb b/lib/helpers/reading_time.rb index 1f96dcf5..c336dec7 100644 --- a/lib/helpers/reading_time.rb +++ b/lib/helpers/reading_time.rb @@ -24,11 +24,11 @@ module Nanoc::Helpers minutes = (words / WPM).ceil seconds = (words % WPM / (WPM / 60)).floor - if seconds > 0 + if seconds.positive? minutes += 1 end - (minutes <= 1 ? 'about a minute' : '~' + minutes.to_s + ' minutes') + (minutes <= 1 ? 'about a minute' : "~#{minutes} minutes") end end end |