Sha256: d3820e38a02c45f7a3d348f6734ec60bed8c8e07a72e0e3d716a83a9ce679027
Contents?: true
Size: 374 Bytes
Versions: 3
Compression:
Stored size: 374 Bytes
Contents
module Mohawk module Waiter extend self class WaitTimeout < StandardError; end def wait_until(timeout=Mohawk.timeout, context=nil, &block) start = Time.now until (result = block.call) || (Time.now - start > timeout) sleep 0.25 end raise WaitTimeout, context unless result result end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
mohawk-1.0 | lib/mohawk/waiter.rb |
mohawk-0.4.4 | lib/mohawk/waiter.rb |
mohawk-0.4.3 | lib/mohawk/waiter.rb |