mirror of
https://github.com/middleman/middleman.git
synced 2022-11-09 12:20:27 -05:00
Change gzip_assets output to print size difference in human terms
This commit is contained in:
parent
89bd4f1eaf
commit
3fde255610
1 changed files with 3 additions and 1 deletions
|
@ -48,7 +48,9 @@ module Middleman::Extensions
|
|||
old_size = File.size(path)
|
||||
new_size = File.size(output_filename)
|
||||
|
||||
builder.say_status :gzip, "#{output_filename} (#{old_size - new_size} bytes smaller)"
|
||||
size_change_word = (old_size - new_size) > 0 ? 'smaller' : 'larger'
|
||||
|
||||
builder.say_status :gzip, "#{output_filename} (#{number_to_human_size((old_size - new_size).abs)} #{size_change_word})"
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue