From cf4805958d92c82be782f7d7b8f54304af7369e6 Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Mon, 2 Jan 2012 11:27:20 -0500 Subject: [PATCH] app integration --- lib/compass/app_integration.rb | 25 +++++++++++++++++++++---- lib/compass/configuration/helpers.rb | 7 ------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/lib/compass/app_integration.rb b/lib/compass/app_integration.rb index 60b1c92f..a8e1beb9 100644 --- a/lib/compass/app_integration.rb +++ b/lib/compass/app_integration.rb @@ -5,10 +5,26 @@ end module Compass module AppIntegration module Helpers - def lookup(project_type) - eval "Compass::AppIntegration::#{camelize(project_type)}" - rescue NameError - raise Compass::Error, "No application integration exists for #{project_type}" + attr_accessor :project_types + DEAFULT_PROJECT_TYPES = { + :merb => "Compass::AppIntegration::Merb", + :stand_alone => "Compass::AppIntegration::StandAlone" + } + + def init + @project_types ||= DEAFULT_PROJECT_TYPES + end + + def lookup(type) + unless @project_types[type].nil? + eval @project_types[type] + else + raise Compass::Error, "No application integration exists for #{type}" + end + end + + def register(type, klass) + @project_types[type] = klass end protected @@ -20,5 +36,6 @@ module Compass end extend Helpers + init end end diff --git a/lib/compass/configuration/helpers.rb b/lib/compass/configuration/helpers.rb index b6396bc1..5e5b874e 100644 --- a/lib/compass/configuration/helpers.rb +++ b/lib/compass/configuration/helpers.rb @@ -80,13 +80,6 @@ module Compass end end - def configure_rails!(app) - return unless app.config.respond_to?(:sass) - app.config.compass.to_sass_engine_options.each do |key, value| - app.config.sass.send(:"#{key}=", value) - end - end - def sass_engine_options configuration.to_sass_engine_options end