Class: FluentdUI::Command
- Inherits:
-
Thor
- Object
- Thor
- FluentdUI::Command
- Defined in:
- lib/fluentd-ui/command.rb
Constant Summary collapse
- ROOT =
File.('../../../', __FILE__)
Instance Method Summary collapse
Instance Method Details
#setup ⇒ Object
43 44 45 46 |
# File 'lib/fluentd-ui/command.rb', line 43 def setup trap(:INT) { puts "\nStopping..." } system(*%W(bundle install)) end |
#start ⇒ Object
10 11 12 13 |
# File 'lib/fluentd-ui/command.rb', line 10 def start trap(:INT) { puts "\nStopping..." } system(*%W(bundle exec rackup #{[:daemonize] ? "-D" : ""} --pid #{[:pidfile]} -p #{[:port]} -E production #{ROOT}/config.ru)) end |
#status ⇒ Object
28 29 30 31 32 33 34 35 36 |
# File 'lib/fluentd-ui/command.rb', line 28 def status if pid && Process.kill(0, pid) puts "fluentd-ui is running" else puts "fluentd-ui is stopped" end rescue Errno::ESRCH puts "fluentd-ui is stopped" end |
#stop ⇒ Object
18 19 20 21 22 23 |
# File 'lib/fluentd-ui/command.rb', line 18 def stop Process.kill(:TERM, pid) if pid rescue Errno::ESRCH ensure puts "stopped" end |