From a7b6ae0d5097a175e6e4bf79f7158c6f4703b7c7 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 31 May 2010 13:12:05 -0700 Subject: [PATCH] Fixed a regression in the rails installer. --- lib/compass/commands/project_base.rb | 4 +++- lib/compass/configuration/helpers.rb | 4 ++-- test/rails_integration_test.rb | 4 ++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/lib/compass/commands/project_base.rb b/lib/compass/commands/project_base.rb index dbc792de..98fb7dbe 100644 --- a/lib/compass/commands/project_base.rb +++ b/lib/compass/commands/project_base.rb @@ -28,7 +28,9 @@ module Compass end def add_project_configuration - Compass.add_project_configuration(options[:configuration_file]) + Compass.add_project_configuration(options[:configuration_file]) do + options[:project_type] + end end def projectize(path) diff --git a/lib/compass/configuration/helpers.rb b/lib/compass/configuration/helpers.rb index c00c6937..2fef6c33 100644 --- a/lib/compass/configuration/helpers.rb +++ b/lib/compass/configuration/helpers.rb @@ -78,7 +78,7 @@ module Compass 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 configuration_file_path + if configuration_file_path && File.exists?(configuration_file_path) data = configuration_for(configuration_file_path) @@ -92,7 +92,7 @@ module Compass add_configuration(data) else - add_configuration(options[:project_type] || configuration.project_type || :stand_alone) + add_configuration(options[:project_type] || configuration.project_type_without_default || (yield if block_given?) || :stand_alone) end end diff --git a/test/rails_integration_test.rb b/test/rails_integration_test.rb index 862c9d53..edf38abb 100644 --- a/test/rails_integration_test.rb +++ b/test/rails_integration_test.rb @@ -15,7 +15,7 @@ class RailsIntegrationTest < Test::Unit::TestCase end def test_rails_install - # within_tmp_directory do + within_tmp_directory do begin generate_rails_app_directories("compass_rails") Dir.chdir "compass_rails" do @@ -30,7 +30,7 @@ class RailsIntegrationTest < Test::Unit::TestCase ensure FileUtils.rm_rf "compass_rails" end - #end + end rescue LoadError puts "Skipping rails test. Couldn't Load rails" end