Method: WagnGenerator::Interactive#run

Defined in:
lib/wagn/generators/wagn/wagn_generator/interactive.rb

#runObject



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_config_options
  add_seed_options
  add_exit_option
  while (answer = ask(build_menu)) != "x"
    if @menu.key? answer
      @menu[answer][:code].call
    else
      puts "invalid choice"
    end
  end
end