Class: KStarter::Commands::ProjectMenu
- Defined in:
- lib/k_starter/commands/project/project_menu.rb
Overview
Submenu for project
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
- #execute(input: $stdin, output: $stdout) ⇒ Object
-
#initialize(subcommand, options) ⇒ ProjectMenu
constructor
A new instance of ProjectMenu.
Methods inherited from Command
#ask_questions, #display_exiting_projects, #select_project
Methods included from TtyHelpers
#command, #config, #cursor, #editor, #exec_exist?, #generator, #pager, #platform, #prompt, #screen, #which
Constructor Details
#initialize(subcommand, options) ⇒ ProjectMenu
Returns a new instance of ProjectMenu.
7 8 9 10 11 12 |
# File 'lib/k_starter/commands/project/project_menu.rb', line 7 def initialize(subcommand, ) @subcommand = (subcommand || '').to_sym @options = super() end |
Instance Method Details
#execute(input: $stdin, output: $stdout) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/k_starter/commands/project/project_menu.rb', line 14 def execute(input: $stdin, output: $stdout) command = nil loop do case @subcommand when :new command = KStarter::Commands::SelectNewProjectType.new(:menu) when :edit command = KStarter::Commands::EditProject.new when :bootstrap command = KStarter::Commands::BootstrapProject.new end command&.execute(input: input, output: output) if command break if .nil? end end |