Class: InstallGemLocal::Navigation

Inherits:
Object
  • Object
show all
Defined in:
lib/install_gem_local/navigation.rb

Class Method Summary collapse

Class Method Details

.startObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/install_gem_local/navigation.rb', line 6

def start
  options = {
    'a' => { 'value' => 'remove_gem', 'display' => 'Remove version' },
    'b' => { 'value' => 'build_gem', 'display' => 'Build new version' },
    'c' => { 'value' => 'install_gem', 'display' => 'Install new version' },
    'd' => { 'value' => 'copy_gem', 'display' => 'Copy gem to folder' },
    'e' => { 'value' => 'push_gem', 'display' => 'Build the latest version and push the gem' },
    'f' => { 'value' => 'till_install', 'display' => 'Remove old version, build and install the new version' },
    'g' => { 'value' => 'till_copy', 'display' => 'Remove old version, build, install and copy the new version' },
    '/' => { 'value' => 'exit', 'display' => 'Exit' }
  }

  selection = InstallGemLocal::Helper.prompt_options(
    flash_message: InstallGemLocal::Helper.flash_message(title: 'Select Action'),
    options: options
  )

  unless selection == 'exit'
    InstallGemLocal::Action.send(selection.to_sym)
    #InstallGemLocal::Navigation.start
  end

rescue StandardError => e
  ap e
  ap 'Something Wrong! Try again!'
end