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,
|
:relative_assets,
|
||||||
:additional_import_paths,
|
:additional_import_paths,
|
||||||
:sass_options,
|
:sass_options,
|
||||||
|
# Helper configuration
|
||||||
:asset_host,
|
:asset_host,
|
||||||
:asset_cache_buster,
|
:asset_cache_buster,
|
||||||
:line_comments,
|
:line_comments,
|
||||||
|
@ -17,7 +17,6 @@ module Compass
|
|||||||
# required.
|
# required.
|
||||||
class Data
|
class Data
|
||||||
|
|
||||||
attr_accessor :required_libraries
|
|
||||||
attr_reader :name
|
attr_reader :name
|
||||||
|
|
||||||
include Compass::Configuration::Inheritance
|
include Compass::Configuration::Inheritance
|
||||||
@ -25,11 +24,11 @@ module Compass
|
|||||||
include Compass::Configuration::Adapters
|
include Compass::Configuration::Adapters
|
||||||
|
|
||||||
inherited_accessor *ATTRIBUTES
|
inherited_accessor *ATTRIBUTES
|
||||||
|
inherited_accessor :required_libraries #XXX we should make this array add up cumulatively.
|
||||||
|
|
||||||
def initialize(name, attr_hash = nil)
|
def initialize(name, attr_hash = nil)
|
||||||
raise "I need a name!" unless name
|
raise "I need a name!" unless name
|
||||||
@name = name
|
@name = name
|
||||||
self.required_libraries = []
|
|
||||||
set_all(attr_hash) if attr_hash
|
set_all(attr_hash) if attr_hash
|
||||||
self.top_level = self
|
self.top_level = self
|
||||||
end
|
end
|
||||||
@ -81,7 +80,7 @@ module Compass
|
|||||||
|
|
||||||
# Require a compass plugin and capture that it occured so that the configuration serialization works next time.
|
# Require a compass plugin and capture that it occured so that the configuration serialization works next time.
|
||||||
def require(lib)
|
def require(lib)
|
||||||
required_libraries << lib
|
(self.required_libraries ||= []) << lib
|
||||||
super
|
super
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -48,11 +48,11 @@ module Compass
|
|||||||
|
|
||||||
def serialize
|
def serialize
|
||||||
contents = ""
|
contents = ""
|
||||||
required_libraries.each do |lib|
|
(required_libraries || []).each do |lib|
|
||||||
contents << %Q{require '#{lib}'\n}
|
contents << %Q{require '#{lib}'\n}
|
||||||
end
|
end
|
||||||
contents << "# Require any additional compass plugins here.\n"
|
contents << "# Require any additional compass plugins here.\n"
|
||||||
contents << "\n" if required_libraries.any?
|
contents << "\n" if (required_libraries || []).any?
|
||||||
ATTRIBUTES.each do |prop|
|
ATTRIBUTES.each do |prop|
|
||||||
value = send("#{prop}_without_default")
|
value = send("#{prop}_without_default")
|
||||||
if value.is_a?(Proc)
|
if value.is_a?(Proc)
|
||||||
|
Loading…
Reference in New Issue
Block a user