guard-spork 1.2.1 → 1.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/lib/guard/spork.rb CHANGED
@@ -3,6 +3,7 @@ require 'guard/guard'
3
3
  require 'sys/proctable'
4
4
  require 'childprocess'
5
5
  require 'rinda/ring'
6
+ require 'guard/spork/rinda_ring_finger_patch'
6
7
 
7
8
  module Guard
8
9
  class Spork < Guard
@@ -0,0 +1,26 @@
1
+ # Patch for Rinda::RingFinger.primary hanging forever on Ruby 1.9.2 & 1.9.3
2
+ # from http://www.ruby-forum.com/topic/4229908
3
+ require 'rinda/ring'
4
+
5
+ module Rinda
6
+ class RingFinger
7
+ def lookup_ring_any(timeout=5)
8
+ queue = Queue.new
9
+
10
+ Thread.new do
11
+ self.lookup_ring(timeout) do |ts|
12
+ queue.push(ts)
13
+ end
14
+ queue.push(nil)
15
+ end
16
+
17
+ @primary = queue.pop
18
+ raise('RingNotFound') if @primary.nil?
19
+ while it = queue.pop
20
+ @rings.push(it)
21
+ end
22
+
23
+ @primary
24
+ end
25
+ end
26
+ end
@@ -117,7 +117,7 @@ module Guard
117
117
  Rinda::RingFinger.class_variable_set :@@finger, nil
118
118
  ts = Rinda::RingFinger.primary
119
119
  ts.read_all([:name, :MagazineSlave, nil, nil]).size > 0
120
- rescue DRb::DRbConnError
120
+ rescue
121
121
  false
122
122
  end
123
123
 
@@ -1,5 +1,5 @@
1
1
  module Guard
2
2
  module SporkVersion
3
- VERSION = "1.2.1"
3
+ VERSION = "1.2.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: guard-spork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2012-10-28 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: guard
@@ -130,6 +130,7 @@ executables: []
130
130
  extensions: []
131
131
  extra_rdoc_files: []
132
132
  files:
133
+ - lib/guard/spork/rinda_ring_finger_patch.rb
133
134
  - lib/guard/spork/runner.rb
134
135
  - lib/guard/spork/spork_instance.rb
135
136
  - lib/guard/spork/templates/Guardfile