1
0
Fork 0
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:
Ben Hollis 2012-03-11 11:06:48 -07:00
parent 89bd4f1eaf
commit 3fde255610

View file

@ -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