procman 1.5.1 → 1.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/proc_man.rb +1 -1
- data/lib/proc_man/capistrano.rb +3 -3
- data/lib/proc_man/process.rb +18 -0
- metadata +3 -2
data/lib/proc_man.rb
CHANGED
data/lib/proc_man/capistrano.rb
CHANGED
@@ -3,15 +3,15 @@
|
|
3
3
|
|
4
4
|
Capistrano::Configuration.instance(:must_exist).load do
|
5
5
|
namespace :procman do
|
6
|
-
task :start, :roles => :app do
|
6
|
+
task :start, :roles => fetch(:procman_roles, [:app]) do
|
7
7
|
run procman_command(:start)
|
8
8
|
end
|
9
9
|
|
10
|
-
task :stop, :roles => :app do
|
10
|
+
task :stop, :roles => fetch(:procman_roles, [:app]) do
|
11
11
|
run procman_command(:stop)
|
12
12
|
end
|
13
13
|
|
14
|
-
task :restart, :roles => :app do
|
14
|
+
task :restart, :roles => fetch(:procman_roles, [:app]) do
|
15
15
|
run procman_command(:restart)
|
16
16
|
end
|
17
17
|
|
data/lib/proc_man/process.rb
CHANGED
@@ -71,5 +71,23 @@ module ProcMan
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
+
# A shortcut method for defining a set of RBG processes
|
75
|
+
def rbg(options = {})
|
76
|
+
options[:config_file] ||= "ProcessFile"
|
77
|
+
options[:environment] ||= "production"
|
78
|
+
start { system("bundle exec rbg start -c #{options[:config_file]} -E #{options[:environment]}") }
|
79
|
+
stop { system("bundle exec rbg stop -c #{options[:config_file]} -E #{options[:environment]}") }
|
80
|
+
restart { system("bundle exec rbg restart -c #{options[:config_file]} -E #{options[:environment]}") }
|
81
|
+
end
|
82
|
+
|
83
|
+
# A shortcut method for defining a unicorn
|
84
|
+
def unicorn(options = {})
|
85
|
+
options[:config_file] ||= "config/unicorn.rb"
|
86
|
+
options[:pid_path] ||= "log/unicorn.pid"
|
87
|
+
start { system("bundle exec unicorn -D -c #{options[:config_file]}") }
|
88
|
+
stop { system("kill `cat #{options[:pid_path]}`") if File.exist?(options[:pid_path]) }
|
89
|
+
restart { system("kill -USR2 `cat #{options[:pid_path]}`") if File.exist?(options[:pid_path]) }
|
90
|
+
end
|
91
|
+
|
74
92
|
end
|
75
93
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: procman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.6.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2014-02-10 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: A very very simple library for starting/stopping/restarting processes
|
15
15
|
for a Ruby application
|
@@ -55,3 +55,4 @@ specification_version: 3
|
|
55
55
|
summary: A very very simple library for starting/stopping/restarting processes for
|
56
56
|
a Ruby application
|
57
57
|
test_files: []
|
58
|
+
has_rdoc: false
|