Class: Kafo::Wizard
- Inherits:
-
Object
- Object
- Kafo::Wizard
- Extended by:
- Forwardable
- Defined in:
- lib/kafo/wizard.rb
Constant Summary collapse
- OK =
utf_support? ? '✓' : 'y'
- NO =
utf_support? ? '✗' : 'n'
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(kafo, input = $stdin, output = $stdout) ⇒ Wizard
constructor
A new instance of Wizard.
- #run ⇒ Object
Constructor Details
#initialize(kafo, input = $stdin, output = $stdout) ⇒ Wizard
Returns a new instance of Wizard.
18 19 20 21 22 23 |
# File 'lib/kafo/wizard.rb', line 18 def initialize(kafo, input = $stdin, output = $stdout) @kafo = kafo @config = kafo.config @name = @config.app[:name] || 'Kafo' @highline = setup_terminal(input, output) end |
Class Method Details
Instance Method Details
#run ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/kafo/wizard.rb', line 25 def run = "Welcome to the #{@name} installer!" say(HighLine.color(, :headline)) say(HighLine.color('-' * .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) rescue Interrupt puts "Got interrupt, exiting" KafoConfigure.exit(130) end |