def_retry 0.2.1 → 0.2.2

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: 506e2b27bc48952be087188682123b8c47f4254f
4
- data.tar.gz: c9e8cd16b09b01c64f3a306bddc25a0de38c6c9b
3
+ metadata.gz: c23a1e9d09322018ffab404e33b2b1829e151b6f
4
+ data.tar.gz: 0d4559e96f564bce7ed692f458e06d0d725a9f1d
5
5
  SHA512:
6
- metadata.gz: 19f1ee109469b9b9032c1b5ce44ea8ef9e934fc6013d90e211ce9738c21b5fbde082308a77188efc05178fd73453d4f955aafc42b27bf60b63100ed1bc6ff8fa
7
- data.tar.gz: e74bd32c7a9cd1cb2082730759196cff27cf7d9863b8c98108ed31f1b3d79f3dfdfda972339153c1500d6f4c7bb4dcf5edc7fac89167e0ba5cdb5fa52b36cdf9
6
+ metadata.gz: eddaa8537a5ef2a8ac0e3e95d1bad3ae1d21a05acc56abd2bd06377e6214d3688d7c73760d2b2792f880bd04e5d670f215a75b7e50e368b13e0e16f69a9e6edc
7
+ data.tar.gz: b82d9282f706622ab38b7d799ab854ed46ce967ee369c575d87855358fff6e22e6687aacc4352d30214366729ce12ee003bd826fea324f44a223fa9ba7d8efa1
@@ -49,7 +49,8 @@ module DefRetry
49
49
  private
50
50
 
51
51
  def run_sleep_strategy
52
- sleep @sleep.is_a?(Fixnum) ? @sleep : @sleep.call(@try_count)
52
+ seconds = [(@sleep.respond_to?(:call) ? @sleep.call(@try_count) : @sleep)).to_i, 1].max
53
+ sleep seconds
53
54
  end
54
55
  end
55
56
  end
@@ -1,3 +1,3 @@
1
1
  module DefRetry
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: def_retry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Salazar