diff options
Diffstat (limited to 'lib/helpers/reading_time.rb')
-rw-r--r-- | lib/helpers/reading_time.rb | 4 |
1 files changed, 2 insertions, 2 deletions
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 |