Class: FluentdUI::Command

Inherits:
Thor
  • Object
show all
Defined in:
lib/fluentd-ui/command.rb

Constant Summary collapse

ROOT =
File.expand_path('../../../', __FILE__)

Instance Method Summary collapse

Instance Method Details

#setupObject



42
43
44
# File 'lib/fluentd-ui/command.rb', line 42

def setup
  system(*%W(bundle install))
end

#startObject



10
11
12
# File 'lib/fluentd-ui/command.rb', line 10

def start
  system(*%W(bundle exec rackup #{options[:daemonize] ? "-D" : ""} --pid #{options[:pidfile]} -p #{options[:port]} -E production #{ROOT}/config.ru))
end

#statusObject



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

#stopObject



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