rescue-retry 0.1.0 → 0.1.1

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: 2a8b1fc794a6e2af2f1f49306d53a4c78dfef9e1
4
- data.tar.gz: 21799f0fea3fb29a50cc4a4bdd4eb06da5d2588e
3
+ metadata.gz: 1d9182769a84d432b29f0d2999cf3c62faacfe6d
4
+ data.tar.gz: 623972364f0ce7e2496d17d1cc365c39cd152ad3
5
5
  SHA512:
6
- metadata.gz: 46b16c7045ac1eaa166bf10c6b8fcff1bab2a50a15f3e6c6f1ddea676709ac60f37cecdebcb3efa5ded07b158e212ed2dc84af642a91e79f2e2605a6eaf033db
7
- data.tar.gz: 95018b6100071aff5798470fed71815fcdcab1508a0a903338ca61efdd17f243f90dc9f6eb33786feb97f1b87e9f9dead7d9f679a5967c5471343cea91029137
6
+ metadata.gz: a4f403fa12755cbae714cae66912023a476d52e0604452d27dd1453ff0b77665d4b84ca31e02b2b40852fddc46774cb03a20e835be69bb6c6d70c7de04e15e96
7
+ data.tar.gz: 4f8ee2e17f7d1aab9e4ac235412e8d63f67ff4ae9adcc0fa3ea8e7c5a2b8e3b6394cf5752b4cb501e37222f496b86324cff6959e00f9a068ccdfa8433d67f9fd
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Rescue::Retry
1
+ # Rescue::Retry [![Build Status](https://travis-ci.org/robert2d/rescue-retry.svg?branch=master)](https://travis-ci.org/robert2d/rescue-retry) [![Coverage Status](https://coveralls.io/repos/github/robert2d/rescue-retry/badge.svg?branch=master)](https://coveralls.io/github/robert2d/rescue-retry?branch=master)
2
2
 
3
3
  Wraps a instance method in a configurable retry handler with additional/optional delay logic as well.
4
4
 
@@ -52,5 +52,5 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
52
52
 
53
53
  ## Contributing
54
54
 
55
- Bug reports and pull requests are welcome on GitHub at https://github.com/[robert2d]/rescue-retry.
55
+ Bug reports and pull requests are welcome on GitHub at https://github.com/robert2d/rescue-retry.
56
56
 
@@ -15,8 +15,8 @@ module Rescue
15
15
  def call(&block)
16
16
  block.call
17
17
  rescue *errors => e
18
- logger.warn "Failed attempt (#{attempt} of #{max_attempts}) #<#{e.class.name}.#{e.message}>"
19
- re_raise(e) if max_attempts?
18
+ log_attempt(e)
19
+ raise if max_attempts?
20
20
  @attempt += 1
21
21
  sleep delay_retry(attempt) unless delay == :none
22
22
  retry
@@ -31,9 +31,9 @@ module Rescue
31
31
  raise ArgumentError, "unknown delay \"#{delay}\". accepts: :exponential, :linear and :random"
32
32
  end
33
33
 
34
- def re_raise(error)
34
+ def log_attempt(e)
35
+ logger.warn "Failed attempt (#{attempt} of #{max_attempts}) #<#{e.class.name}.#{e.message}>"
35
36
  logger.error "maximum attempts (#{max_attempts}) reached"
36
- raise error.class, error.message
37
37
  end
38
38
 
39
39
  def max_attempts?
@@ -1,5 +1,5 @@
1
1
  module Rescue
2
2
  module Retry
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
data/rescue-retry.gemspec CHANGED
@@ -23,4 +23,5 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency "bundler", "~> 1.13"
24
24
  spec.add_development_dependency "rake", "~> 10.0"
25
25
  spec.add_development_dependency "rspec", "~> 3.0"
26
+ spec.add_development_dependency "coveralls", "~> 0.8"
26
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rescue-retry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - robert2d
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-08-02 00:00:00.000000000 Z
11
+ date: 2018-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -52,6 +52,20 @@ dependencies:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
54
  version: '3.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: coveralls
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.8'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.8'
55
69
  description: Wraps an instance method with retry and error capture without adding
56
70
  logic directly to the method
57
71
  email:
@@ -91,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
91
105
  version: '0'
92
106
  requirements: []
93
107
  rubyforge_project:
94
- rubygems_version: 2.5.1
108
+ rubygems_version: 2.6.11
95
109
  signing_key:
96
110
  specification_version: 4
97
111
  summary: Rescue and Retry a instance method, whilst keeping a method free from rescue's