Class: WagnGenerator::Interactive
- Inherits:
-
Object
- Object
- WagnGenerator::Interactive
- Defined in:
- lib/wagn/generators/wagn/wagn_generator/interactive.rb
Overview
Guides through the wagn deck installation with an interactive menu Offers the possibilitiy to
- edit database config
- edit application.rb
- seed database
- run server
Instance Method Summary collapse
-
#initialize(options, destination_root) ⇒ Interactive
constructor
A new instance of Interactive.
- #run ⇒ Object
Constructor Details
#initialize(options, destination_root) ⇒ Interactive
Returns a new instance of Interactive.
9 10 11 12 |
# File 'lib/wagn/generators/wagn/wagn_generator/interactive.rb', line 9 def initialize , destination_root @dev = ["core-dev"] || ["mod-dev"] @destination_root = destination_root end |
Instance Method Details
#run ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/wagn/generators/wagn/wagn_generator/interactive.rb', line 14 def run require config_path("application") # need this for Rails.env @menu = ActiveSupport::OrderedHash.new add_exit_option while (answer = ask()) != "x" if @menu.key? answer @menu[answer][:code].call else puts "invalid choice" end end end |