Sha256: e3979584a73fa0ed45ededc47b90bebb7c857350d27a7a6b397952ef8c34f58e

Contents?: true

Size: 426 Bytes

Versions: 35

Compression:

Stored size: 426 Bytes

Contents

module Calabash
  module Android
    module Retry
      def self.retry(opts, &blk)
        tries = opts[:tries]
        interval = opts[:interval]

        tries.times do |try|
          begin
            blk.call
            return

          rescue => e
            if (try + 1) >= tries
              raise
            else
              sleep interval
            end
          end
        end
      end
    end
  end
end

Version data entries

35 entries across 35 versions & 1 rubygems

Version Path
calabash-android-0.9.5 lib/calabash-android/retry.rb
calabash-android-0.9.4 lib/calabash-android/retry.rb
calabash-android-0.9.3 lib/calabash-android/retry.rb
calabash-android-0.9.2 lib/calabash-android/retry.rb
calabash-android-0.9.1.pre2 lib/calabash-android/retry.rb
calabash-android-0.9.1.pre1 lib/calabash-android/retry.rb
calabash-android-0.9.0.pre1 lib/calabash-android/retry.rb
calabash-android-0.9.0 lib/calabash-android/retry.rb
calabash-android-0.8.4 lib/calabash-android/retry.rb
calabash-android-0.8.3 lib/calabash-android/retry.rb
calabash-android-0.8.3.pre1 lib/calabash-android/retry.rb
calabash-android-0.8.2 lib/calabash-android/retry.rb
calabash-android-0.8.1 lib/calabash-android/retry.rb
calabash-android-0.8.0 lib/calabash-android/retry.rb
calabash-android-0.8.0.pre2 lib/calabash-android/retry.rb