Class: SshyGuy::Screens::HelpScreen

Inherits:
SshyGuy::Screen show all
Defined in:
lib/sshyguy/screens/help_screen.rb

Instance Attribute Summary

Attributes inherited from SshyGuy::Screen

#options, #prompt

Instance Method Summary collapse

Methods inherited from SshyGuy::Screen

#initialize, show

Constructor Details

This class inherits a constructor from SshyGuy::Screen

Instance Method Details

#showObject



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

def show
  SshyGuy.log('HelpScreen initialized')
  selection = prompt.select('How can I help?') do |select|
    select.enum '.'
    select.choice('Edit config file', :edit)
    select.choice('Jk', :close)
    select.choice('Exit', :exit)
  end
  case selection
  when :edit
    SshyGuy.log('Selected :edit')
    system("#{SshyGuy.config.editor} #{SshyGuy.config_file}")
    exit
  when :exit
    SshyGuy.log('Selected :exit')
    puts 'Bye.'
    SshyGuy.log('Exiting program')
    exit
  when :close
    SshyGuy.log('Selected :close')
    SshyGuy.log('Closing window')

  end
end