From 59e626fe8ba85e356c5f8c3176e9fdfb3ede535a Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Sun, 1 Feb 2009 14:18:27 -0800 Subject: [PATCH] Factored out a Configuration object to parse stand-alone project configuration files. --- lib/compass/configuration.rb | 17 +++++++++++++++++ lib/compass/exec.rb | 1 + 2 files changed, 18 insertions(+) create mode 100644 lib/compass/configuration.rb diff --git a/lib/compass/configuration.rb b/lib/compass/configuration.rb new file mode 100644 index 00000000..f7a59f29 --- /dev/null +++ b/lib/compass/configuration.rb @@ -0,0 +1,17 @@ +module Compass + class Configuration + attr_accessor :css_dir, :sass_dir, :images_dir, :javascripts_dir + + # parses a manifest file which is a ruby script + # evaluated in a Manifest instance context + def parse(config_file) + open(config_file) do |f| + eval(f.read, instance_binding, config_file) + end + end + + def instance_binding + binding + end + end +end diff --git a/lib/compass/exec.rb b/lib/compass/exec.rb index 3198851c..2350dd2b 100644 --- a/lib/compass/exec.rb +++ b/lib/compass/exec.rb @@ -2,6 +2,7 @@ require 'optparse' require 'rubygems' require 'haml' require File.join(Compass.lib_directory, 'compass', 'logger') +require File.join(Compass.lib_directory, 'compass', 'configuration') module Compass module Exec