documentcloud / jammit

Industrial Strength Asset Packaging for Rails
http://documentcloud.github.com/jammit/
MIT License
1.16k stars 197 forks source link

Shifter for YUI module packaging integrated in Rails #255

Open paulRbr opened 10 years ago

paulRbr commented 10 years ago

Hello!

For javascript code written in YUI modules I wanted to have my assets automaticaly built using YUI's shifter each time the specified asset is missing or when it is changed.

Feature Added

By adding the two following lines in the assets.yml config file of Jammit

build_assets: true
javascript_builder: shifter 

You will have your assets built with Shifter each time Yammit is loaded. This build process will occur only if the asset file is missing or if the file has been modified (in the git sense).

Limitation

As we need to know the name of the YUI module if it is missing, we need the full module path in the assets configuration. Therefore any assets glob defined with a wildcard (*.js) will NOT be shifted.

Suggestions?

This is a specific development for our team's app that relies heavily on YUI Shifter. I will therefore leave this pull request open to any discussion/suggestion/improvements