From 77077c634774c5aae4857df3af2af9279a198a87 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Fri, 2 Jan 2009 01:26:16 -0800 Subject: [PATCH] Allow a ruby configuration file named config.rb to be placed at the top of a compass project to import other plugins and frameworks. --- lib/compass/commands/update_project.rb | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/compass/commands/update_project.rb b/lib/compass/commands/update_project.rb index d5f935dd..98d3a34f 100644 --- a/lib/compass/commands/update_project.rb +++ b/lib/compass/commands/update_project.rb @@ -36,6 +36,7 @@ module Compass end def perform + read_project_configuration Dir.glob(separate("#{project_src_directory}/**/[^_]*.sass")).each do |sass_file| stylesheet_name = sass_file[("#{project_src_directory}/".length)..-6] compile "#{project_src_subdirectory}/#{stylesheet_name}.sass", "#{project_css_subdirectory}/#{stylesheet_name}.css", options @@ -75,7 +76,16 @@ module Compass :compact 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 def sass_load_paths @sass_load_paths ||= [project_src_directory] + Compass::Frameworks::ALL.map{|f| f.stylesheets_directory}