From 5864f2aeabe1dcba61dad256c56c1521f98eed6f Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 23 Jul 2010 22:54:23 -0700 Subject: [PATCH] [Rails] Move most of the contents of the compass initializer back to the compass codebase. Discover compass extensions automatically during boot. --- lib/compass/app_integration/rails.rb | 7 +++++++ lib/compass/app_integration/rails/installer.rb | 6 ++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/compass/app_integration/rails.rb b/lib/compass/app_integration/rails.rb index d1f370ae..430e4c2c 100644 --- a/lib/compass/app_integration/rails.rb +++ b/lib/compass/app_integration/rails.rb @@ -34,6 +34,13 @@ module Compass end end + def initialize! + rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s + Compass.add_project_configuration(File.join(root, "config", "compass.rb")) + Compass.discover_extensions! + Compass.configure_sass_plugin! + Compass.handle_configuration_change! + end end end end diff --git a/lib/compass/app_integration/rails/installer.rb b/lib/compass/app_integration/rails/installer.rb index 9652c0e3..68e6a021 100644 --- a/lib/compass/app_integration/rails/installer.rb +++ b/lib/compass/app_integration/rails/installer.rb @@ -105,10 +105,8 @@ NEXTSTEPS def initializer_contents %Q{require 'compass' - |rails_root = (defined?(Rails) ? Rails.root : RAILS_ROOT).to_s - |Compass.add_project_configuration(File.join(rails_root, "config", "compass.rb")) - |Compass.configure_sass_plugin! - |Compass.handle_configuration_change! + |require 'compass/app_integration/rails' + |Compass::AppIntegration::Rails.initialize! |}.gsub(/^\s+\|/,'') end