Class: Wizard

Inherits:
Object
  • Object
show all
Defined in:
lib/kafo/wizard.rb

Instance Method Summary collapse

Constructor Details

#initializeWizard

Returns a new instance of Wizard.



6
7
8
9
10
11
# File 'lib/kafo/wizard.rb', line 6

def initialize
  setup_terminal
  setup_colors
  @name   = 'Kafo'
  @config = KafoConfigure.config
end

Instance Method Details

#runObject



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/kafo/wizard.rb', line 13

def run
  message = "Welcome to the #{@name} installer!"
  say("<%= color('#{message}', :headline) %>")
  say("<%= color('#{'-' * message.size}', :horizontal_line) %>")
  say(<<END)

This wizard will gather all required information. You can change any parameter to your needs.

END

  exit 0 unless agree("\n<%= color('Ready to start?', :question) %> (y/n)", false)

  main_menu
end