More flexible manifests that can see the installation options and might
not even have any stylesheets or require a project configuration file.
This commit is contained in:
parent
9105d5a8de
commit
92464c5f6a
@ -14,7 +14,7 @@ module Compass
|
||||
@target_path = target_path
|
||||
@working_path = Dir.getwd
|
||||
@options = options
|
||||
@manifest = Manifest.new(manifest_file) if template_path
|
||||
@manifest = Manifest.new(manifest_file, options) if template_path
|
||||
self.logger = options[:logger]
|
||||
end
|
||||
|
||||
|
@ -11,8 +11,12 @@ module Compass
|
||||
end
|
||||
end
|
||||
|
||||
def initialize(manifest_file = nil)
|
||||
attr_reader :options
|
||||
def initialize(manifest_file = nil, options = {})
|
||||
@entries = []
|
||||
@options = options
|
||||
@generate_config = true
|
||||
@compile_after_generation = true
|
||||
parse(manifest_file) if manifest_file
|
||||
end
|
||||
|
||||
@ -41,8 +45,24 @@ module Compass
|
||||
@entries.each {|e| yield e}
|
||||
end
|
||||
|
||||
def generate_config?
|
||||
@generate_config
|
||||
end
|
||||
|
||||
def compile?
|
||||
@compile_after_generation
|
||||
end
|
||||
|
||||
protected
|
||||
|
||||
def no_configuration_file!
|
||||
@generate_config = false
|
||||
end
|
||||
|
||||
def skip_compilation!
|
||||
@compile_after_generation = false
|
||||
end
|
||||
|
||||
# parses a manifest file which is a ruby script
|
||||
# evaluated in a Manifest instance context
|
||||
def parse(manifest_file)
|
||||
|
@ -62,9 +62,11 @@ page request and keep them up to date when they change.
|
||||
Make sure you restart your server!
|
||||
NEXTSTEPS
|
||||
end
|
||||
puts "\nNext add these lines to the head of your layouts:\n\n"
|
||||
puts stylesheet_links
|
||||
puts "\n(You are using haml, aren't you?)"
|
||||
if manifest.has_stylesheet?
|
||||
puts "\nNext add these lines to the head of your layouts:\n\n"
|
||||
puts stylesheet_links
|
||||
puts "\n(You are using haml, aren't you?)"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
@ -43,7 +43,7 @@ module Compass
|
||||
end
|
||||
|
||||
def prepare
|
||||
write_configuration_files unless config_files_exist?
|
||||
write_configuration_files unless config_files_exist? || !@manifest.generate_config?
|
||||
end
|
||||
|
||||
def default_configuration
|
||||
@ -69,12 +69,14 @@ This can be done in one of the following ways:
|
||||
compass --watch [path/to/project]
|
||||
NEXTSTEPS
|
||||
end
|
||||
puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
|
||||
puts stylesheet_links
|
||||
if manifest.has_stylesheet?
|
||||
puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
|
||||
puts stylesheet_links
|
||||
end
|
||||
end
|
||||
|
||||
def compilation_required?
|
||||
true
|
||||
@manifest.compile?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user