Sha256: 4a6bd171eb0fd8e2b6251af6e5dbb8eb343876799f3f05257131e957cf66e448
Contents?: true
Size: 509 Bytes
Versions: 1
Compression:
Stored size: 509 Bytes
Contents
module RAutomation # Waiting with timeout module WaitHelper extend self class TimeoutError < StandardError end # @private # Wait until the block evaluates to true or times out. def wait_until(timeout = Window.wait_timeout, &block) end_time = ::Time.now + timeout until ::Time.now > end_time result = yield(self) return result if result sleep 0.5 end raise TimeoutError, "timed out after #{timeout} seconds" end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
rdp-rautomation-0.6.3.1 | lib/rautomation/wait_helper.rb |