safe_timeout 0.0.1 → 0.0.3

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: 784f00b2fc676fe36b98359e8eebdf9177f2e9dd
4
- data.tar.gz: 7ffbf4ed29ad028e4b29b79d24bb9d9feb8970e2
3
+ metadata.gz: 2a1dc91fe9838d18748dfa219507d52abfbbc072
4
+ data.tar.gz: 2415cf891a23e2cb38a608c489ab7fa9e18be384
5
5
  SHA512:
6
- metadata.gz: 13b8a264e3449535013dda188788fe3828d76426e342a9742623fec65f4f7bfc39dd62b2611199f3b9203417e45b16a00968f97706d53cf79c5362efd560c8a8
7
- data.tar.gz: d0789e190f7ebcff48514fbae29670f8b73f87e74803d5e28508cb8e5cdcc88f938ad5327d362b45cec4ab754c461b973dff47e22892c7b0d6cd0fbbac357323
6
+ metadata.gz: 00e4442f99e7143a0fbef4caf51c6f023578b13def7d0c058c393577c049e4aca26cf4874c8311e3869f9390b2d6b7650dbfd7533e8dab0144b2e1645b337966
7
+ data.tar.gz: 007b456918328c1b87edf436538af4bf1cb62fec547b5dd00751409aee6aaba24555523f01ab12ba118e02afb7046b8ed29d1b817f776be1254e07c865b5f326
@@ -8,10 +8,13 @@ module SafeTimeout
8
8
 
9
9
  def start(&block)
10
10
  Signal.trap("TRAP", &@on_timeout)
11
- Kernel.fork { wait_for_expiration }
11
+ @child_pid = Kernel.fork { wait_for_expiration }
12
12
  yield
13
13
  ensure
14
- stop rescue nil
14
+ begin
15
+ stop
16
+ rescue Errno::ESRCH
17
+ end
15
18
  end
16
19
 
17
20
  def stop
@@ -1,3 +1,3 @@
1
1
  module SafeTimeout
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: safe_timeout
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - David McCullars
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-12 00:00:00.000000000 Z
11
+ date: 2015-09-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler