Make sure the required libraries appear in the generated configuration file.
This commit is contained in:
parent
fdd2cdacaa
commit
21cf6c870f
@ -29,6 +29,7 @@ module Compass
|
||||
:relative_assets,
|
||||
:additional_import_paths,
|
||||
:sass_options,
|
||||
# Helper configuration
|
||||
:asset_host,
|
||||
:asset_cache_buster,
|
||||
:line_comments,
|
||||
|
@ -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
|
||||
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user