Class: AppArchetype::Commands::ListTemplates

Inherits:
Object
  • Object
show all
Defined in:
lib/app_archetype/commands/list_templates.rb

Overview

Lists known templates for user

Constant Summary collapse

RESULT_HEADER =

Output table header

%w[NAME VERSION].freeze

Instance Method Summary collapse

Constructor Details

#initialize(manager, options = Hashie::Mash.new) ⇒ ListTemplates

Returns a new instance of ListTemplates.



13
14
15
16
17
# File 'lib/app_archetype/commands/list_templates.rb', line 13

def initialize(manager, options = Hashie::Mash.new)
  @manager = manager
  @options = options
  @prompt = TTY::Prompt.new
end

Instance Method Details

#runObject

Lists all known and valid manifests

This renders a manifest list table

Note: any invalid manifests will be excluded from this list.



27
28
29
# File 'lib/app_archetype/commands/list_templates.rb', line 27

def run
  puts(manifest_list_table.render.strip)
end