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
42 43 44 |
# File 'lib/fluentd-ui/command.rb', line 42 def setup system(*%W(bundle install)) end |
#start ⇒ Object
10 11 12 |
# File 'lib/fluentd-ui/command.rb', line 10 def start system(*%W(bundle exec rackup #{[:daemonize] ? "-D" : ""} --pid #{[:pidfile]} -p #{[:port]} -E production #{ROOT}/config.ru)) end |
#status ⇒ Object
27 28 29 30 31 32 33 34 35 |
# File 'lib/fluentd-ui/command.rb', line 27 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
17 18 19 20 21 22 |
# File 'lib/fluentd-ui/command.rb', line 17 def stop Process.kill(:TERM, pid) if pid rescue Errno::ESRCH ensure puts "stopped" end |