Change gzip_assets output to print size difference in human terms
This commit is contained in:
parent
89bd4f1eaf
commit
3fde255610
|
@ -48,7 +48,9 @@ module Middleman::Extensions
|
||||||
old_size = File.size(path)
|
old_size = File.size(path)
|
||||||
new_size = File.size(output_filename)
|
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
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue