Load extensions found in ~/.compass/extensions, if the directory exists.

This commit is contained in:
Chris Eppstein 2011-03-21 09:29:43 -07:00
parent cca6474ba2
commit 3272dc7e5a
4 changed files with 23 additions and 3 deletions

View File

@ -14,7 +14,12 @@ The Documentation for the [latest stable release](http://compass-style.org/docs/
The Documentation for the [latest preview release](http://beta.compass-style.org/) The Documentation for the [latest preview release](http://beta.compass-style.org/)
0.11.beta.3 (3/15/2011) 0.11.beta.4 (UNRELEASED)
------------------------
* Extensions that are installed into ~/.compass/extensions will be automatically available to all your compass projects.
0.11.beta.3 (03/15/2011)
------------------------ ------------------------
### Compass CSS3 ### Compass CSS3

View File

@ -20,3 +20,10 @@ Feature: Extensions
When I run: compass frameworks When I run: compass frameworks
Then the list of frameworks includes "testing" Then the list of frameworks includes "testing"
@listframeworks
Scenario: Shared extensions directory
Given I am using the existing project in test/fixtures/stylesheets/compass
And the "~/.compass/extensions" directory exists
And and I have a fake extension at ~/.compass/extensions/testing
When I run: compass frameworks
Then the list of frameworks includes "testing"

View File

@ -14,7 +14,10 @@ module Compass
def lib_directory def lib_directory
File.expand_path(File.join(File.dirname(__FILE__))) File.expand_path(File.join(File.dirname(__FILE__)))
end end
module_function :base_directory, :lib_directory def shared_extension_paths
[File.expand_path("~/.compass/extensions")]
end
module_function :base_directory, :lib_directory, :shared_extension_paths
extend QuickCache extend QuickCache
end end

View File

@ -101,7 +101,12 @@ module Compass
end end
def discover_extensions! def discover_extensions!
if File.exists?(configuration.extensions_path) Compass.shared_extension_paths.each do |extensions_path|
if File.directory?(extensions_path)
Compass::Frameworks.discover(extensions_path)
end
end
if File.directory?(configuration.extensions_path)
Compass::Frameworks.discover(configuration.extensions_path) Compass::Frameworks.discover(configuration.extensions_path)
end end
end end