Class: Citrin::CLI
- Inherits:
-
Object
show all
- Extended by:
- Helpers
- Defined in:
- lib/citrin/cli.rb
Class Method Summary
collapse
Methods included from Helpers
database_template_file, logrotate_config_template, rails_app_log_file, webserver_template_file
Class Method Details
.help ⇒ Object
35
36
37
|
# File 'lib/citrin/cli.rb', line 35
def self.help
puts `#{File.dirname(__FILE__)}/../../commands/help`
end
|
.start(*args) ⇒ Object
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/citrin/cli.rb', line 9
def self.start(*args)
command = args.shift.strip rescue "help"
Citrin::Commands.load
name = args[0]
env = args[1]
app = Citrin::App.new(name, env)
case command
when 'version', '--version', '-v'
puts Citrin::VERSION
when "create_database"
return Commands::CreateDatabase.run(app)
when "create_webserver"
return Commands::CreateWebserver.run(app)
when "setup_logrotate"
return Commands::SetupLogrotate.run(app)
when "write_config"
`cp #{File.dirname(__FILE__)}/../../etc/citrin.yml /etc/citrin.yml`
else
begin
puts `#{File.dirname(__FILE__)}/../../commands/#{command} #{args.join(" ")}`
rescue
help
end
end
end
|