Class: ProcessBot::Capistrano::Puma

Inherits:
Capistrano::Plugin
  • Object
show all
Includes:
Common
Defined in:
lib/process_bot/capistrano/puma.rb

Defined Under Namespace

Modules: Common

Instance Method Summary collapse

Methods included from Common

#compiled_template_puma, #puma_bind, #puma_binds, #puma_switch_user, #puma_user, #template_puma

Instance Method Details

#define_tasksObject



6
7
8
# File 'lib/process_bot/capistrano/puma.rb', line 6

def define_tasks
  eval_rakefile File.expand_path("./puma.rake", __dir__)
end

#puma_running?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/process_bot/capistrano/puma.rb', line 10

def puma_running?
  backend.test("[ -f #{fetch(:puma_pid)} ]") && backend.test(:kill, "-0 $( cat #{fetch(:puma_pid)} )")
end

#run_puma_command(command) ⇒ Object



14
15
16
# File 'lib/process_bot/capistrano/puma.rb', line 14

def run_puma_command(command)
  backend.execute :pumactl, "--control-url 'tcp://127.0.0.1:9293'", "--control-token foobar", "-F #{fetch(:puma_conf)} #{command}"
end

#stop_pumaObject



18
19
20
# File 'lib/process_bot/capistrano/puma.rb', line 18

def stop_puma
  run_puma_command("stop")
end