From 33263caffe5548a64253976c0a034afe1ed567f4 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 22 Jul 2011 10:55:06 -0700 Subject: [PATCH] Don't nuke the css files due to config changes during rails boot unless compilation is enabled. --- lib/compass/app_integration/rails.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/compass/app_integration/rails.rb b/lib/compass/app_integration/rails.rb index a850d8d7..1671f7f4 100644 --- a/lib/compass/app_integration/rails.rb +++ b/lib/compass/app_integration/rails.rb @@ -58,6 +58,16 @@ module Compass end end + def sass_plugin_enabled? + unless Sass::Util.ap_geq?('3.1.0.beta') + defined?(Sass::Plugin) && !Sass::Plugin.options[:never_update] + end + end + + def rails_compilation_enabled? + Sass::Util.ap_geq?('3.1.0.beta') && defined?(Sass::Rails) # XXX check if there's some other way(s) to disable the asset pipeline. + end + # Rails 2.x projects use this in their compass initializer. def initialize!(config = nil) check_for_double_boot! @@ -65,7 +75,7 @@ module Compass Compass.add_project_configuration(config, :project_type => :rails) Compass.discover_extensions! Compass.configure_sass_plugin! - Compass.handle_configuration_change! + Compass.handle_configuration_change! if sass_plugin_enabled? || rails_compilation_enabled? end end end