Sha256: 96424ca665619ebff6036174092406e2561b57c9a79bbb7392153c4265c44d97

Contents?: true

Size: 718 Bytes

Versions: 2

Compression:

Stored size: 718 Bytes

Contents

require 'retriable'
require 'retriable/version' # needed in 1.x. In 2.x auto required.

module XamarinTestCloud
  # A class to bridge the gap between retriable 1.x and 2.0.
  class RetriableOptions

    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

    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
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
xamarin-test-cloud-appium-1.1.1 lib/xamarin-test-cloud-appium/retriable_options.rb
xamarin-test-cloud-1.1.1 lib/xamarin-test-cloud/retriable_options.rb