centralize the config setup and parsing for commands.

This commit is contained in:
Chris Eppstein 2009-04-06 00:34:27 -07:00
parent c36f63fd92
commit 6c0a301d91
4 changed files with 3 additions and 9 deletions

View File

@ -12,9 +12,6 @@ module Compass
end end
def perform def perform
read_project_configuration
Compass.configuration.set_maybe(options)
Compass.configuration.set_defaults!
column_width, gutter_width = options[:grid_dimensions].split(/\+/).map{|d| d.to_i} column_width, gutter_width = options[:grid_dimensions].split(/\+/).map{|d| d.to_i}
unless GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :output_path => projectize(project_images_subdirectory), :working_path => self.working_path)).generate! unless GridBuilder.new(options.merge(:column_width => column_width, :gutter_width => gutter_width, :output_path => projectize(project_images_subdirectory), :working_path => self.working_path)).generate!
puts "ERROR: Some library dependencies appear to be missing." puts "ERROR: Some library dependencies appear to be missing."

View File

@ -13,6 +13,9 @@ 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)
read_project_configuration
Compass.configuration.set_maybe(options)
Compass.configuration.set_defaults!
end end
protected protected

View File

@ -11,9 +11,6 @@ module Compass
end end
def perform def perform
read_project_configuration
Compass.configuration.set_maybe(options)
Compass.configuration.set_defaults!
Compass::Compiler.new(working_path, Compass::Compiler.new(working_path,
projectize(Compass.configuration.sass_dir), projectize(Compass.configuration.sass_dir),
projectize(Compass.configuration.css_dir), projectize(Compass.configuration.css_dir),

View File

@ -10,9 +10,6 @@ module Compass
end end
def perform def perform
read_project_configuration
Compass.configuration.set_maybe(options)
Compass.configuration.set_defaults!
config_file = projectize("config.rb") config_file = projectize("config.rb")
if File.exists?(config_file) if File.exists?(config_file)
if options[:force] if options[:force]