guard-unicorn 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,10 +1,9 @@
1
1
  # -*- encoding: utf-8 -*-
2
2
  $:.push File.expand_path("../lib", __FILE__)
3
- require "guard/unicorn/version"
4
3
 
5
4
  Gem::Specification.new do |s|
6
5
  s.name = "guard-unicorn"
7
- s.version = Guard::UnicornVersion::VERSION
6
+ s.version = "0.0.5"
8
7
  s.authors = ["Andrei Maxim"]
9
8
  s.email = ["andrei@andreimaxim.ro"]
10
9
  s.homepage = "https://github.com/xhr/guard-unicorn"
data/lib/guard/unicorn.rb CHANGED
@@ -1,8 +1,6 @@
1
1
  require 'guard'
2
2
  require 'guard/guard'
3
3
 
4
- require 'guard/unicorn/version'
5
-
6
4
  module Guard
7
5
  class Unicorn < Guard
8
6
 
@@ -23,6 +21,7 @@ module Guard
23
21
  @enable_bundler = options.fetch(:bundler, true)
24
22
  @pid_file = options.fetch(:pid_file, DEFAULT_PID_PATH)
25
23
  @config_file = options.fetch(:config_file, DEFAULT_CONFIG_PATH)
24
+ @preloading = options.fetch(:preloading, false)
26
25
 
27
26
  super
28
27
  end
@@ -68,7 +67,15 @@ module Guard
68
67
  # This method should be mainly used for "reload" (really!) actions like reloading passenger/spork/bundler/...
69
68
  # @raise [:task_has_failed] when reload has failed
70
69
  def reload
71
- Process.kill "HUP", pid
70
+ # If the `preload_app` directive is false, then the workers will pick up
71
+ # any code changes using a `HUP` signal, but if the application is
72
+ # preloaded, then a `USR2 + QUIT` signal must be used.
73
+ #
74
+ # For now, let's rely on the fact that the user does know how to write
75
+ # a good unicorn configuration and he will have a block of code that
76
+ # will properly handle `USR2` signals.
77
+ signal = @preloading ? "USR2" : "HUP"
78
+ Process.kill signal, pid
72
79
 
73
80
  success "Unicorn reloaded"
74
81
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-unicorn
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
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-03-09 00:00:00.000000000 Z
12
+ date: 2012-04-26 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
16
- requirement: &70274208930740 !ruby/object:Gem::Requirement
16
+ requirement: &70286071860660 !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: :runtime
23
23
  prerelease: false
24
- version_requirements: *70274208930740
24
+ version_requirements: *70286071860660
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rake
27
- requirement: &70274208930260 !ruby/object:Gem::Requirement
27
+ requirement: &70286071859860 !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: *70274208930260
35
+ version_requirements: *70286071859860
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
38
- requirement: &70274208929700 !ruby/object:Gem::Requirement
38
+ requirement: &70286071859000 !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: *70274208929700
46
+ version_requirements: *70286071859000
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: minitest
49
- requirement: &70274208929180 !ruby/object:Gem::Requirement
49
+ requirement: &70286071857860 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70274208929180
57
+ version_requirements: *70286071857860
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: guard
60
- requirement: &70274208928640 !ruby/object:Gem::Requirement
60
+ requirement: &70286071856960 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,7 +65,7 @@ dependencies:
65
65
  version: '0'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70274208928640
68
+ version_requirements: *70286071856960
69
69
  description: Guard plug-in that allows you to restart Unicorn
70
70
  email:
71
71
  - andrei@andreimaxim.ro
@@ -81,7 +81,6 @@ files:
81
81
  - guard-unicorn.gemspec
82
82
  - lib/guard/unicorn.rb
83
83
  - lib/guard/unicorn/templates/Guardfile
84
- - lib/guard/unicorn/version.rb
85
84
  - test/test_helper.rb
86
85
  homepage: https://github.com/xhr/guard-unicorn
87
86
  licenses: []
@@ -95,15 +94,21 @@ required_ruby_version: !ruby/object:Gem::Requirement
95
94
  - - ! '>='
96
95
  - !ruby/object:Gem::Version
97
96
  version: '0'
97
+ segments:
98
+ - 0
99
+ hash: 3501195389242757760
98
100
  required_rubygems_version: !ruby/object:Gem::Requirement
99
101
  none: false
100
102
  requirements:
101
103
  - - ! '>='
102
104
  - !ruby/object:Gem::Version
103
105
  version: '0'
106
+ segments:
107
+ - 0
108
+ hash: 3501195389242757760
104
109
  requirements: []
105
110
  rubyforge_project: guard-unicorn
106
- rubygems_version: 1.8.17
111
+ rubygems_version: 1.8.11
107
112
  signing_key:
108
113
  specification_version: 3
109
114
  summary: Guard for Unicorn
@@ -1,5 +0,0 @@
1
- module Guard
2
- module UnicornVersion
3
- VERSION = "0.0.4"
4
- end
5
- end