diff --git a/lib/compass/app_integration/stand_alone/installer.rb b/lib/compass/app_integration/stand_alone/installer.rb index 5c6177de..25d5ea44 100644 --- a/lib/compass/app_integration/stand_alone/installer.rb +++ b/lib/compass/app_integration/stand_alone/installer.rb @@ -71,6 +71,7 @@ More Resources: NEXTSTEPS end + puts manifest.welcome_message if manifest.welcome_message if manifest.has_stylesheet? puts "\nTo import your new stylesheets add the following lines of HTML (or equivalent) to your webpage:" puts stylesheet_links diff --git a/lib/compass/commands/help.rb b/lib/compass/commands/help.rb index 6cc417e6..dccc313e 100644 --- a/lib/compass/commands/help.rb +++ b/lib/compass/commands/help.rb @@ -26,7 +26,11 @@ Available commands: Compass::Frameworks::ALL.each do |framework| banner << " * #{framework.name}\n" 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 diff --git a/lib/compass/frameworks.rb b/lib/compass/frameworks.rb index e9c8ac2b..d11ff8fb 100644 --- a/lib/compass/frameworks.rb +++ b/lib/compass/frameworks.rb @@ -18,6 +18,13 @@ module Compass def template_directories Dir.glob(File.join(templates_directory, "*")).map{|f| File.basename(f)} 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 def register(name, *arguments) @@ -66,6 +73,8 @@ module Compass usage_file = File.join(framework.templates_directory, template, "USAGE.markdown") if File.exists?(usage_file) File.read(usage_file) + elsif help = framework.manifest(template).help + help else <<-END.gsub(/^ {8}/, '') No Usage! diff --git a/lib/compass/installers/manifest.rb b/lib/compass/installers/manifest.rb index 0f1978f5..b90831ff 100644 --- a/lib/compass/installers/manifest.rb +++ b/lib/compass/installers/manifest.rb @@ -40,6 +40,30 @@ module Compass type :file 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 def each @entries.each {|e| yield e} @@ -76,4 +100,4 @@ module Compass end end -end \ No newline at end of file +end