sinatra-minify
sinatra-minify copied to clipboard
YUI compressor
YUI compressor is much better than jsmin.
I'm not that familiar with github, otherwise I would have forked it, but here's a fix:
http://gist.github.com/422436
(changed only minify_js method)
And of course, put yuicompressor-2.4.2.jar in minify directory, downloadable at: http://yuilibrary.com/downloads/#yuicompressor
(I should really know how to use github :) )
Thanks.
Yeah problem with using YUI is that we have to make sure every deployment also has java, which is a major assumption.
With Jsmin, it's just plain ruby.
I'm going to compare the compression ratios of both and see if it warrants itself enough to require java to do JS compression.
It can always be inside begin/rescue with a warning if one doesn't have java. YUI compressed my file 20% more because it also obfuscates code (which is important for code protection).
Ok we'll see what we can do with this. We're leaning towards environment vars though, something like
COMPRESSOR=/path/to/yui.jar rake minify