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