Allow a ruby configuration file named config.rb to be placed at the top of a compass project to import other plugins and frameworks.
This commit is contained in:
parent
0b68f55948
commit
77077c6347
@ -36,6 +36,7 @@ module Compass
|
|||||||
end
|
end
|
||||||
|
|
||||||
def perform
|
def perform
|
||||||
|
read_project_configuration
|
||||||
Dir.glob(separate("#{project_src_directory}/**/[^_]*.sass")).each do |sass_file|
|
Dir.glob(separate("#{project_src_directory}/**/[^_]*.sass")).each do |sass_file|
|
||||||
stylesheet_name = sass_file[("#{project_src_directory}/".length)..-6]
|
stylesheet_name = sass_file[("#{project_src_directory}/".length)..-6]
|
||||||
compile "#{project_src_subdirectory}/#{stylesheet_name}.sass", "#{project_css_subdirectory}/#{stylesheet_name}.css", options
|
compile "#{project_src_subdirectory}/#{stylesheet_name}.sass", "#{project_css_subdirectory}/#{stylesheet_name}.css", options
|
||||||
@ -76,6 +77,15 @@ module Compass
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Read the configuration file for this project
|
||||||
|
def read_project_configuration
|
||||||
|
config_file = projectize('config.rb')
|
||||||
|
if File.exists?(config_file)
|
||||||
|
contents = open(config_file) {|f| f.read}
|
||||||
|
eval(contents, nil, config_file)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# where to load sass files from
|
# where to load sass files from
|
||||||
def sass_load_paths
|
def sass_load_paths
|
||||||
@sass_load_paths ||= [project_src_directory] + Compass::Frameworks::ALL.map{|f| f.stylesheets_directory}
|
@sass_load_paths ||= [project_src_directory] + Compass::Frameworks::ALL.map{|f| f.stylesheets_directory}
|
||||||
|
Loading…
Reference in New Issue
Block a user