From 6c0a301d91c3876b451450676e3eb3efe24f6405 Mon Sep 17 00:00:00 2001 From: Chris Eppstein Date: Mon, 6 Apr 2009 00:34:27 -0700 Subject: [PATCH] centralize the config setup and parsing for commands. --- lib/compass/commands/generate_grid_background.rb | 3 --- lib/compass/commands/project_base.rb | 3 +++ lib/compass/commands/update_project.rb | 3 --- lib/compass/commands/write_configuration.rb | 3 --- 4 files changed, 3 insertions(+), 9 deletions(-) diff --git a/lib/compass/commands/generate_grid_background.rb b/lib/compass/commands/generate_grid_background.rb index 212573c4..d294d030 100644 --- a/lib/compass/commands/generate_grid_background.rb +++ b/lib/compass/commands/generate_grid_background.rb @@ -12,9 +12,6 @@ module Compass end 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} 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." diff --git a/lib/compass/commands/project_base.rb b/lib/compass/commands/project_base.rb index 3c34ffe6..1aba29b3 100644 --- a/lib/compass/commands/project_base.rb +++ b/lib/compass/commands/project_base.rb @@ -13,6 +13,9 @@ module Compass super(working_path, options) self.project_name = determine_project_name(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 protected diff --git a/lib/compass/commands/update_project.rb b/lib/compass/commands/update_project.rb index 7c989573..a42046e9 100644 --- a/lib/compass/commands/update_project.rb +++ b/lib/compass/commands/update_project.rb @@ -11,9 +11,6 @@ module Compass end def perform - read_project_configuration - Compass.configuration.set_maybe(options) - Compass.configuration.set_defaults! Compass::Compiler.new(working_path, projectize(Compass.configuration.sass_dir), projectize(Compass.configuration.css_dir), diff --git a/lib/compass/commands/write_configuration.rb b/lib/compass/commands/write_configuration.rb index 04bbc2e4..8f0af86c 100644 --- a/lib/compass/commands/write_configuration.rb +++ b/lib/compass/commands/write_configuration.rb @@ -10,9 +10,6 @@ module Compass end def perform - read_project_configuration - Compass.configuration.set_maybe(options) - Compass.configuration.set_defaults! config_file = projectize("config.rb") if File.exists?(config_file) if options[:force]