attempt 0.6.0 → 0.6.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
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/{CHANGES → CHANGES.md} +28 -12
- data/{MANIFEST → MANIFEST.md} +3 -3
- data/README.md +84 -0
- data/attempt.gemspec +1 -3
- data/lib/attempt.rb +1 -1
- data/spec/attempt_spec.rb +1 -1
- metadata +6 -9
- metadata.gz.sig +0 -0
- data/README +0 -72
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f4489fdcd16a1e4fd93187cf684afc4eb42b9d1b35987372ce099b0081ab938
|
4
|
+
data.tar.gz: 0d359e069dded75e7e0871c1903f5950275b5f033e22490ea3358c55e8883df0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 61728e4d946893471d103dfa8f2114212bf9438774b6636cff3744186fe0c99f7e48687969abe8627aa48b4cdb0d7203666978ded8bae2b3ba9d4f1e2616d57b
|
7
|
+
data.tar.gz: a34ac935d3fde78fed37884e93f9019c015a106c15f741732fedd2184c298eb1233ab23f967dfb85bfa6eaf1bb873d6e208730c20cf59cf40bbf101122f5c1a5
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/{CHANGES → CHANGES.md}
RENAMED
@@ -1,40 +1,53 @@
|
|
1
|
-
|
1
|
+
## 0.6.1 - 20-Oct-2020
|
2
|
+
* Switched the README, MANIFEST and CHANGES to markdown format.
|
3
|
+
* Fiddling with the .travis.yml file again.
|
4
|
+
|
5
|
+
## 0.6.0 - 17-Sep-2020
|
6
|
+
|
2
7
|
* Switched from test-unit to rspec and rewrote the specs.
|
3
8
|
|
4
|
-
|
9
|
+
## 0.5.1 - 28-Aug-2020
|
10
|
+
|
5
11
|
* Added a Gemfile.
|
6
12
|
* Updated Rakefile to clean .lock files.
|
7
13
|
* Bumped structured_warnings version to 0.4.0 so that it works with Ruby 2.7.
|
8
14
|
Thanks go to Alexey Zapriy for the spot.
|
9
15
|
|
10
|
-
|
16
|
+
## 0.5.0 - 2-Jun-2020
|
17
|
+
|
11
18
|
* Switched to Apache-2.0 license, added LICENSE file.
|
12
19
|
* Updated cert again.
|
13
20
|
|
14
|
-
|
21
|
+
## 0.4.0 - 5-Sep-2017
|
22
|
+
|
15
23
|
* Switched constructor to use keyword arguments.
|
16
24
|
* Replaced Timeout with SafeTimeout and added the safe_timeout dependency.
|
17
25
|
* The :log option now accepts either an IO or Logger object.
|
18
26
|
* Updated cert.
|
19
27
|
|
20
|
-
|
28
|
+
## 0.3.2 - 4-Apr-2017
|
29
|
+
|
21
30
|
* Fix metadata key names.
|
22
31
|
|
23
|
-
|
32
|
+
## 0.3.1 - 4-Apr-2017
|
33
|
+
|
24
34
|
* Added some metadata to the gemspec.
|
25
35
|
|
26
|
-
|
36
|
+
## 0.3.0 - 27-Mar-2017
|
37
|
+
|
27
38
|
* The structured_warnings gem requirement was updated to 0.3.0 or later. This
|
28
39
|
is necessary if you are using Ruby 2.4 or later.
|
29
40
|
* The VERSION string is now frozen.
|
30
41
|
* Updated the certs file.
|
31
42
|
|
32
|
-
|
43
|
+
## 0.2.1 - 13-Dec-2015
|
44
|
+
|
33
45
|
* This gem is now signed.
|
34
46
|
* Updates to the Rakefile and gemspec.
|
35
47
|
* Added a caveat regarding the timeout module to the README.
|
36
48
|
|
37
|
-
|
49
|
+
## 0.2.0 - 26-Sep-2009
|
50
|
+
|
38
51
|
* Now requires and uses the structured_warnings gem. If a block of code fails
|
39
52
|
prior to reaching the maximum number of tries, and warnings are on, then
|
40
53
|
an Attempt::Warning is raised.
|
@@ -42,16 +55,19 @@
|
|
42
55
|
* Refactored the attempt.gemspec file a bit.
|
43
56
|
* Added the 'gem' task to the Rakefile.
|
44
57
|
|
45
|
-
|
58
|
+
## 0.1.2 - 1-Aug-2009
|
59
|
+
|
46
60
|
* License changed to Artistic 2.0.
|
47
61
|
* Added test-unit as a development dependency.
|
48
62
|
* Test file renamed to more closely follow Ruby style.
|
49
63
|
* Gemspec updates, including addition of license.
|
50
64
|
|
51
|
-
|
65
|
+
## 0.1.1 - 31-Jul-2007
|
66
|
+
|
52
67
|
* Added a Rakefile with tasks for testing and installation.
|
53
68
|
* Removed the install.rb file, since installation is now handled by the Rakefile.
|
54
69
|
* Some minor doc updates.
|
55
70
|
|
56
|
-
|
71
|
+
## 0.1.0 - 9-Jun-2006
|
72
|
+
|
57
73
|
* Initial commit
|
data/{MANIFEST → MANIFEST.md}
RENAMED
data/README.md
ADDED
@@ -0,0 +1,84 @@
|
|
1
|
+
## Description
|
2
|
+
|
3
|
+
A thin wrapper for begin + rescue + sleep + retry.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
gem install attempt
|
8
|
+
|
9
|
+
## Synopsis
|
10
|
+
|
11
|
+
```
|
12
|
+
require 'attempt'
|
13
|
+
|
14
|
+
# Attempt to ftp to some host, trying 3 times with 30 seconds between
|
15
|
+
# attempts before finally raising an error.
|
16
|
+
|
17
|
+
attempt(tries: 3, interval: 30){
|
18
|
+
Net::FTP.open(host, user, passwd){ ... }
|
19
|
+
}
|
20
|
+
|
21
|
+
# Or, do things the long way...
|
22
|
+
code = Attempt.new do |a|
|
23
|
+
a.tries = 3
|
24
|
+
a.interval = 30
|
25
|
+
end
|
26
|
+
|
27
|
+
code.attempt{
|
28
|
+
Net::FTP.open(host, user, passwd){ ... }
|
29
|
+
}
|
30
|
+
```
|
31
|
+
|
32
|
+
## Known Bugs
|
33
|
+
|
34
|
+
None that I'm aware of. If you find any bugs, please log them on the project page at:
|
35
|
+
|
36
|
+
https://github.com/djberg96/attempt
|
37
|
+
|
38
|
+
## Caveats
|
39
|
+
|
40
|
+
Use with caution. Specifically, make sure you aren't inadvertantly
|
41
|
+
wrapping code that already performs sleep + retry. Otherwise, you'll
|
42
|
+
end up with a series of nested retry's that could take much longer to
|
43
|
+
work than you expect.
|
44
|
+
|
45
|
+
Also, this library uses the timeout library internally, which has some
|
46
|
+
known issues. See Future Plans, below.
|
47
|
+
|
48
|
+
As of version 0.3.0, this library requires structured_warnings 0.3.0 or
|
49
|
+
later. This is necessary because of changes in Ruby 2.4.
|
50
|
+
|
51
|
+
Update: I've switched from the timeout library in the standard library to
|
52
|
+
the safe_timeout library which should improve things. In addition, the
|
53
|
+
structured_warnings library requirement is now 0.4.0 or later in order to
|
54
|
+
work with Ruby 2.7.
|
55
|
+
|
56
|
+
## Future Plans
|
57
|
+
|
58
|
+
Add the ability to set an absolute maximum number of seconds to prevent
|
59
|
+
nested sleep/retry from delaying attempts longer than expected.
|
60
|
+
|
61
|
+
Replace the timeout library with a self selecting pipe if possible.
|
62
|
+
|
63
|
+
## Acknowledgements
|
64
|
+
|
65
|
+
This library is partially based on Mark Fowler's 'Attempt' Perl module.
|
66
|
+
|
67
|
+
## Warranty
|
68
|
+
|
69
|
+
This package is provided "as is" and without any express or
|
70
|
+
implied warranties, including, without limitation, the implied
|
71
|
+
warranties of merchantability and fitness for a particular purpose.
|
72
|
+
|
73
|
+
## License
|
74
|
+
|
75
|
+
Apache-2.0
|
76
|
+
|
77
|
+
## Copyright
|
78
|
+
|
79
|
+
(C) 2006-2020, Daniel J. Berger
|
80
|
+
All Rights Reserved
|
81
|
+
|
82
|
+
## Author
|
83
|
+
|
84
|
+
Daniel J. Berger
|
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.6.
|
5
|
+
spec.version = '0.6.1'
|
6
6
|
spec.author = 'Daniel J. Berger'
|
7
7
|
spec.license = 'Apache-2.0'
|
8
8
|
spec.email = 'djberg96@gmail.com'
|
@@ -12,8 +12,6 @@ Gem::Specification.new do |spec|
|
|
12
12
|
spec.files = Dir['**/*'].reject{ |f| f.include?('git') }
|
13
13
|
spec.cert_chain = Dir['certs/*']
|
14
14
|
|
15
|
-
spec.extra_rdoc_files = ['README','CHANGES','MANIFEST']
|
16
|
-
|
17
15
|
spec.metadata = {
|
18
16
|
'changelog_uri' => 'https://github.com/djberg96/attempt/blob/master/CHANGES',
|
19
17
|
'source_code_uri' => 'https://github.com/djberg96/attempt/blob/master/lib/attempt.rb',
|
data/lib/attempt.rb
CHANGED
data/spec/attempt_spec.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.6.
|
4
|
+
version: 0.6.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel J. Berger
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
ORVCZpRuCPpmC8qmqxUnARDArzucjaclkxjLWvCVHeFa9UP7K3Nl9oTjJNv+7/jM
|
36
36
|
WZs4eecIcUc4tKdHxcAJ0MO/Dkqq7hGaiHpwKY76wQ1+8xAh
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2020-
|
38
|
+
date: 2020-10-20 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: structured_warnings
|
@@ -88,16 +88,13 @@ description: |2
|
|
88
88
|
email: djberg96@gmail.com
|
89
89
|
executables: []
|
90
90
|
extensions: []
|
91
|
-
extra_rdoc_files:
|
92
|
-
- README
|
93
|
-
- CHANGES
|
94
|
-
- MANIFEST
|
91
|
+
extra_rdoc_files: []
|
95
92
|
files:
|
96
|
-
- CHANGES
|
93
|
+
- CHANGES.md
|
97
94
|
- Gemfile
|
98
95
|
- LICENSE
|
99
|
-
- MANIFEST
|
100
|
-
- README
|
96
|
+
- MANIFEST.md
|
97
|
+
- README.md
|
101
98
|
- Rakefile
|
102
99
|
- attempt.gemspec
|
103
100
|
- certs/djberg96_pub.pem
|
metadata.gz.sig
CHANGED
Binary file
|
data/README
DELETED
@@ -1,72 +0,0 @@
|
|
1
|
-
== Description
|
2
|
-
A thin wrapper for begin + rescue + sleep + retry.
|
3
|
-
|
4
|
-
== Installation
|
5
|
-
gem install attempt
|
6
|
-
|
7
|
-
== Synopsis
|
8
|
-
require 'attempt'
|
9
|
-
|
10
|
-
# Attempt to ftp to some host, trying 3 times with 30 seconds between
|
11
|
-
# attempts before finally raising an error.
|
12
|
-
|
13
|
-
attempt(tries: 3, interval: 30){
|
14
|
-
Net::FTP.open(host, user, passwd){ ... }
|
15
|
-
}
|
16
|
-
|
17
|
-
# Or, do things the long way...
|
18
|
-
code = Attempt.new do |a|
|
19
|
-
a.tries = 3
|
20
|
-
a.interval = 30
|
21
|
-
end
|
22
|
-
|
23
|
-
code.attempt{
|
24
|
-
Net::FTP.open(host, user, passwd){ ... }
|
25
|
-
}
|
26
|
-
|
27
|
-
== Known Bugs
|
28
|
-
None that I'm aware of. If you find any bugs, please log them on the
|
29
|
-
project page at:
|
30
|
-
|
31
|
-
https://github.com/djberg96/attempt
|
32
|
-
|
33
|
-
== Caveats
|
34
|
-
Use with caution. Specifically, make sure you aren't inadvertantly
|
35
|
-
wrapping code that already performs sleep + retry. Otherwise, you'll
|
36
|
-
end up with a series of nested retry's that could take much longer to
|
37
|
-
work than you expect.
|
38
|
-
|
39
|
-
Also, this library uses the timeout library internally, which has some
|
40
|
-
known issues. See Future Plans, below.
|
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
|
-
|
45
|
-
Update: I've switched from the timeout library in the standard library to
|
46
|
-
the safe_timeout library which should improve things. In addition, the
|
47
|
-
structured_warnings library requirement is now 0.4.0 or later in order to
|
48
|
-
work with Ruby 2.7.
|
49
|
-
|
50
|
-
== Future Plans
|
51
|
-
Add the ability to set an absolute maximum number of seconds to prevent
|
52
|
-
nested sleep/retry from delaying attempts longer than expected.
|
53
|
-
|
54
|
-
Replace the timeout library with a self selecting pipe if possible.
|
55
|
-
|
56
|
-
== Acknowledgements
|
57
|
-
This library is partially based on Mark Fowler's 'Attempt' Perl module.
|
58
|
-
|
59
|
-
== Warranty
|
60
|
-
This package is provided "as is" and without any express or
|
61
|
-
implied warranties, including, without limitation, the implied
|
62
|
-
warranties of merchantability and fitness for a particular purpose.
|
63
|
-
|
64
|
-
== License
|
65
|
-
Apache-2.0
|
66
|
-
|
67
|
-
== Copyright
|
68
|
-
(C) 2006-2020, Daniel J. Berger
|
69
|
-
All Rights Reserved
|
70
|
-
|
71
|
-
== Author
|
72
|
-
Daniel J. Berger
|