retry_once 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/retry_once.rb +9 -8
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c6a9fab0f740fd879c5332bc9f352c5c5fce613
4
- data.tar.gz: d2e5f3eee3f8c381455852138fce1e257f39383d
3
+ metadata.gz: 18ace67a5d8f93185775b99511ffbd774c54b352
4
+ data.tar.gz: beb5d37e5f06679495808829d785d81ef28d7a78
5
5
  SHA512:
6
- metadata.gz: f593d816990612758358c299d6e4546e28c401c53c34cf4d974e319b79b1243d4cf6a74218bfcd0b2fc85c706b0e7606a548b82338ca1775ce47765f59688a3a
7
- data.tar.gz: bc5a8238f01e48d3a898114a8b9037ba61a93f925faa7eb91caa273ca7e58a7dd20bb79b6dd4ceab6d455f0de473d0b40c9c107277353ed0197b0aeb1fddc37b
6
+ metadata.gz: e4d2a7acf28fb10f9a019d6771478e29c033983bd8b74c537b378705c9e1ad50210b75179ec4b17784240d8ce1d8ab5517add0d2dd7b3d4cbda7ad07895c56b2
7
+ data.tar.gz: 991948e545a36aa018c029fafddd2fff951382b7d8b4f1e9d9f9837ad221d29d26eeb801fcfe66cb61260bb14e7851d7f7189eb1853e55d80cc18ff161d892c9
@@ -1,15 +1,16 @@
1
1
  module Kernel
2
- def retry_once_with(exception, proc_or_symbol, retried=false, &body)
2
+ def retry_exception_once_with(__exception, __proc_or_symbol, __retried=false, &__body)
3
3
  begin
4
- body.call
5
- rescue exception
6
- if not retried
7
- if Symbol === proc_or_symbol
8
- self.send(f)
4
+ __body.call
5
+ rescue *(Array(__exception))
6
+ raise if __retried
7
+ if not __retried
8
+ if Symbol === __proc_or_symbol
9
+ send(f)
9
10
  else
10
- proc_or_symbol.call
11
+ __proc_or_symbol.call
11
12
  end
12
- retry_once_with(exception, proc_or_symbol, true, &body)
13
+ retry_exception_once_with(__exception, __proc_or_symbol, true, &__body)
13
14
  end
14
15
  end
15
16
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: retry_once
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jeroen Bulters