attempt 0.2.1 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGES +6 -0
- data/README +4 -1
- data/attempt.gemspec +2 -2
- data/certs/djberg96_pub.pem +15 -15
- data/lib/attempt.rb +10 -10
- data/test/test_attempt.rb +1 -1
- metadata +22 -22
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5dd75bdd6f69b8859f13e74beeeb881457369934
|
4
|
+
data.tar.gz: 3796124b03b73321a74c88e1042f7608caed95ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fa3275bbd299112fa5c9b56d19528ea7ecd4bcafae071a267c04b682b45f9c0c6d74c4e2da171c02bca45e48346b97110e413028f69a2d45d174c67625206604
|
7
|
+
data.tar.gz: a8fbd29c2b48d14c112d20d1d9fd87fac16251dc715ff65bac1cb687fdd26f470f575fb01286ffe728c3850b76a71cd736b05c8031051c844519edba3a1b64dc
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/CHANGES
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
== 0.3.0 - 27-Mar-2017
|
2
|
+
* The structured_warnings gem requirement was updated to 0.3.0 or later. This
|
3
|
+
is necessary if you are using Ruby 2.4 or later.
|
4
|
+
* The VERSION string is now frozen.
|
5
|
+
* Updated the certs file.
|
6
|
+
|
1
7
|
== 0.2.1 - 13-Dec-2015
|
2
8
|
* This gem is now signed.
|
3
9
|
* Updates to the Rakefile and gemspec.
|
data/README
CHANGED
@@ -39,6 +39,9 @@
|
|
39
39
|
Also, this library uses the timeout library internally, which has some
|
40
40
|
known issues. See Future Plans, below.
|
41
41
|
|
42
|
+
As of version 0.3.0, this library requires structured_warnings 0.3.0 or
|
43
|
+
later. This is necessary because of changes in Ruby 2.4.
|
44
|
+
|
42
45
|
== Future Plans
|
43
46
|
Add the ability to set an absolute maximum number of seconds to prevent
|
44
47
|
nested sleep/retry from delaying attempts longer than expected.
|
@@ -57,7 +60,7 @@
|
|
57
60
|
Artistic 2.0
|
58
61
|
|
59
62
|
== Copyright
|
60
|
-
(C) 2006-
|
63
|
+
(C) 2006-2017, Daniel J. Berger
|
61
64
|
All Rights Reserved
|
62
65
|
|
63
66
|
== Author
|
data/attempt.gemspec
CHANGED
@@ -2,7 +2,7 @@ require 'rubygems'
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = 'attempt'
|
5
|
-
spec.version = '0.
|
5
|
+
spec.version = '0.3.0'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
7
|
spec.license = 'Artistic 2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
|
|
14
14
|
|
15
15
|
spec.extra_rdoc_files = ['README','CHANGES','MANIFEST']
|
16
16
|
|
17
|
-
spec.add_dependency('structured_warnings')
|
17
|
+
spec.add_dependency('structured_warnings', '~> 0.3.0')
|
18
18
|
spec.add_development_dependency('test-unit')
|
19
19
|
|
20
20
|
spec.description = <<-EOF
|
data/certs/djberg96_pub.pem
CHANGED
@@ -1,21 +1,21 @@
|
|
1
1
|
-----BEGIN CERTIFICATE-----
|
2
2
|
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
|
3
3
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
4
|
-
|
4
|
+
MB4XDTE2MDkxOTAzNDY0NVoXDTE3MDkxOTAzNDY0NVowPzERMA8GA1UEAwwIZGpi
|
5
5
|
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnb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KysxCFuzoIPIYMdYswquvmtuTA+lpB9btWHr8n2FFsDp
|
19
|
+
A943I/wqE6xbYQpHxkndWo5uLDUbZh+XxG+fhZKpeqLIqHaFuU6wdO5odt32kB/B
|
20
|
+
nCjVswaVYlu1U2iLPCqE+MrjmTA=
|
21
21
|
-----END CERTIFICATE-----
|
data/lib/attempt.rb
CHANGED
@@ -6,20 +6,20 @@ require 'structured_warnings'
|
|
6
6
|
class Attempt
|
7
7
|
|
8
8
|
# The version of the attempt library.
|
9
|
-
VERSION = '0.
|
9
|
+
VERSION = '0.3.0'.freeze
|
10
10
|
|
11
11
|
# Warning raised if an attempt fails before the maximum number of tries
|
12
12
|
# has been reached.
|
13
|
-
class Warning < StandardWarning; end
|
13
|
+
class Warning < StructuredWarnings::StandardWarning; end
|
14
14
|
|
15
|
-
# Number of attempts to make before failing.
|
15
|
+
# Number of attempts to make before failing. The default is 3.
|
16
16
|
attr_accessor :tries
|
17
17
|
|
18
|
-
# Number of seconds to wait between attempts.
|
18
|
+
# Number of seconds to wait between attempts. The default is 60.
|
19
19
|
attr_accessor :interval
|
20
20
|
|
21
21
|
# A boolean value that determines whether errors that would have been
|
22
|
-
# raised should be sent to STDERR as warnings.
|
22
|
+
# raised should be sent to STDERR as warnings. The default is true.
|
23
23
|
attr_accessor :warnings
|
24
24
|
|
25
25
|
# If you provide an IO handle to this option then errors that would
|
@@ -50,10 +50,10 @@ class Attempt
|
|
50
50
|
@increment = nil # Should be an int, if provided
|
51
51
|
@timeout = nil # Wrap the code in a timeout block if provided
|
52
52
|
@level = Exception # Level of exception to be caught
|
53
|
-
@warnings = true # Errors sent to STDERR as warnings if true
|
53
|
+
@warnings = true # Errors are sent to STDERR as warnings if true
|
54
54
|
|
55
55
|
yield self if block_given?
|
56
|
-
|
56
|
+
end
|
57
57
|
|
58
58
|
# Attempt to perform the operation in the provided block up to +tries+
|
59
59
|
# times, sleeping +interval+ between each try.
|
@@ -112,9 +112,9 @@ module Kernel
|
|
112
112
|
def attempt(tries = 3, interval = 60, timeout = nil, &block)
|
113
113
|
raise 'no block given' unless block_given?
|
114
114
|
Attempt.new{ |a|
|
115
|
-
|
116
|
-
|
117
|
-
|
115
|
+
a.tries = tries
|
116
|
+
a.interval = interval
|
117
|
+
a.timeout = timeout if timeout
|
118
118
|
}.attempt(&block)
|
119
119
|
end
|
120
120
|
end
|
data/test/test_attempt.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: attempt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -12,40 +12,40 @@ cert_chain:
|
|
12
12
|
-----BEGIN CERTIFICATE-----
|
13
13
|
MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MREwDwYDVQQDDAhkamJl
|
14
14
|
cmc5NjEVMBMGCgmSJomT8ixkARkWBWdtYWlsMRMwEQYKCZImiZPyLGQBGRYDY29t
|
15
|
-
|
15
|
+
MB4XDTE2MDkxOTAzNDY0NVoXDTE3MDkxOTAzNDY0NVowPzERMA8GA1UEAwwIZGpi
|
16
16
|
ZXJnOTYxFTATBgoJkiaJk/IsZAEZFgVnbWFpbDETMBEGCgmSJomT8ixkARkWA2Nv
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
17
|
+
bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAM0eOHOQRpLOeqkyeK7O
|
18
|
+
DGHYLkO0Wq7gStVVVyHXahgyCopLN6JVBwGy5aCpKFcy5sFz2DdnISj+hQ7FctDa
|
19
|
+
yz6Lq9TvAF8Jkis8dDFLQKeHilB/AM4ssQAsGQyoQnoE4v5tCOSW4e3YHFDp/dMZ
|
20
|
+
s7Hkoim6PeEdkh4hB5LCa90OrHSPe8nlMFsVhRIGj86xNTRazEiWPZCOKmN9rZgW
|
21
|
+
ziheP/6hC2c7vNRevv5iE/K+NqaL/WOdMquOSZoF2mdBcoMIPDDBNzh/oHinPQ3N
|
22
|
+
1oOvoET0+Tj+O5tXX/L1TAsUrwZXlyrYGaZ5aYyoo/7r9pmvmbfgBqaU6JywT0EE
|
23
|
+
5x0CAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFO+k
|
24
|
+
C/3R+t2aIyIpwU5wPrAfYVL6MB0GA1UdEQQWMBSBEmRqYmVyZzk2QGdtYWlsLmNv
|
25
25
|
bTAdBgNVHRIEFjAUgRJkamJlcmc5NkBnbWFpbC5jb20wDQYJKoZIhvcNAQEFBQAD
|
26
|
-
|
27
|
-
|
28
|
-
/
|
29
|
-
|
30
|
-
|
31
|
-
|
26
|
+
ggEBAIJWpqQOUMoYhpm0wJ4kfiYv9rZVbpZ3L2cFYt4O6+wgbpdWP8DBBgZfCSQW
|
27
|
+
1J9miChMKdxZ8eOoeId79IMXN3IAcnalTFvD0Rp9ltaFZTXBfXMFqxQN3fHsIVwz
|
28
|
+
as/JSbwXo/PE8rULhjU+Utwcmji38cKEDWLAW4vsCBmwvBTwmAmcuHHKjnNvd8aR
|
29
|
+
YMrq9v505w8IjSysIO3KKysxCFuzoIPIYMdYswquvmtuTA+lpB9btWHr8n2FFsDp
|
30
|
+
A943I/wqE6xbYQpHxkndWo5uLDUbZh+XxG+fhZKpeqLIqHaFuU6wdO5odt32kB/B
|
31
|
+
nCjVswaVYlu1U2iLPCqE+MrjmTA=
|
32
32
|
-----END CERTIFICATE-----
|
33
|
-
date:
|
33
|
+
date: 2017-03-27 00:00:00.000000000 Z
|
34
34
|
dependencies:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: structured_warnings
|
37
37
|
requirement: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- - "
|
39
|
+
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 0.3.0
|
42
42
|
type: :runtime
|
43
43
|
prerelease: false
|
44
44
|
version_requirements: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- - "
|
46
|
+
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 0.3.0
|
49
49
|
- !ruby/object:Gem::Dependency
|
50
50
|
name: test-unit
|
51
51
|
requirement: !ruby/object:Gem::Requirement
|
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
105
105
|
version: '0'
|
106
106
|
requirements: []
|
107
107
|
rubyforge_project:
|
108
|
-
rubygems_version: 2.
|
108
|
+
rubygems_version: 2.6.11
|
109
109
|
signing_key:
|
110
110
|
specification_version: 4
|
111
111
|
summary: A thin wrapper for begin + rescue + sleep + retry
|
metadata.gz.sig
CHANGED
Binary file
|