Class: XamarinTestCloud::RetriableOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/xamarin-test-cloud/retriable_options.rb

Overview

A class to bridge the gap between retriable 1.x and 2.0.

Class Method Summary collapse

Class Method Details

.retriable_versionObject


8
9
10
11
12
13
14
15
# File 'lib/xamarin-test-cloud/retriable_options.rb', line 8

def self.retriable_version
  parts = Retriable::VERSION.split('.')
  {
        :major => parts[0] ? parts[0].to_i : nil,
        :minor => parts[1] ? parts[1].to_i : nil,
        :patch => parts[2] ? parts[2].to_i : nil
  }
end

.tries_and_interval(tries, interval) ⇒ Object


17
18
19
20
21
22
23
24
# File 'lib/xamarin-test-cloud/retriable_options.rb', line 17

def self.tries_and_interval(tries, interval)
  version = self.retriable_version[:major]
  if version >= 2
    {:intervals => Array.new(tries, interval)}
  else
    {:tries => tries, :interval => interval}
  end
end