README.textile

rucksack is a Rails plug-in to pack and compress CSS- and JavaScript-files with the YUI Compressor. It’s easy extendable to use other compressor-options like Packer, JSMin and CSSTidy.

Renaming for files managed by Git or SVN (as seen in earlier asset_package versions) are planned.

Inspired by asset_package and asset_compressor.

Install

Install the plug-in from github:

script/plugin install git://github.com/yolk/rucksack.git

Create config/rucksack.yml:

rake rucksack:install

Config

Please reorder and remove files in config/rucksack.yml so dependencies are loaded in correct order. In most cases you my want to structure your assets in different groups e.g. for different sections of your webapp or for different browsers/clients.

Change your javascript_include_tag and stylesheet_link_tag to javascript_include_packed and stylesheet_link_packed. For example:

<%= javascript_include_packed :base %>

<%= stylesheet_link_packed :base %>

Deploy

On each deploy you have to run

rake rucksack:pack

before (!) restaring your applicationserver(s). Rucksack will silently fall back to your uncompressed assets when the files are missing.