Make sure the required libraries appear in the generated configuration file.

This commit is contained in:
Chris Eppstein 2009-11-30 23:31:17 -08:00
parent fdd2cdacaa
commit 21cf6c870f
3 changed files with 5 additions and 5 deletions

View File

@ -29,6 +29,7 @@ module Compass
:relative_assets,
:additional_import_paths,
:sass_options,
# Helper configuration
:asset_host,
:asset_cache_buster,
:line_comments,

View File

@ -17,7 +17,6 @@ module Compass
# required.
class Data
attr_accessor :required_libraries
attr_reader :name
include Compass::Configuration::Inheritance
@ -25,11 +24,11 @@ module Compass
include Compass::Configuration::Adapters
inherited_accessor *ATTRIBUTES
inherited_accessor :required_libraries #XXX we should make this array add up cumulatively.
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
end
@ -81,7 +80,7 @@ module Compass
# Require a compass plugin and capture that it occured so that the configuration serialization works next time.
def require(lib)
required_libraries << lib
(self.required_libraries ||= []) << lib
super
end

View File

@ -48,11 +48,11 @@ module Compass
def serialize
contents = ""
required_libraries.each do |lib|
(required_libraries || []).each do |lib|
contents << %Q{require '#{lib}'\n}
end
contents << "# Require any additional compass plugins here.\n"
contents << "\n" if required_libraries.any?
contents << "\n" if (required_libraries || []).any?
ATTRIBUTES.each do |prop|
value = send("#{prop}_without_default")
if value.is_a?(Proc)