Permalink
Browse files

Indention style + whitespace for readability

  • Loading branch information...
1 parent 93f30f0 commit 54b0aeba64db8c52ac8c6cda2aaa81d8717b8549 @dhh dhh committed Jun 8, 2011
Showing with 38 additions and 33 deletions.
  1. +38 −33 actionpack/lib/sprockets/railtie.rb
@@ -46,43 +46,48 @@ def self.using_coffee?
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

3 comments on commit 54b0aeb

@KieranP
KieranP commented on 54b0aeb Jun 9, 2011

Since when is protected a block in that everything below it gets indented? :-P

I personally hate seeing indentation like this, but every man to his own style I guess.

@sikachu
Member
sikachu commented on 54b0aeb Jun 9, 2011

Hahaha. If you look up Rails source code you'll see that this is the convention that we followed (from someone -_-?? .. I think from @dhh himself.)

@bagwanpankaj
Contributor

looks weird

Please sign in to comment.