From 11cf736066afcfbd005d7073101685fdf7cd11cd Mon Sep 17 00:00:00 2001 From: Scott Davis Date: Mon, 30 Jan 2012 22:11:34 -0500 Subject: [PATCH] fixed bug where application integrations would not load if there was a config file --- lib/compass/app_integration.rb | 10 +++++++++- lib/compass/configuration/helpers.rb | 8 +++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/compass/app_integration.rb b/lib/compass/app_integration.rb index 14785b6a..640aebcd 100644 --- a/lib/compass/app_integration.rb +++ b/lib/compass/app_integration.rb @@ -3,7 +3,7 @@ require "compass/app_integration/stand_alone" module Compass module AppIntegration module Helpers - attr_accessor :project_types + #attr_accessor :project_types DEAFULT_PROJECT_TYPES = { :stand_alone => "Compass::AppIntegration::StandAlone" } @@ -12,6 +12,14 @@ module Compass @project_types ||= DEAFULT_PROJECT_TYPES end + def project_types + @project_types + end + + def any? + @project_types == DEAFULT_PROJECT_TYPES + end + def lookup(type) unless @project_types[type].nil? eval @project_types[type] diff --git a/lib/compass/configuration/helpers.rb b/lib/compass/configuration/helpers.rb index 2b2ec778..f253c3e2 100644 --- a/lib/compass/configuration/helpers.rb +++ b/lib/compass/configuration/helpers.rb @@ -92,7 +92,7 @@ module Compass def add_project_configuration(*args) options = args.last.is_a?(Hash) ? args.pop : {} configuration_file_path = args.shift || detect_configuration_file - + raise ArgumentError, "Too many arguments" if args.any? if data = configuration_for(configuration_file_path, nil, configuration_for(options[:defaults])) if data.raw_project_type @@ -103,9 +103,11 @@ module Compass add_configuration(:stand_alone) end - add_configuration(data) + unless AppIntegration.any? + add_configuration(data) + end else - add_configuration(options[:project_type] || configuration.project_type_without_default || (yield if block_given?) || :stand_alone) + add_configuration(options[:project_type] || configuration.project_type_without_default || (yield if block_given?) || :stand_alone) end end