attempt_to 0.4 → 0.4.1
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/lib/attempt_to/attempt_to.rb +2 -1
- data/lib/attempt_to/version.rb +1 -1
- data/spec/attempt_to_spec.rb +4 -0
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0b9f1808d7b047596ab94f63627d656a739dcc30
|
4
|
+
data.tar.gz: 18341f2615619c48603cc72cf76bd752213aed10
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ec78a27174da0f5a37ffedec3f8aa187842e062b699b76aec0a643e7abecdc3bde7459d57589adb777223ebfc85796c4d31761a974367df3c57afd0791c1bd5
|
7
|
+
data.tar.gz: 20e808ba0cfe5b918e708cab898eadf803eb06a1d641e72a3c014fec9c81fdc851b110f8c15775df86514b33c9c1b286a2c1a089df1b2a80601945123fe09bf0
|
data/lib/attempt_to/version.rb
CHANGED
data/spec/attempt_to_spec.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
|
2
2
|
require 'attempt_to'
|
3
3
|
require 'socket'
|
4
|
+
require 'timeout'
|
4
5
|
|
5
6
|
describe "Attempt to do something a couple of times, if it fails, bail out." do
|
6
7
|
|
@@ -63,4 +64,7 @@ describe "Attempt to do something a couple of times, if it fails, bail out." do
|
|
63
64
|
expect { attempt_to_with_timeout(0.3) { false } }.to raise_error(Timeout::Error, "execution expired")
|
64
65
|
end
|
65
66
|
|
67
|
+
it "will return a Timeout when the condition never happens as it takes too long" do
|
68
|
+
expect { attempt_to_with_timeout(0.3) { sleep(2) } }.to raise_error(Timeout::Error, "execution expired")
|
69
|
+
end
|
66
70
|
end
|
metadata
CHANGED
@@ -1,41 +1,41 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attempt_to
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bas Vodde
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-07-
|
11
|
+
date: 2014-07-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - '>='
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - '>='
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rspec
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - '>='
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 2.0.0
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - '>='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 2.0.0
|
41
41
|
description: AttemptTo calls a code block and re-tries it if it throws an exception.
|
@@ -62,12 +62,12 @@ require_paths:
|
|
62
62
|
- lib
|
63
63
|
required_ruby_version: !ruby/object:Gem::Requirement
|
64
64
|
requirements:
|
65
|
-
- -
|
65
|
+
- - '>='
|
66
66
|
- !ruby/object:Gem::Version
|
67
67
|
version: '0'
|
68
68
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
69
69
|
requirements:
|
70
|
-
- -
|
70
|
+
- - '>='
|
71
71
|
- !ruby/object:Gem::Version
|
72
72
|
version: '0'
|
73
73
|
requirements: []
|