eStyle

This project is mainly to simplify my personal stylesheet management, and as such, I have yet to write any useful documentation. Basically, it merges css files from a number of directories into a single string which is displayed to the user. See code for further details.

As an added bonus, it also does the exact same thing for Javascript files!

Installation

eStyle is only available as a GemPlugin. Use as a plugin like so:

script/plugin install git://github.com/bits2life/estyle.git

Or as a gem like so:

config.gem 'bits2life-estyle', :source => "http://gems.github.com", :lib => "estyle"

Usage

First off, avoid having a controller named stylesheets, since one will be added by eStyle. Add a route to this controller in routes.rb

map.estyle-routes

Or, equivalently:

resources :styles
resources :scripts

And then place your small, manageable stylesheets in a directory of your choice. You’re now done. Requesting /styles/happy.css will now yield following files, merged:

/[style dir]/initial/*.css /[style dir]/*.css /[style dir]/happy/*.css

Configuration

You can configure the directories by setting EStyle.script_dir and EStyle.style_dir attributes. Default values are public/estyles and public/escripts