app integration

This commit is contained in:
Scott Davis 2012-01-02 11:27:20 -05:00
parent c669be8888
commit cf4805958d
2 changed files with 21 additions and 11 deletions

View File

@ -5,10 +5,26 @@ end
module Compass module Compass
module AppIntegration module AppIntegration
module Helpers module Helpers
def lookup(project_type) attr_accessor :project_types
eval "Compass::AppIntegration::#{camelize(project_type)}" DEAFULT_PROJECT_TYPES = {
rescue NameError :merb => "Compass::AppIntegration::Merb",
raise Compass::Error, "No application integration exists for #{project_type}" :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 end
protected protected
@ -20,5 +36,6 @@ module Compass
end end
extend Helpers extend Helpers
init
end end
end end

View File

@ -80,13 +80,6 @@ module Compass
end end
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 def sass_engine_options
configuration.to_sass_engine_options configuration.to_sass_engine_options
end end