Class: Kafo::Wizard
- Inherits:
-
Object
- Object
- Kafo::Wizard
- Defined in:
- lib/kafo/wizard.rb
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.
7 8 9 10 11 12 13 |
# File 'lib/kafo/wizard.rb', line 7 def initialize(kafo) @kafo = kafo @config = kafo.config @name = @config.app[:name] || 'Kafo' setup_terminal setup_colors end |
Instance Method Details
#run ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/kafo/wizard.rb', line 15 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 |