documentcloud / jammit

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

Add support for environment specific configuration #142

Closed christoffer closed 13 years ago

christoffer commented 13 years ago

Adds the ability to opt-in environment specific configuration.

Configuration sections that share the same name as the environment are merged with the configuration at the root level.

For example:

package_assets: always
compress_assets: on

development:
  compress_assets: off

Would turn result in this configuration in production:

package_assets: always
compress_assets: on

and this configuration in development:

package_assets: always
compress_assets: off

This can already be achieved using ERB, but we found it nicer to do it this way so I'd share the changes if anyone else is interested.