Allow stand-alone projects to have their own extensions directory.

This commit is contained in:
Chris Eppstein 2009-07-26 22:47:59 -07:00
parent bc27541378
commit 44e810e840
5 changed files with 22 additions and 3 deletions

View File

@ -10,6 +10,9 @@ module Compass
read_project_configuration read_project_configuration
Compass.add_configuration(options) Compass.add_configuration(options)
Compass.add_configuration(installer.completed_configuration) Compass.add_configuration(installer.completed_configuration)
if File.exists?(Compass.configuration.extensions_path)
Compass::Frameworks.discover(Compass.configuration.extensions_path)
end
end end
def installer def installer

View File

@ -1,9 +1,9 @@
module Compass module Compass
module Commands module Commands
class ListFrameworks class ListFrameworks < ProjectBase
attr_accessor :options attr_accessor :options
def initialize(working_path, options) def initialize(working_path, options)
self.options = options super
end end
def execute def execute

View File

@ -12,10 +12,10 @@ module Compass
super(working_path, options) super(working_path, options)
self.project_name = determine_project_name(working_path, options) self.project_name = determine_project_name(working_path, options)
Compass.configuration.project_path = determine_project_directory(working_path, options) Compass.configuration.project_path = determine_project_directory(working_path, options)
configure!
end end
def execute def execute
configure!
super super
end end
@ -23,6 +23,9 @@ module Compass
def configure! def configure!
read_project_configuration read_project_configuration
if File.exists?(Compass.configuration.extensions_path)
Compass::Frameworks.discover(Compass.configuration.extensions_path)
end
end end
def projectize(path) def projectize(path)

View File

@ -8,10 +8,12 @@ module Compass
:sass_dir, :sass_dir,
:images_dir, :images_dir,
:javascripts_dir, :javascripts_dir,
:extensions_dir,
:css_path, :css_path,
:sass_path, :sass_path,
:images_path, :images_path,
:javascripts_path, :javascripts_path,
:extensions_path,
:http_path, :http_path,
:http_images_dir, :http_images_dir,
:http_stylesheets_dir, :http_stylesheets_dir,

View File

@ -10,6 +10,10 @@ module Compass
"/" "/"
end end
def default_extensions_dir
"extensions"
end
def default_output_style def default_output_style
if top_level.environment == :development if top_level.environment == :development
:expanded :expanded
@ -46,6 +50,13 @@ module Compass
end end
end end
def default_extensions_path
if (pp = top_level.project_path) && (dir = top_level.extensions_dir)
File.join(pp, dir)
end
end
def default_http_images_dir def default_http_images_dir
top_level.images_dir top_level.images_dir
end end