retries 0.0.4 → 0.0.5
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/CHANGES.md +23 -0
- data/README.md +6 -2
- data/lib/retries.rb +1 -1
- data/lib/retries/version.rb +1 -1
- data/test/retries_test.rb +12 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 229b152c990c4377a7aa86af573035c905532e30
|
4
|
+
data.tar.gz: 21b6d56685659ef58ae6fe3c8c1a01770b013f6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 422a0867572c21ac9d78473ae1fd42032d12e4af8689dc315c1f30db0388c15a719e8f2bf403ac6b48e4ed3e3c0f551a2339ab7dd1643f93fbb22d24ea676016
|
7
|
+
data.tar.gz: 50f771f746daa1dae2c5810ddbd50ce0b2e0ebbc587668223bd51eb4dd22ace8d4b65f58c059553ac582cc4efe2b1274b0f3acf2b6608091df4138d35a18dc5d
|
data/CHANGES.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Changelog
|
2
|
+
|
3
|
+
## 0.0.5
|
4
|
+
|
5
|
+
* Bugfix for when `:rescue` isn't specified (@hlascelles).
|
6
|
+
* Add a contributors list.
|
7
|
+
|
8
|
+
## 0.0.4
|
9
|
+
|
10
|
+
* Add `total_delay` to the exception handler arguments (@mmazour).
|
11
|
+
|
12
|
+
## 0.0.3
|
13
|
+
|
14
|
+
* Update published homepage link in the gem.
|
15
|
+
|
16
|
+
## 0.0.2
|
17
|
+
|
18
|
+
* Add `Retries.sleep_enabled` for disabling sleeps in tests.
|
19
|
+
* Better Readme.
|
20
|
+
|
21
|
+
## 0.0.1
|
22
|
+
|
23
|
+
* Initial version
|
data/README.md
CHANGED
@@ -108,8 +108,12 @@ To run the tests: first clone the repo, then
|
|
108
108
|
|
109
109
|
## Authors
|
110
110
|
|
111
|
-
|
112
|
-
|
111
|
+
Retries was created by Harry Robertson and Caleb Spare.
|
112
|
+
|
113
|
+
Other contributions from:
|
114
|
+
|
115
|
+
* Harry Lascelles ([hlascelles](https://github.com/hlascelles))
|
116
|
+
* Michael Mazour ([mmazour](https://github.com/mmazour))
|
113
117
|
|
114
118
|
## License
|
115
119
|
|
data/lib/retries.rb
CHANGED
@@ -35,7 +35,7 @@ module Kernel
|
|
35
35
|
raise "#{options_error_string} :base_sleep_seconds cannot be greater than :max_sleep_seconds."
|
36
36
|
end
|
37
37
|
handler = options[:handler]
|
38
|
-
exception_types_to_rescue = Array(options[:rescue]
|
38
|
+
exception_types_to_rescue = Array(options[:rescue] || StandardError)
|
39
39
|
raise "#{options_error_string} with_retries must be passed a block" unless block_given?
|
40
40
|
|
41
41
|
# Let's do this thing
|
data/lib/retries/version.rb
CHANGED
data/test/retries_test.rb
CHANGED
@@ -43,6 +43,18 @@ class RetriesTest < Scope::TestCase
|
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
46
|
+
should "rescue StandardError if no :rescue is specified" do
|
47
|
+
tries = 0
|
48
|
+
class MyError < StandardError; end
|
49
|
+
with_retries(:base_sleep_seconds => 0, :max_sleep_seconds => 0) do
|
50
|
+
tries += 1
|
51
|
+
if tries < 2
|
52
|
+
raise MyError, "boom"
|
53
|
+
end
|
54
|
+
end
|
55
|
+
assert_equal 2, tries
|
56
|
+
end
|
57
|
+
|
46
58
|
should "immediately raise any exception not specified by :rescue" do
|
47
59
|
tries = 0
|
48
60
|
assert_raises(CustomErrorA) do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: retries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Caleb Spare
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-03-
|
11
|
+
date: 2013-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -89,6 +89,7 @@ extra_rdoc_files: []
|
|
89
89
|
files:
|
90
90
|
- .gitignore
|
91
91
|
- .yardopts
|
92
|
+
- CHANGES.md
|
92
93
|
- Gemfile
|
93
94
|
- LICENSE
|
94
95
|
- README.md
|