Class: KStarter::Commands::BootstrapProject

Inherits:
Command
  • Object
show all
Defined in:
lib/k_starter/commands/project/bootstrap_project.rb

Overview

Submenu for new

Instance Attribute Summary

Attributes inherited from Command

#escape_pressed

Instance Method Summary collapse

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(**options) ⇒ BootstrapProject

Returns a new instance of BootstrapProject.



7
8
9
10
# File 'lib/k_starter/commands/project/bootstrap_project.rb', line 7

def initialize(**options)
  @options = options
  super()
end

Instance Method Details

#bootstrap_project(project) ⇒ Object



20
21
22
23
24
25
# File 'lib/k_starter/commands/project/bootstrap_project.rb', line 20

def bootstrap_project(project)
  puts JSON.pretty_generate(project.to_h)

  starter = KStarter::Map.starter(project)
  starter.execute
end

#execute(input: $stdin, output: $stdout) ⇒ Object



12
13
14
15
16
17
18
# File 'lib/k_starter/commands/project/bootstrap_project.rb', line 12

def execute(input: $stdin, output: $stdout)
  display_exiting_projects
  project = select_project

  # Is the if project even relevant at the moment?
  bootstrap_project(project) if project
end