10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
# File 'lib/g2/cli.rb', line 10
def new app_root
say "create a new grape goliath application named #{app_root}", :green
@app_name = app_root.capitalize
%w{app app/apis app/helpers app/models config config/environments db script log tmp tmp/pids spec}.each do |item|
empty_directory app_root + "/" + item
end
{
application: "config/application.rb",
database: "config/database.yml",
spec_helper: "spec/spec_helper.rb",
gemfile: "Gemfile",
guardfile: "Guardfile",
rakefile: "Rakefile",
rspec_config: ".rspec",
server: "script/server.rb"
}.each do |k, v|
template("templates/#{k}.erb", "#{app_root}/#{v}")
end
inside app_root do
run "bundle install"
end
end
|