Permalink
Browse files

Make js and css compressors configurable

  • Loading branch information...
1 parent 654ff28 commit 1fd7542ff904f87c469d63aed60accc9cd3cb53b @bkeepers bkeepers committed with Feb 24, 2012
Showing with 5 additions and 3 deletions.
  1. +2 −2 lib/sinatra/sprockets.rb
  2. +3 −1 lib/sinatra/sprockets/configuration.rb
View
@@ -16,8 +16,8 @@ def self.configure(&block)
end
if config.compress_assets?
- environment.js_compressor = Closure::Compiler.new
- environment.css_compressor = YUI::CssCompressor.new
+ environment.js_compressor = config.js_compressor || Closure::Compiler.new
+ environment.css_compressor = config.css_compressor || YUI::CssCompressor.new
else
environment.js_compressor = false
environment.css_compressor = false
@@ -11,7 +11,9 @@ class Configuration
:relative_url_root => ENV['RACK_RELATIVE_URL_ROOT'],
:precompile => [ /\w+\.(?!js|css).+/, /application.(css|js)$/ ],
:manifest_path => "public/assets",
- :app => nil
+ :app => nil,
+ :js_compressor => nil,
+ :css_compressor => nil
}
OPTIONS = DEFAULTS.keys

0 comments on commit 1fd7542

Please sign in to comment.