retries 0.0.4 → 0.0.5

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: dd3d179ec65dd4b129917c3de75d16a2338e976f
4
- data.tar.gz: 203b004f805b262a373a6a1f013c179aa830a2a6
3
+ metadata.gz: 229b152c990c4377a7aa86af573035c905532e30
4
+ data.tar.gz: 21b6d56685659ef58ae6fe3c8c1a01770b013f6b
5
5
  SHA512:
6
- metadata.gz: 6777f2702802e0eb96db8f76bd97bc8e15da966b3a8d78f31d6cdd819c8a3681d6fc4441d583dcd9d85def9f4a66c56da6bcd12a28f732e34c0c007dec591751
7
- data.tar.gz: ab72433058a85d5e6d0844f54aeecc22fa70032fe07965c6200c019dc87c2328f423fd3d75b4239120039e316812213f850d5546b19327ce66f5a5b426b6c427
6
+ metadata.gz: 422a0867572c21ac9d78473ae1fd42032d12e4af8689dc315c1f30db0388c15a719e8f2bf403ac6b48e4ed3e3c0f551a2339ab7dd1643f93fbb22d24ea676016
7
+ data.tar.gz: 50f771f746daa1dae2c5810ddbd50ce0b2e0ebbc587668223bd51eb4dd22ace8d4b65f58c059553ac582cc4efe2b1274b0f3acf2b6608091df4138d35a18dc5d
@@ -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
- * Harry Robertson
112
- * Caleb Spare
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
 
@@ -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]) || [StandardError]
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
@@ -1,3 +1,3 @@
1
1
  class Retries
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -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
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-12 00:00:00.000000000 Z
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