Class: Kafo::Wizard
- Inherits:
-
Object
- Object
- Kafo::Wizard
- 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) ⇒ Wizard
constructor
A new instance of Wizard.
- #run ⇒ Object
Constructor Details
#initialize(kafo) ⇒ Wizard
Returns a new instance of Wizard.
15 16 17 18 19 20 |
# File 'lib/kafo/wizard.rb', line 15 def initialize(kafo) @kafo = kafo @config = kafo.config @name = @config.app[:name] || 'Kafo' setup_terminal end |
Class Method Details
Instance Method Details
#run ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/kafo/wizard.rb', line 22 def run = "Welcome to the #{@name} installer!" HighLine.color(, :important) 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" exit(0) end |