diff options
author | tomhuda <tomhuda@strobecorp.com> | 2011-05-23 23:39:04 -0700 |
---|---|---|
committer | wycats <wycats@gmail.com> | 2011-05-24 16:04:28 -0700 |
commit | 74ade51eee5a7f975f98ab2f28c77f1a10119ff5 (patch) | |
tree | 5f614130a055ec33bc4abbc3f96a452047ab4c61 /actionpack | |
parent | 88cb89056bbdf970031a85437265c45b4007d1b6 (diff) | |
download | rails-74ade51eee5a7f975f98ab2f28c77f1a10119ff5.tar.gz rails-74ade51eee5a7f975f98ab2f28c77f1a10119ff5.tar.bz2 rails-74ade51eee5a7f975f98ab2f28c77f1a10119ff5.zip |
Move SCSS generators and default templates from Rails to the Sass Railtie (d435726312601edb3ba6f97b34f562221f72c1f8).
* Sass gem registers a compressor
* Sass gem registers generators for assets and scaffold
* Create a default stylesheet_engine ("css") for apps that remove the Sass gem
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/sprockets/railtie.rb | 21 |
1 files changed, 2 insertions, 19 deletions
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb index fe1d006814..7b8a7ad3bb 100644 --- a/actionpack/lib/sprockets/railtie.rb +++ b/actionpack/lib/sprockets/railtie.rb @@ -9,15 +9,7 @@ module Sprockets false end - def self.using_scss? - require 'sass' - defined?(Sass) - rescue LoadError - false - end - config.app_generators.javascript_engine :coffee if using_coffee? - config.app_generators.stylesheet_engine :scss if using_scss? # Configure ActionController to use sprockets. initializer "sprockets.set_configs", :after => "action_controller.set_configs" do |app| @@ -62,8 +54,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) if app.assets.compress - env.css_compressor = expand_css_compressor(assets.css_compressor) if app.assets.compress + env.js_compressor = expand_js_compressor(assets.js_compressor) if assets.compress + env.css_compressor = expand_css_compressor(assets.css_compressor) if assets.compress env end @@ -85,15 +77,6 @@ module Sprockets def expand_css_compressor(sym) case sym - when :scss - require 'sass' - compressor = Object.new - def compressor.compress(source) - Sass::Engine.new(source, - :syntax => :scss, :style => :compressed - ).render - end - compressor when :yui require 'yui/compressor' YUI::CssCompressor.new |