9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/cuba/generator/cli.rb', line 9
def run
program :name, 'cuba'
program :version, Cuba::Generator::VERSION
program :description, 'Application Generator for Cuba framework.'
command :new do |c|
c.syntax = 'cuba new [options]'
c.description = 'Creates a new Cuba app'
c.option '--type STRING', String, 'Creates an app with preferred type'
c.option '--database STRING', String, 'Setups a database configuration with DataMapper'
c.action do |args, options|
if options.type
generator = Cuba::Generator.new(ARGV[1], options.type)
generator.create_database_file if options.database == 'postgresql'
else
generator = Cuba::Generator.new(ARGV[1], :app)
generator.create_database_file if options.database == 'postgresql'
end
end
end
run!
end
|