diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2011-06-09 01:29:25 +0200 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2011-06-09 01:31:06 +0200 |
commit | 54b0aeba64db8c52ac8c6cda2aaa81d8717b8549 (patch) | |
tree | 6979cb1436bc6750648ae802e8af7e6ff1045825 /actionpack/lib/sprockets | |
parent | 93f30f053627aa3457abe32bc75ffeafa215ef55 (diff) | |
download | rails-54b0aeba64db8c52ac8c6cda2aaa81d8717b8549.tar.gz rails-54b0aeba64db8c52ac8c6cda2aaa81d8717b8549.tar.bz2 rails-54b0aeba64db8c52ac8c6cda2aaa81d8717b8549.zip |
Indention style + whitespace for readability
Diffstat (limited to 'actionpack/lib/sprockets')
-rw-r--r-- | actionpack/lib/sprockets/railtie.rb | 71 |
1 files changed, 38 insertions, 33 deletions
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index 61fcb8798b..4b497d142d 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -46,43 +46,48 @@ module Sprockets end protected + def asset_environment(app) + require "sprockets" - def asset_environment(app) - require "sprockets" - assets = app.config.assets - env = Sprockets::Environment.new(app.root.to_s) - 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 - end + assets = app.config.assets + + env = Sprockets::Environment.new(app.root.to_s) + + 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) - def expand_js_compressor(sym) - case sym - when :closure - require 'closure-compiler' - Closure::Compiler.new - when :uglifier - require 'uglifier' - Uglifier.new - when :yui - require 'yui/compressor' - YUI::JavaScriptCompressor.new - else - sym + env end - end - def expand_css_compressor(sym) - case sym - when :yui - require 'yui/compressor' - YUI::CssCompressor.new - else - sym + def expand_js_compressor(sym) + case sym + when :closure + require 'closure-compiler' + Closure::Compiler.new + when :uglifier + require 'uglifier' + Uglifier.new + when :yui + require 'yui/compressor' + YUI::JavaScriptCompressor.new + else + sym + end + end + + def expand_css_compressor(sym) + case sym + when :yui + require 'yui/compressor' + YUI::CssCompressor.new + else + sym + end end - end end end |