No commit activity in last 3 years
No release in over 3 years
"This gem sets up javascript and CSS bundle file compression using the YUI Compressor. For example, using [javascript_include_tag "prototype", "cart", "checkout", :cache => "shop"] creates a combined javascript file named shop.js. With this gem, YUI compressor will also be run on shop.js, resulting in a smaller, obfuscated file."
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

cache-with-yuicompressor¶ ↑

This gem sets up javascript and CSS bundle file compression using the YUI Compressor.

For example, using

javascript_include_tag "prototype", "cart", "checkout", :cache => "shop"

creates a combined javascript file named shop.js. With this gem, YUI compressor will also be run on shop.js, resulting in a smaller, obfuscated file.

Don’t forget to use GZip to further compress your asset files.

Installation¶ ↑

cache-with-yuicompressor is provided as a gem. Simply include it in your environment.rb or Gemfile.

config.gem "cache-with-yuicompressor"

Alternatively it can be installed as a plugin.

script/plugin install git://github.com/amolk/cache-with-yuicompressor.git

Install JAVA¶ ↑

The YUI compressor requires JAVA runtime to be installed. Install JRE as per your platform.

For Ubuntu, you can follow instructions at blog.amolkelkar.info/technotes/2010/06/solved-how-to-install-java-jre-on-ubuntu/.

And that’s it!¶ ↑

All generated javascript and css files will be automatically compressed using YUI Compressor.
Also all console.* calls (such as console.log, console.trace) will be removed from javascript.