Class: Grails::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/commands.rb

Instance Method Summary collapse

Instance Method Details

#new(app_name) ⇒ Object



71
72
73
74
75
76
77
78
79
# File 'lib/commands.rb', line 71

def new(app_name)
  app_dir = File.join(Dir.pwd, name)
  Raise "Directory of #{app_name} already exists" if Dir.exist?(app_dir)
  FileUtils.copy_enyry(TEMPLATE_PATH, app_dir)
  Dir.mkdir(File.join(app_dir, "db/migrations"))
  File.new(File.join(app_dir, "config/routes.rb"))
  File.new(File.join(app_dir, "Gemfile"))

end

#serverObject



92
93
94
95
96
97
98
# File 'lib/commands.rb', line 92

def server
  raise "Cannot find Grails app" unless project_root
  require_relative "#{project_root}/config/routes"
  require_relative '../bin/server'
  server = GrailsServer.new(3000)
  server.start
end