Class: Playmo::Cli

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/playmo/cli.rb

Instance Method Summary collapse

Instance Method Details

#new_appObject

TODO: Use internal shell variable



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/playmo/cli.rb', line 27

def new_app
  require_gem

  color = Thor::Shell::Color.new
  shell = Thor::Shell::Basic.new
  shell.padding = 1

  shell.say("\n")

  question = color.set_color('Please enter the name of app you want to create:', :yellow, true)
  
  if application_name = shell.ask(question)
    Playmo::Cookbook.instance.cook_recipes!(application_name, options)
  end

  shell.say("\n")

  system "cd #{application_name} && bundle install" unless options['dry-run']

  Event.events.fire :create_database
  Event.events.fire :install
  Event.events.fire :migrate_database
  Event.events.fire :seed_database
  Event.events.fire :before_exit
end