mirror of
https://github.com/haml/haml.git
synced 2022-11-09 12:33:31 -05:00
29 lines
1.1 KiB
Ruby
29 lines
1.1 KiB
Ruby
unless defined?(Sass::RAILS_LOADED)
|
|
Sass::RAILS_LOADED = true
|
|
|
|
Sass::Plugin.options.merge!(:template_location => Haml::Util.rails_root + '/public/stylesheets/sass',
|
|
:css_location => Haml::Util.rails_root + '/public/stylesheets',
|
|
:cache_location => Haml::Util.rails_root + '/tmp/sass-cache',
|
|
:always_check => Haml::Util.rails_env != "production",
|
|
:full_exception => Haml::Util.rails_env != "production")
|
|
|
|
if defined?(Rails.configuration.middleware)
|
|
# Rails >= 3.0
|
|
require 'sass/plugin/rack'
|
|
Rails.configuration.middleware.use(Sass::Plugin::Rack)
|
|
elsif defined?(ActionController::Dispatcher.middleware)
|
|
# Rails >= 2.3
|
|
require 'sass/plugin/rack'
|
|
ActionController::Dispatcher.middleware.use(Sass::Plugin::Rack)
|
|
else
|
|
module ActionController
|
|
class Base
|
|
alias_method :sass_old_process, :process
|
|
def process(*args)
|
|
Sass::Plugin.check_for_updates
|
|
sass_old_process(*args)
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|