luffa 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/luffa.rb +1 -0
- data/lib/luffa/patches/retriable.rb +24 -0
- data/lib/luffa/version.rb +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 108c670d5771f452920fed16598286325b9fa184
|
4
|
+
data.tar.gz: 204e081520a67f7722f449949546748e2ad95b42
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0772e531c56b8138eed0cb6c39df309f4f410fda7dc04fb4350df702ca3d7ec82ee9680e60709f6a874025e36768806e4838d3f67eb6dd580562fa16bd185c5f
|
7
|
+
data.tar.gz: 0d3609b3b5553bd8c667665519987d3a02c5fd53464d1b47eee92922ad7e6238739746ea7bee268944baa463573529db0408e9b629b342015cf0dacc7c16a72c
|
data/lib/luffa.rb
CHANGED
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'retriable'
|
2
|
+
|
3
|
+
module Luffa
|
4
|
+
# A class to bridge the gap between retriable 1.x and 2.0.
|
5
|
+
class RetryOpts
|
6
|
+
def self.tries_and_interval(tries, interval, other_retry_options={})
|
7
|
+
retriable_version = Luffa::Version.new(Retriable::VERSION)
|
8
|
+
|
9
|
+
if other_retry_options[:tries]
|
10
|
+
raise RuntimeError, ':tries is not a valid key for other_retry_options'
|
11
|
+
elsif other_retry_options[:interval]
|
12
|
+
raise RuntimeError, ':interval is not a valid key for other_retry_options'
|
13
|
+
elsif other_retry_options[:intervals]
|
14
|
+
raise RuntimeError, ':intervals is not a valid key for other_retry_options'
|
15
|
+
end
|
16
|
+
|
17
|
+
if retriable_version >= Luffa::Version.new('2.0.0')
|
18
|
+
other_retry_options.merge({:intervals => Array.new(tries, interval)})
|
19
|
+
else
|
20
|
+
other_retry_options.merge({:tries => tries, :interval => interval})
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
data/lib/luffa/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: luffa
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Maturana Larsen
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date: 2015-03-
|
14
|
+
date: 2015-03-28 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: awesome_print
|
@@ -47,7 +47,7 @@ dependencies:
|
|
47
47
|
requirements:
|
48
48
|
- - "<"
|
49
49
|
- !ruby/object:Gem::Version
|
50
|
-
version: '2.
|
50
|
+
version: '2.1'
|
51
51
|
- - ">="
|
52
52
|
- !ruby/object:Gem::Version
|
53
53
|
version: 1.3.3.1
|
@@ -57,7 +57,7 @@ dependencies:
|
|
57
57
|
requirements:
|
58
58
|
- - "<"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '2.
|
60
|
+
version: '2.1'
|
61
61
|
- - ">="
|
62
62
|
- !ruby/object:Gem::Version
|
63
63
|
version: 1.3.3.1
|
@@ -289,6 +289,7 @@ files:
|
|
289
289
|
- lib/luffa/logging.rb
|
290
290
|
- lib/luffa/patches/awesome_print.rb
|
291
291
|
- lib/luffa/patches/kernel.rb
|
292
|
+
- lib/luffa/patches/retriable.rb
|
292
293
|
- lib/luffa/retry.rb
|
293
294
|
- lib/luffa/unix_command.rb
|
294
295
|
- lib/luffa/version.rb
|