Allow help, welcome message, and description of an extension to be specified in the manifest file.
This commit is contained in:
parent
8bcdd7360d
commit
353a225ac5
@ -71,6 +71,7 @@ More Resources:
|
|||||||
|
|
||||||
NEXTSTEPS
|
NEXTSTEPS
|
||||||
end
|
end
|
||||||
|
puts manifest.welcome_message if manifest.welcome_message
|
||||||
if manifest.has_stylesheet?
|
if manifest.has_stylesheet?
|
||||||
puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
|
puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:"
|
||||||
puts stylesheet_links
|
puts stylesheet_links
|
||||||
|
@ -26,7 +26,11 @@ Available commands:
|
|||||||
Compass::Frameworks::ALL.each do |framework|
|
Compass::Frameworks::ALL.each do |framework|
|
||||||
banner << " * #{framework.name}\n"
|
banner << " * #{framework.name}\n"
|
||||||
framework.template_directories.each do |pattern|
|
framework.template_directories.each do |pattern|
|
||||||
banner << " - #{framework.name}/#{pattern}\n"
|
banner << " - #{framework.name}/#{pattern}"
|
||||||
|
if description = framework.manifest(pattern).description
|
||||||
|
banner << "\t- #{description}"
|
||||||
|
end
|
||||||
|
banner << "\n"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -18,6 +18,13 @@ module Compass
|
|||||||
def template_directories
|
def template_directories
|
||||||
Dir.glob(File.join(templates_directory, "*")).map{|f| File.basename(f)}
|
Dir.glob(File.join(templates_directory, "*")).map{|f| File.basename(f)}
|
||||||
end
|
end
|
||||||
|
def manifest_file(pattern)
|
||||||
|
File.join(templates_directory, pattern.to_s, "manifest.rb")
|
||||||
|
end
|
||||||
|
def manifest(pattern, options = {})
|
||||||
|
options[:pattern_name] ||= pattern
|
||||||
|
Compass::Installers::Manifest.new(manifest_file(pattern), options)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
def register(name, *arguments)
|
def register(name, *arguments)
|
||||||
@ -66,6 +73,8 @@ module Compass
|
|||||||
usage_file = File.join(framework.templates_directory, template, "USAGE.markdown")
|
usage_file = File.join(framework.templates_directory, template, "USAGE.markdown")
|
||||||
if File.exists?(usage_file)
|
if File.exists?(usage_file)
|
||||||
File.read(usage_file)
|
File.read(usage_file)
|
||||||
|
elsif help = framework.manifest(template).help
|
||||||
|
help
|
||||||
else
|
else
|
||||||
<<-END.gsub(/^ {8}/, '')
|
<<-END.gsub(/^ {8}/, '')
|
||||||
No Usage!
|
No Usage!
|
||||||
|
@ -40,6 +40,30 @@ module Compass
|
|||||||
type :file
|
type :file
|
||||||
type :html
|
type :html
|
||||||
|
|
||||||
|
def help(value = nil)
|
||||||
|
if value
|
||||||
|
@help = value
|
||||||
|
else
|
||||||
|
@help
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def welcome_message(value = nil)
|
||||||
|
if value
|
||||||
|
@welcome_message = value
|
||||||
|
else
|
||||||
|
@welcome_message
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def description(value = nil)
|
||||||
|
if value
|
||||||
|
@description = value
|
||||||
|
else
|
||||||
|
@description
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Enumerates over the manifest files
|
# Enumerates over the manifest files
|
||||||
def each
|
def each
|
||||||
@entries.each {|e| yield e}
|
@entries.each {|e| yield e}
|
||||||
@ -76,4 +100,4 @@ module Compass
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user