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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db82245cd0c299d2aefbc93898655269107fbe0d
4
- data.tar.gz: b5b95534919b6d830e4c2187ed7ba3833883b7a4
3
+ metadata.gz: 108c670d5771f452920fed16598286325b9fa184
4
+ data.tar.gz: 204e081520a67f7722f449949546748e2ad95b42
5
5
  SHA512:
6
- metadata.gz: a29dc6883243c4778e56d1f868f555210229b95be303c75db93f06eb504a37bbd788086c3c13c6b107938f0b4e3179ef7c1214fc143b7472e4a93a482ada3eca
7
- data.tar.gz: ed5e4b15f5c4a9202a27a9c9d6db373c95ba7a60a56cfe51ac5f76d21ba90173b79190d49d6537f7b849818d85deee959b7a4561245f1dcda36fffd9bf9211f3
6
+ metadata.gz: 0772e531c56b8138eed0cb6c39df309f4f410fda7dc04fb4350df702ca3d7ec82ee9680e60709f6a874025e36768806e4838d3f67eb6dd580562fa16bd185c5f
7
+ data.tar.gz: 0d3609b3b5553bd8c667665519987d3a02c5fd53464d1b47eee92922ad7e6238739746ea7bee268944baa463573529db0408e9b629b342015cf0dacc7c16a72c
@@ -1,6 +1,7 @@
1
1
  require 'luffa/environment'
2
2
  require 'luffa/patches/awesome_print'
3
3
  require 'luffa/patches/kernel'
4
+ require 'luffa/patches/retriable'
4
5
  require 'luffa/logging'
5
6
  require 'luffa/version'
6
7
  require 'luffa/unix_command'
@@ -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
@@ -1,5 +1,5 @@
1
1
  module Luffa
2
- VERSION = '1.0.2'
2
+ VERSION = '1.0.3'
3
3
 
4
4
  # A model of a software release version that can be used to compare two versions.
5
5
  #
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.2
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-25 00:00:00.000000000 Z
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.0'
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.0'
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