take2 0.0.3 → 0.0.4

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
- SHA1:
3
- metadata.gz: fdbb5ecf82b31d399cf75eacacd3a7c8b4cf4aaa
4
- data.tar.gz: 3662448022c2ca158c789982b7d51a62ae81c0e4
2
+ SHA256:
3
+ metadata.gz: e1527877f8368992454961e227f3c12d5eee2249bb2585accfd2cd0f6d395d12
4
+ data.tar.gz: 06a69e8b6404ac91625766cff5dbc5ac4bd1cf8f137986ab5c541d4fc36da82f
5
5
  SHA512:
6
- metadata.gz: 153630133ce8f3dee9d7f0ef2f0ad2ca57673591ac08435e11b692124aec32cbae50b4d9b2bed42545156168fc3e60f3fa58e61060f5952d08fd5fd74202e582
7
- data.tar.gz: 5f73de42c0c6a7381bc6943f5a02d77bc8fc16f893ee59e749699210cd7a4c8f5821d908df8cd830cba92cf59bc254c9b30ab6b2093df86cc4ed9c2da7fd720d
6
+ metadata.gz: d2691c3b01a60440020e9e68585cf3b1245b3c4a7985f1216686353b0d030494e1a4b8520bb46b44f701b5b1e88fa3d28032b515da09d93335b9cea7b89164ac
7
+ data.tar.gz: d5ff1f23f6d487b86f3d3b3cf023fb8e568237c2578015bd350ccee011c5544efbb08478afb84f93c2bc5b57c6f010eec0b807e0bebba8c3f40617d87151d018
@@ -2,4 +2,13 @@
2
2
  #
3
3
  * Add class validations for class helper methods
4
4
  * Add basic documentation
5
- * Rename the public api to :call_with_retry
5
+ #
6
+ 0.0.2
7
+ #
8
+ * Add more tests
9
+ #
10
+ v0.0.3
11
+ * Fix configurations bug (#4)
12
+ * Ability to set custom configurations on method call (#1)
13
+ * More tests (#3)
14
+ * Update docs and badges
data/README.md CHANGED
@@ -22,7 +22,7 @@ class KratosService
22
22
  number_of_retries 3
23
23
 
24
24
  # Could be configured globally or on class level.
25
- retriable_errors Net::HTTPRetriableError, Net::HTTPServerError
25
+ retriable_errors Net::HTTPRetriableError, Net::HTTPServerException
26
26
 
27
27
  # Retry unless the response status is 5xx. The implementation is dependent of the http lib in use.
28
28
  retriable_condition proc { |error| error.response.code < 500 }
@@ -79,8 +79,7 @@ KratosService.retriable_configuration
79
79
 
80
80
  Take2.configure do |config|
81
81
  config.retries = 3
82
- config.retriable = [
83
- Net::HTTPServerError,
82
+ config.retriable = [
84
83
  Net::HTTPServerException,
85
84
  Net::HTTPRetriableError,
86
85
  Errno::ECONNRESET,
@@ -41,7 +41,7 @@ module Take2
41
41
  # include Take2
42
42
  #
43
43
  # number_of_retries 3
44
- # retriable_errors Net::HTTPRetriableError, Net::HTTPServerError
44
+ # retriable_errors Net::HTTPRetriableError
45
45
  # retriable_condition proc { |error| response_status(error.response) < 500 }
46
46
  # on_retry proc { |error, tries| puts "#{self.name} - Retrying.. #{tries} of #{self.retriable_configuration[:retries]} (#{error})" }
47
47
  # sleep_before_retry 3
@@ -7,7 +7,6 @@ module Take2
7
7
  # Defaults
8
8
  @retries = 3
9
9
  @retriable = [
10
- Net::HTTPServerError,
11
10
  Net::HTTPServerException,
12
11
  Net::HTTPRetriableError,
13
12
  Errno::ECONNRESET,
@@ -1,3 +1,3 @@
1
1
  module Take2
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -11,8 +11,7 @@ RSpec.describe Take2::Configuration do
11
11
  end
12
12
 
13
13
  it 'has correct default retriable errors array' do
14
- expect(default.retriable).to eql [
15
- Net::HTTPServerError,
14
+ expect(default.retriable).to eql [
16
15
  Net::HTTPServerException,
17
16
  Net::HTTPRetriableError,
18
17
  Errno::ECONNRESET,
@@ -5,7 +5,7 @@ RSpec.describe Take2 do
5
5
  let!(:config) do
6
6
  Take2.configure do |c|
7
7
  c.retries = 1
8
- c.retriable = [Net::HTTPServerError, Net::HTTPRetriableError].freeze
8
+ c.retriable = [Net::HTTPServerException, Net::HTTPRetriableError].freeze
9
9
  c.retry_condition_proc = proc {false}
10
10
  c.retry_proc = proc {}
11
11
  c.time_to_sleep = 0.5
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: take2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Anton Magids
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-09-24 00:00:00.000000000 Z
11
+ date: 2018-12-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Retry API calls, methods or blocks of code. Define take2 retry behavior
14
14
  or use defaults and you good to go.
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
55
55
  version: '0'
56
56
  requirements: []
57
57
  rubyforge_project:
58
- rubygems_version: 2.6.14
58
+ rubygems_version: 2.7.8
59
59
  signing_key:
60
60
  specification_version: 4
61
61
  summary: Provides Take2 for your APIs calls