guard-rails 0.4.6 → 0.4.7
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.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/guard/rails.rb +1 -1
- data/lib/guard/rails/runner.rb +15 -9
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9b55d8368b1a3d146c369b5f90d86c29aed33b8d
|
4
|
+
data.tar.gz: 7237ddaa55dd8240ff9806723678679671373f64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: da6962b23d74fee50629fb72a65e3e0d2108084d55dc00a51a61eb3a81cc666474c2078ea476fdba16c8083a0bacf79b1d4f274ec5c1ab362d9e553b3ad98e10
|
7
|
+
data.tar.gz: 51d15fc8c4060bb00addc22d54959002d70707afbe2f871d74d42b8c1b3d209399a4e39ed2704eb91b9e10c64c03e295b0249edd4ec8002124aaa95d2c71d640
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.7
|
data/lib/guard/rails.rb
CHANGED
@@ -33,7 +33,7 @@ module Guard
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def start
|
36
|
-
UI.info "[Guard::Rails] will
|
36
|
+
UI.info "[Guard::Rails] will start #{options[:server] || "the default web server"} on port #{options[:port]} in #{options[:environment]}."
|
37
37
|
reload("start") if options[:start_on_start]
|
38
38
|
end
|
39
39
|
|
data/lib/guard/rails/runner.rb
CHANGED
@@ -18,14 +18,14 @@ module Guard
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def stop
|
21
|
-
if
|
21
|
+
if has_pid?
|
22
22
|
pid = File.read(pid_file).strip.to_i
|
23
23
|
sig_sent = kill_process("INT", pid)
|
24
24
|
wait_for_no_pid if sig_sent
|
25
25
|
|
26
26
|
# If you lost your pid_file, you are already died.
|
27
27
|
kill_process("KILL", pid)
|
28
|
-
|
28
|
+
remove_pid_file_and_wait_for_no_pid
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
@@ -56,7 +56,7 @@ module Guard
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def pid
|
59
|
-
|
59
|
+
has_pid? ? File.read(pid_file).to_i : nil
|
60
60
|
end
|
61
61
|
|
62
62
|
def sleep_time
|
@@ -110,8 +110,7 @@ module Guard
|
|
110
110
|
def kill_unmanaged_pid!
|
111
111
|
if pid = unmanaged_pid
|
112
112
|
kill_process("KILL", pid)
|
113
|
-
|
114
|
-
wait_for_no_pid
|
113
|
+
remove_pid_file_and_wait_for_no_pid
|
115
114
|
end
|
116
115
|
end
|
117
116
|
|
@@ -128,16 +127,23 @@ module Guard
|
|
128
127
|
private
|
129
128
|
|
130
129
|
def wait_for_pid
|
131
|
-
wait_for_pid_loop
|
130
|
+
wait_for_pid_loop { has_pid? }
|
132
131
|
end
|
133
132
|
|
134
133
|
def wait_for_no_pid
|
135
|
-
wait_for_pid_loop
|
134
|
+
wait_for_pid_loop { !has_pid? }
|
135
|
+
end
|
136
|
+
|
137
|
+
def remove_pid_file_and_wait_for_no_pid
|
138
|
+
wait_for_pid_loop do
|
139
|
+
FileUtils.rm pid_file, :force => true
|
140
|
+
!has_pid?
|
141
|
+
end
|
136
142
|
end
|
137
143
|
|
138
|
-
def wait_for_pid_loop
|
144
|
+
def wait_for_pid_loop
|
139
145
|
count = 0
|
140
|
-
while !
|
146
|
+
while !yield && count < MAX_WAIT_COUNT
|
141
147
|
wait_for_pid_action
|
142
148
|
count += 1
|
143
149
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: guard-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Bintz
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: guard
|