From 51315469d891f2a69f3c4c4a7b96815b851b59dc Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Wed, 18 Nov 2009 23:44:30 -0800 Subject: [PATCH] [Rails] Allow compass extensions to be stored in the vendor/plugins/compass/extensions directory. --- features/extensions.feature | 20 +++++++++++++++++++ features/step_definitions/extension_steps.rb | 13 ++++++++++++ .../rails/configuration_defaults.rb | 4 ++++ 3 files changed, 37 insertions(+) create mode 100644 features/extensions.feature create mode 100644 features/step_definitions/extension_steps.rb diff --git a/features/extensions.feature b/features/extensions.feature new file mode 100644 index 00000000..34c8c1e8 --- /dev/null +++ b/features/extensions.feature @@ -0,0 +1,20 @@ +Feature: Extensions + In order to have an open source ecosystem for stylesheets + As a compass user + I can install extensions that others have created + And I can create and publish my own extensions + + Scenario: Extensions directory for stand_alone projects + Given I am using the existing project in test/fixtures/stylesheets/compass + And the "extensions" directory exists + And and I have a fake extension at extensions/testing + When I run: compass --list-frameworks + Then the list of frameworks includes "testing" + + Scenario: Extensions directory for rails projects + Given I'm in a newly created rails project: my_rails_project + And the "my_rails_project/vendor/plugins/compass/extensions" directory exists + And and I have a fake extension at my_rails_project/vendor/plugins/compass/extensions/testing + When I run: compass --list-frameworks + Then the list of frameworks includes "testing" + diff --git a/features/step_definitions/extension_steps.rb b/features/step_definitions/extension_steps.rb new file mode 100644 index 00000000..f6216c1e --- /dev/null +++ b/features/step_definitions/extension_steps.rb @@ -0,0 +1,13 @@ +Given /^the "([^\"]*)" directory exists$/ do |directory| + FileUtils.mkdir_p directory +end + +Given /^and I have a fake extension at (.*)$/ do |directory| + FileUtils.mkdir_p File.join(directory, 'stylesheets') + FileUtils.mkdir_p File.join(directory, 'templates/project') +end + +Then /^the list of frameworks includes "([^\"]*)"$/ do |framework| + @last_result.split("\n").map{|f| f.strip}.should include(framework) +end + diff --git a/lib/compass/app_integration/rails/configuration_defaults.rb b/lib/compass/app_integration/rails/configuration_defaults.rb index 21fade64..93fe449a 100644 --- a/lib/compass/app_integration/rails/configuration_defaults.rb +++ b/lib/compass/app_integration/rails/configuration_defaults.rb @@ -27,6 +27,10 @@ module Compass "/stylesheets" end + def default_extensions_dir + "vendor/plugins/compass/extensions" + end + end end end