Top Level Namespace
Defined Under Namespace
Modules: Prigner Classes: Hash, NilClass, Pathname, Struct, Symbol
Instance Method Summary collapse
Instance Method Details
#templates_by_namespace(options = { :indent => nil, :details => false }) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/prigner/cli/list.rb', line 9 def templates_by_namespace( = { :indent => nil, :details => false }) puts "#{Prigner::Version}" puts "\nThe templates tagged with '*' are customized by user." = [] Prigner::Template.all.map do |namespace, list| << "#{namespace}:" list.map do |template, custom| formatting = "#{[:indent]}#{custom ? :* : :-} %s (%s)" attributes = [template.name, template.spec.version] if [:details] formatting = "#{[:indent]}#{custom ? :* : :-} %s (%s)\n" + "#{[:indent]} %s\n" + "#{[:indent]} Written by %s <%s>\n" attributes = [ template.name, template.spec.version, template.spec.description, template.spec., template.spec.email ] end << (formatting % attributes) end end puts "\n#{.join("\n")}" end |