capistrano-unicorn-methods 0.0.5 → 0.0.6

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/.gitignore CHANGED
@@ -3,3 +3,4 @@
3
3
  Gemfile.lock
4
4
  pkg/*
5
5
  .rvmrc
6
+ .DS_Store
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v. 0.0.6: Loading issues
2
+
3
+ You should now require the gem, and then load the methods into capistrano with `::CapistranoUnicornMethods.load`.
4
+
1
5
  ## v 0.0.5: Writable pid dir
2
6
 
3
7
  Ensures that everybody can write to the pid dir
@@ -1,47 +1,52 @@
1
1
  require "capistrano-unicorn-methods/version"
2
- Capistrano::Configuration.instance.load do
3
- namespace :unicorn do
4
2
 
5
- # Lazy setting these variables, as they (might) depend on other settings
6
- set(:unicorn_pid) { "#{current_path}/tmp/pids/unicorn.pid" }
7
- set(:unicorn_old_pid) { "#{current_path}/tmp/pids/unicorn.pid.oldbin" }
8
- set(:unicorn_config) { "#{current_path}/config/unicorn.rb" }
9
- set(:unicorn_port) { 3000 }
10
- set(:use_bundler) { true }
11
- set(:rails_env) { "production" }
3
+ module CapistranoUnicornMethods
4
+ def self.load
5
+ Capistrano::Configuration.instance(true).load do
6
+ namespace :unicorn do
12
7
 
13
- desc "Zero-downtime restart of Unicorn"
14
- task :restart do
15
- unicorn.cleanup
16
- run "touch #{unicorn_pid}"
17
- pid = capture("cat #{unicorn_pid}").to_i
18
- run "kill -s USR2 #{pid}" if pid > 0
19
- end
8
+ # Lazy setting these variables, as they (might) depend on other settings
9
+ set(:unicorn_pid) { "#{current_path}/tmp/pids/unicorn.pid" }
10
+ set(:unicorn_old_pid) { "#{current_path}/tmp/pids/unicorn.pid.oldbin" }
11
+ set(:unicorn_config) { "#{current_path}/config/unicorn.rb" }
12
+ set(:unicorn_port) { 3000 }
13
+ set(:use_bundler) { true }
14
+ set(:rails_env) { "production" }
20
15
 
21
- desc "Starts unicorn"
22
- task :start do
23
- unicorn.cleanup
24
- run "cd #{current_path} ; #{'bundle exec' if use_bundler} unicorn_rails -c #{unicorn_config} -D -p #{unicorn_port} -E #{rails_env}"
25
- end
16
+ desc "Zero-downtime restart of Unicorn"
17
+ task :restart do
18
+ unicorn.cleanup
19
+ run "touch #{unicorn_pid}"
20
+ pid = capture("cat #{unicorn_pid}").to_i
21
+ run "kill -s USR2 #{pid}" if pid > 0
22
+ end
26
23
 
27
- desc "Stop unicorn"
28
- task :stop do
29
- run "touch #{unicorn_pid}"
30
- pid = capture("cat #{unicorn_pid}").to_i
31
- run "kill -s QUIT #{pid}" if pid > 0
32
- end
24
+ desc "Starts unicorn"
25
+ task :start do
26
+ unicorn.cleanup
27
+ run "cd #{current_path} ; #{'bundle exec' if use_bundler} unicorn_rails -c #{unicorn_config} -D -p #{unicorn_port} -E #{rails_env}"
28
+ end
33
29
 
34
- desc "Cleans up the old unicorn processes"
35
- task :cleanup do
36
- run "touch #{unicorn_old_pid}"
37
- pid = capture("cat #{unicorn_old_pid}").to_i
38
- run "kill -s QUIT #{pid}" if pid > 0
39
- ensure_writable_dirs
40
- end
30
+ desc "Stop unicorn"
31
+ task :stop do
32
+ run "touch #{unicorn_pid}"
33
+ pid = capture("cat #{unicorn_pid}").to_i
34
+ run "kill -s QUIT #{pid}" if pid > 0
35
+ end
36
+
37
+ desc "Cleans up the old unicorn processes"
38
+ task :cleanup do
39
+ run "touch #{unicorn_old_pid}"
40
+ pid = capture("cat #{unicorn_old_pid}").to_i
41
+ run "kill -s QUIT #{pid}" if pid > 0
42
+ ensure_writable_dirs
43
+ end
41
44
 
42
- task :ensure_writable_dirs do
43
- dir = File.dirname(unicorn_pid)
44
- run "chmod a+w #{dir}"
45
+ task :ensure_writable_dirs do
46
+ dir = File.dirname(unicorn_pid)
47
+ run "chmod a+w #{dir}"
48
+ end
49
+ end
45
50
  end
46
51
  end
47
52
  end
@@ -1,7 +1,7 @@
1
1
  module Capistrano
2
2
  module Unicorn
3
3
  module Methods
4
- VERSION = "0.0.5"
4
+ VERSION = "0.0.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-unicorn-methods
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-01-24 00:00:00.000000000 Z
12
+ date: 2012-01-25 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rake
16
- requirement: &70093896260040 !ruby/object:Gem::Requirement
16
+ requirement: &70173126662600 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70093896260040
24
+ version_requirements: *70173126662600
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rspec
27
- requirement: &70093896257600 !ruby/object:Gem::Requirement
27
+ requirement: &70173126660160 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70093896257600
35
+ version_requirements: *70173126660160
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rspec-rails
38
- requirement: &70093896257000 !ruby/object:Gem::Requirement
38
+ requirement: &70173126659560 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70093896257000
46
+ version_requirements: *70173126659560
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: unicorn
49
- requirement: &70093896256220 !ruby/object:Gem::Requirement
49
+ requirement: &70173126658780 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *70093896256220
57
+ version_requirements: *70173126658780
58
58
  description: Contains a unicorn namespace with methods for starting stopping and maintaining
59
59
  the unicorn server to serve the rails app.
60
60
  email: