guard-rails 0.4.4 → 0.4.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 247ef8037daba00fafc81c1b6de3e9b247be6c9e
4
- data.tar.gz: 225ef5091fbc35e9747db31f79c8f168dc9a3d37
3
+ metadata.gz: 83779b3970067b635fd096eec98a5ff0c9614352
4
+ data.tar.gz: 39ef4bb2fbef9290ad1da8422527d88f106c9b55
5
5
  SHA512:
6
- metadata.gz: 99a0d2e6660d9d7beeff5863110f99126325ef6bc9d7f8c9e78bbe84b81ed43505a357d08b12c1eb21f9eae3513d7f09983784db649fd23ea61aaf4693340d3c
7
- data.tar.gz: ba7c3110203d8c87e9751c16c3e6e9cfaa9b3714ca9263598fd10264b81a4b31bb6f1fa533f3cee29cc0484b3c944c8702ef50bf7ef8700ce0b67d72b963e5f8
6
+ metadata.gz: 3a79fc3e85b8219dbb7d6ff8cd274dcf3cebd7da1f4cf3eaddbd2e71b8bebe5a267e32d3bd9d2c3f62b99899e0ff85fe3b20757a265f1f200b7e18515ff592aa
7
+ data.tar.gz: 131b2580e8a82b5a4598da3216fa7c5c6f66b360b3eb1c3f6c6e2e940b81634cc5e0d765ff928361715b220ec83c1eba3cfd294e910369be129fd38939ae9fa7
data/README.md CHANGED
@@ -52,7 +52,7 @@ Now I can automatically restart your Rails development server as your files chan
52
52
  ## Philosophy
53
53
 
54
54
  * **All Platforms** MRI is the main test case. But will be tested under REE and JRuby.
55
- * **Live in edge** I am tested under Ruby 1.8.7, 1.9.3, 2.0.0 with newest gems. Will be rewrited to fit Ruby 2.0.0 when I am released as version 1.0.0.
55
+ * **Live in edge** Ruby 1.8.7 has been deprecated. Guard-Rails will be tested under Ruby 1.9.3, 2.0.0 with newest gems. Will be rewrited with features of Ruby 2.0.0 as version 1.0.0.
56
56
  * [Semantic Version](http://semver.org/)
57
57
 
58
58
  ## Contribute
data/Rakefile CHANGED
@@ -8,13 +8,13 @@ require 'rake/version_task'
8
8
  Rake::VersionTask.new
9
9
 
10
10
  include Rake::DSL if defined?(Rake::DSL)
11
- RVM_PREFIX = "rvm 1.8.7,1.9.3-p327,2.0.0 do"
11
+ RVM_PREFIX = "rvm jruby,1.9.3,2.0.0 do"
12
12
 
13
13
 
14
14
  namespace :spec do
15
15
  desc "Run on three Rubies"
16
16
  task :platforms do
17
- exit $?.exitstatus unless system "#{RVM_PREFIX} bundle install"
17
+ exit $?.exitstatus unless system "#{RVM_PREFIX} bundle install 2>&1 1>/dev/null "
18
18
  exit $?.exitstatus unless system "#{RVM_PREFIX} bundle exec rake spec"
19
19
  end
20
20
  end
@@ -26,10 +26,6 @@ task :publish do
26
26
  system %{git push origin}
27
27
  system %{git push guard}
28
28
  system %{git push gitcafe}
29
- end
30
-
31
- desc 'Push tags'
32
- task :publish_tags do
33
29
  system %{git push origin --tags}
34
30
  system %{git push guard --tags}
35
31
  system %{git push gitcafe --tags}
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.4.4
1
+ 0.4.5
@@ -19,12 +19,12 @@ module Guard
19
19
 
20
20
  def stop
21
21
  if File.file?(pid_file)
22
- pid = File.read(pid_file).strip
23
- system "kill -SIGINT #{pid}"
24
- wait_for_no_pid if $?.exitstatus == 0
22
+ pid = File.read(pid_file).strip.to_i
23
+ sig_sent = kill_process("INT", pid)
24
+ wait_for_no_pid if sig_sent
25
25
 
26
26
  # If you lost your pid_file, you are already died.
27
- system "kill -KILL #{pid} >&2 2>#{::Guard::DEV_NULL}"
27
+ kill_process("KILL", pid)
28
28
  FileUtils.rm pid_file, :force => true
29
29
  end
30
30
  end
@@ -38,7 +38,7 @@ module Guard
38
38
  command = build_cli_command if options[:CLI]
39
39
  command ||= build_zeus_command if options[:zeus]
40
40
  command ||= build_rails_command
41
- "#{environment.collect {|k,v| "#{k}=#{v} "}.join} cd \"#{@root}\" && #{command}"
41
+ "sh -c 'cd \"#{@root}\" && #{command} &'"
42
42
  end
43
43
 
44
44
  def environment
@@ -96,7 +96,7 @@ module Guard
96
96
  end
97
97
 
98
98
  def run_rails_command!
99
- system "sh -c 'cd \"#{@root}\" && #{build_command} &'"
99
+ system(environment, build_command)
100
100
  end
101
101
 
102
102
  def has_pid?
@@ -109,7 +109,7 @@ module Guard
109
109
 
110
110
  def kill_unmanaged_pid!
111
111
  if pid = unmanaged_pid
112
- system "kill -KILL #{pid}"
112
+ kill_process("KILL", pid)
113
113
  FileUtils.rm pid_file
114
114
  wait_for_no_pid
115
115
  end
@@ -143,5 +143,14 @@ module Guard
143
143
  end
144
144
  !(count == MAX_WAIT_COUNT)
145
145
  end
146
+
147
+ def kill_process(signal, pid)
148
+ begin
149
+ Process.kill(signal, pid)
150
+ true
151
+ rescue Errno::EINVAL, Errno::ESRCH, RangeError
152
+ false
153
+ end
154
+ end
146
155
  end
147
156
  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
4
+ version: 0.4.5
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-06-23 00:00:00.000000000 Z
12
+ date: 2013-07-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard