diff options
author | tomhuda <tomhuda@strobecorp.com> | 2011-05-23 23:32:34 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2011-05-24 16:04:28 -0700 |
commit | 88cb89056bbdf970031a85437265c45b4007d1b6 (patch) | |
tree | 65101b7e5d101000573dd0e8299a5ccb45b883d0 /actionpack/lib/sprockets | |
parent | 4b86e7bab06ef24870e593a3885ae568645b8940 (diff) | |
download | rails-88cb89056bbdf970031a85437265c45b4007d1b6.tar.gz rails-88cb89056bbdf970031a85437265c45b4007d1b6.tar.bz2 rails-88cb89056bbdf970031a85437265c45b4007d1b6.zip |
Change compressor API so that plugins can register default compressors for their stylesheet or JS engines and still allow the user to turn off compression
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r-- | actionpack/lib/sprockets/railtie.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index db0f02a6ab..fe1d006814 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -28,7 +28,8 @@ module Sprockets # We need to configure this after initialization to ensure we collect # paths from all engines. This hook is invoked exactly before routes - # are compiled. + # are compiled, and so that other Railties have an opportunity to + # register compressors. config.after_initialize do |app| assets = app.config.assets next unless assets.enabled @@ -61,8 +62,8 @@ module Sprockets env.static_root = File.join(app.root.join("public"), assets.prefix) env.paths.concat assets.paths env.logger = Rails.logger - env.js_compressor = expand_js_compressor(assets.js_compressor) - env.css_compressor = expand_css_compressor(assets.css_compressor) + env.js_compressor = expand_js_compressor(assets.js_compressor) if app.assets.compress + env.css_compressor = expand_css_compressor(assets.css_compressor) if app.assets.compress env end |