Class: Capricorn::Apps::Server
- Defined in:
- lib/capricorn/apps/server.rb
Instance Method Summary collapse
- #reload ⇒ Object
- #restart ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
- #update ⇒ Object
- #version ⇒ Object
Methods inherited from Thor
Instance Method Details
#reload ⇒ Object
47 48 49 |
# File 'lib/capricorn/apps/server.rb', line 47 def reload Capricorn.client([:token]).reload_server end |
#restart ⇒ Object
41 42 43 |
# File 'lib/capricorn/apps/server.rb', line 41 def restart Capricorn.client([:token]).restart_server end |
#start ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/capricorn/apps/server.rb', line 10 def start Capricorn.server? true Capricorn::System.load!([:root_path]) begin FileUtils.mkdir_p(Capricorn.system.root) rescue Errno::EACCES Capricorn.logger.out.fatal "must be executed as root" exit(1) end unless Capricorn.system.is_user('root') Capricorn.logger.out.fatal "must be executed as root" exit(1) end if [:foreground] Capricorn::Server.start else Capricorn::Server.daemonize end end |
#stop ⇒ Object
35 36 37 |
# File 'lib/capricorn/apps/server.rb', line 35 def stop Capricorn.client([:token]).stop_server end |