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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d4993998568fc28ef3fb95b21ca6218ee8e3c75a
4
- data.tar.gz: f6ec00aeadf3e7856e7fed9c1f2c31ce7f5ffa32
3
+ metadata.gz: 9b55d8368b1a3d146c369b5f90d86c29aed33b8d
4
+ data.tar.gz: 7237ddaa55dd8240ff9806723678679671373f64
5
5
  SHA512:
6
- metadata.gz: a60ae39c59768bc8c49737257845abe3d0da933a779a831debb193acb11102ee191c33aacc5130baa018ea9395d104bb15facf1e19bda36f56b24c0484f5f6b1
7
- data.tar.gz: cb728ed6d519d0f9bf9cc6cd2135bf62f49c046d1670322428ebd386cfdb83a1b4f0351bec17f386062cd7e70db3fe532b755b11bf24c33a0714681e6e4ce813
6
+ metadata.gz: da6962b23d74fee50629fb72a65e3e0d2108084d55dc00a51a61eb3a81cc666474c2078ea476fdba16c8083a0bacf79b1d4f274ec5c1ab362d9e553b3ad98e10
7
+ data.tar.gz: 51d15fc8c4060bb00addc22d54959002d70707afbe2f871d74d42b8c1b3d209399a4e39ed2704eb91b9e10c64c03e295b0249edd4ec8002124aaa95d2c71d640
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.6
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 restart #{options[:server]} on port #{options[:port]} in #{options[:environment]}."
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
 
@@ -18,14 +18,14 @@ module Guard
18
18
  end
19
19
 
20
20
  def stop
21
- if File.file?(pid_file)
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
- FileUtils.rm pid_file, :force => true
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
- File.file?(pid_file) ? File.read(pid_file).to_i : nil
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
- FileUtils.rm pid_file
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(false)
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(check_for_existince = true)
144
+ def wait_for_pid_loop
139
145
  count = 0
140
- while !(check_for_existince ? has_pid? : !has_pid?) && count < MAX_WAIT_COUNT
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.6
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 00:00:00.000000000 Z
12
+ date: 2013-07-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard