Skip to content

Instantly share code, notes, and snippets.

@madrobby
Created January 28, 2009 00:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madrobby/53733 to your computer and use it in GitHub Desktop.
Save madrobby/53733 to your computer and use it in GitHub Desktop.
def pack_file(source, target)
puts `java -jar lib/yuicompressor-2.4.1.jar -v #{source} -o #{target}`
`gzip -9 #{target} -c > #{target}.gzip`
puts "#{source}: #{'%.1f' % (File.size(source)/1024.0)}k"
puts "Packed: #{'%.1f' % (File.size(target)/1024.0)}k"
puts "Packed+GZIP: #{'%.1f' % (File.size(target+'.gzip')/1024.0)}k"
puts
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment