aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2011-04-17 11:44:52 +0200
committerJosé Valim <jose.valim@gmail.com>2011-04-17 11:44:52 +0200
commit3a68aec1a1c6329bfcbf0f87bdc2fbd75cb98feb (patch)
treedb2df7eaca91860f9ea6e57c0ef3b13b682cfc82 /actionpack/lib
parent8f75c3abcde4f2ff64e855178027e1bd93976de9 (diff)
downloadrails-3a68aec1a1c6329bfcbf0f87bdc2fbd75cb98feb.tar.gz
rails-3a68aec1a1c6329bfcbf0f87bdc2fbd75cb98feb.tar.bz2
rails-3a68aec1a1c6329bfcbf0f87bdc2fbd75cb98feb.zip
Make generators more modular, add hooks and improve test suite.
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/sprockets/railtie.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/actionpack/lib/sprockets/railtie.rb b/actionpack/lib/sprockets/railtie.rb
index 5006a3a575..e87382f29d 100644
--- a/actionpack/lib/sprockets/railtie.rb
+++ b/actionpack/lib/sprockets/railtie.rb
@@ -3,6 +3,23 @@ require "sprockets"
# TODO: Move this to sprockets-rails
# If so, we can move the require to a Gemfile and remove assets.enabled
class Sprockets::Railtie < Rails::Railtie
+ def self.using_coffee?
+ require 'coffee-script'
+ defined?(CoffeeScript)
+ rescue LoadError
+ 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|
ActiveSupport.on_load(:action_controller) do