diff options
author | 2015-11-30 20:48:22 +0100 | |
---|---|---|
committer | 2015-11-30 20:48:22 +0100 | |
commit | a100faf515c3cfe8c2d1d8fe4bc6c0fb48f7429d (patch) | |
tree | 937f6982978a454b27ca41992e26c552c629bab9 /_plugins/filters.rb | |
parent | Add code style settings (diff) | |
download | www-a100faf515c3cfe8c2d1d8fe4bc6c0fb48f7429d.tar.gz www-a100faf515c3cfe8c2d1d8fe4bc6c0fb48f7429d.tar.bz2 www-a100faf515c3cfe8c2d1d8fe4bc6c0fb48f7429d.zip |
Ruby code cleanup
Diffstat (limited to '_plugins/filters.rb')
-rw-r--r-- | _plugins/filters.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/_plugins/filters.rb b/_plugins/filters.rb index 34ad123..df5b4f7 100644 --- a/_plugins/filters.rb +++ b/_plugins/filters.rb @@ -1,6 +1,6 @@ module Gentoo module Filters - UNITS = %W(B KiB MiB GiB TiB).freeze + UNITS = %w(B KiB MiB GiB TiB).freeze def nice_filesize(input) number = input.to_i @@ -12,7 +12,7 @@ module Gentoo exponent = (Math.log(number) / Math.log(1024)).to_i exponent = max_exp if exponent > max_exp - number /= 1024 ** exponent + number /= 1024**exponent end "#{number} #{UNITS[exponent]}" @@ -25,4 +25,4 @@ module Gentoo end end -Liquid::Template.register_filter(Gentoo::Filters)
\ No newline at end of file +Liquid::Template.register_filter(Gentoo::Filters) |