Don't nuke the css files due to config changes during rails boot unless compilation is enabled.

This commit is contained in:
Chris Eppstein 2011-07-22 10:55:06 -07:00
parent 2c1fcfcad7
commit 33263caffe

View File

@ -58,6 +58,16 @@ module Compass
end end
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. # Rails 2.x projects use this in their compass initializer.
def initialize!(config = nil) def initialize!(config = nil)
check_for_double_boot! check_for_double_boot!
@ -65,7 +75,7 @@ module Compass
Compass.add_project_configuration(config, :project_type => :rails) Compass.add_project_configuration(config, :project_type => :rails)
Compass.discover_extensions! Compass.discover_extensions!
Compass.configure_sass_plugin! Compass.configure_sass_plugin!
Compass.handle_configuration_change! Compass.handle_configuration_change! if sass_plugin_enabled? || rails_compilation_enabled?
end end
end end
end end