Name all configuration sources for debugging purposes.
This commit is contained in:
parent
a281dc1d5f
commit
bd422403bd
@ -16,7 +16,7 @@ module Compass
|
||||
end
|
||||
|
||||
def configuration
|
||||
Compass::Configuration::Data.new.
|
||||
Compass::Configuration::Data.new('rails').
|
||||
extend(ConfigurationDefaults)
|
||||
end
|
||||
|
||||
|
@ -10,10 +10,6 @@ module Compass
|
||||
module Rails
|
||||
class Installer < Compass::Installers::ManifestInstaller
|
||||
|
||||
def default_configuration
|
||||
Compass::Configuration::Data.new.extend(ConfigurationDefaults)
|
||||
end
|
||||
|
||||
def completed_configuration
|
||||
config = {}
|
||||
config[:sass_dir] = prompt_sass_dir unless sass_dir_without_default
|
||||
|
@ -13,7 +13,7 @@ module Compass
|
||||
end
|
||||
|
||||
def configuration
|
||||
Compass::Configuration::Data.new.
|
||||
Compass::Configuration::Data.new('stand_alone').
|
||||
extend(ConfigurationDefaults)
|
||||
end
|
||||
|
||||
|
@ -35,10 +35,6 @@ module Compass
|
||||
write_configuration_files unless config_files_exist? || !@manifest.generate_config?
|
||||
end
|
||||
|
||||
def default_configuration
|
||||
Compass::Configuration::Data.new.extend(Compass::AppIntegration::StandAlone::ConfigurationDefaults)
|
||||
end
|
||||
|
||||
def completed_configuration
|
||||
nil
|
||||
end
|
||||
|
@ -66,7 +66,7 @@ Options:
|
||||
def initialize(working_path, options)
|
||||
super
|
||||
assert_project_directory_exists!
|
||||
Compass.add_configuration(options)
|
||||
Compass.add_configuration(options, 'command_line')
|
||||
end
|
||||
|
||||
def perform
|
||||
|
@ -8,8 +8,8 @@ module Compass
|
||||
def configure!
|
||||
Compass.add_configuration(options[:project_type] || :stand_alone)
|
||||
Compass.add_project_configuration unless respond_to?(:is_project_creation?) && is_project_creation?
|
||||
Compass.add_configuration(options)
|
||||
Compass.add_configuration(installer.completed_configuration)
|
||||
Compass.add_configuration(options, 'command_line')
|
||||
Compass.add_configuration(installer.completed_configuration, 'installer')
|
||||
if File.exists?(Compass.configuration.extensions_path)
|
||||
Compass::Frameworks.discover(Compass.configuration.extensions_path)
|
||||
end
|
||||
|
@ -41,6 +41,14 @@ module Compass
|
||||
|
||||
def perform
|
||||
if options[:debug]
|
||||
puts "Configuration sources:"
|
||||
c = Compass.configuration
|
||||
while c
|
||||
print c.name
|
||||
c = c.inherited_data
|
||||
print ", " if c
|
||||
end
|
||||
print "\n"
|
||||
Compass.configuration.debug.each do |prop, values|
|
||||
if options[:debug].is_a?(Symbol)
|
||||
next unless prop == options[:debug]
|
||||
|
@ -18,6 +18,7 @@ module Compass
|
||||
class Data
|
||||
|
||||
attr_accessor :required_libraries
|
||||
attr_reader :name
|
||||
|
||||
include Compass::Configuration::Inheritance
|
||||
include Compass::Configuration::Serialization
|
||||
@ -25,7 +26,9 @@ module Compass
|
||||
|
||||
inherited_accessor *ATTRIBUTES
|
||||
|
||||
def initialize(attr_hash = nil)
|
||||
def initialize(name, attr_hash = nil)
|
||||
raise "I need a name!" unless name
|
||||
@name = name
|
||||
self.required_libraries = []
|
||||
set_all(attr_hash) if attr_hash
|
||||
self.top_level = self
|
||||
@ -100,4 +103,4 @@ module Compass
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -11,14 +11,17 @@ module Compass
|
||||
end
|
||||
|
||||
def default_configuration
|
||||
Data.new.extend(Defaults).extend(Comments)
|
||||
Data.new('defaults').extend(Defaults).extend(Comments)
|
||||
end
|
||||
|
||||
def add_configuration(config, filename = nil)
|
||||
return if config.nil?
|
||||
|
||||
|
||||
data = configuration_for(config, filename)
|
||||
|
||||
# puts "New configuration: #{data.name}"
|
||||
# puts caller.join("\n")
|
||||
data.inherit_from!(configuration)
|
||||
data.on_top!
|
||||
@configuration = data
|
||||
@ -30,7 +33,7 @@ module Compass
|
||||
elsif config.respond_to?(:read)
|
||||
Compass::Configuration::Data.new_from_string(config.read, filename)
|
||||
elsif config.is_a?(Hash)
|
||||
Compass::Configuration::Data.new(config)
|
||||
Compass::Configuration::Data.new(filename, config)
|
||||
elsif config.is_a?(String)
|
||||
Compass::Configuration::Data.new_from_file(config)
|
||||
elsif config.is_a?(Symbol)
|
||||
@ -67,7 +70,7 @@ module Compass
|
||||
configuration_file_path ||= detect_configuration_file
|
||||
if configuration_file_path
|
||||
|
||||
data = configuration_for(configuration_file_path)
|
||||
data = configuration_for(configuration_file_path)
|
||||
|
||||
if data.raw_project_type
|
||||
add_configuration(data.raw_project_type.to_sym)
|
||||
|
@ -9,13 +9,13 @@ module Compass
|
||||
|
||||
module ClassMethods
|
||||
def new_from_file(config_file)
|
||||
data = Data.new
|
||||
data = Data.new(config_file)
|
||||
data.parse(config_file)
|
||||
data
|
||||
end
|
||||
|
||||
def new_from_string(contents, filename)
|
||||
data = Data.new
|
||||
data = Data.new(filename)
|
||||
data.parse_string(contents, filename)
|
||||
data
|
||||
end
|
||||
|
@ -2,10 +2,6 @@ module Compass
|
||||
module Installers
|
||||
|
||||
class BareInstaller < Base
|
||||
def default_configuration
|
||||
Compass::Configuration::Data.new.extend(Compass::AppIntegration::StandAlone::ConfigurationDefaults)
|
||||
end
|
||||
|
||||
def completed_configuration
|
||||
nil
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user