Class: ProcessBot::Capistrano::Puma
- Inherits:
-
Capistrano::Plugin
- Object
- Capistrano::Plugin
- ProcessBot::Capistrano::Puma
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_tasks ⇒ Object
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
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_puma ⇒ Object
18
19
20
|
# File 'lib/process_bot/capistrano/puma.rb', line 18
def stop_puma
run_puma_command("stop")
end
|