Sha256: e51a4de8320c4b19d18774c380ff5c6900f1d668c5807158ca1c667b7bac3bed

Contents?: true

Size: 318 Bytes

Versions: 20

Compression:

Stored size: 318 Bytes

Contents

module Fog

  def self.wait_for(timeout=Fog.timeout, interval=1, &block)
    duration = 0
    start = Time.now
    until yield || duration > timeout
      sleep(interval.to_f)
      duration = Time.now - start
    end
    if duration > timeout
      false
    else
      { :duration => duration }
    end
  end
  
end

Version data entries

20 entries across 20 versions & 8 rubygems

Version Path
fog-parser-fix-1.6.1 lib/fog/core/wait_for.rb
fog-test-again-1.6.0 lib/fog/core/wait_for.rb
fog-parser-fix-1.6.0 lib/fog/core/wait_for.rb
fog-1.6.0 lib/fog/core/wait_for.rb
fog-1.5.0 lib/fog/core/wait_for.rb
rackspace-fog-1.4.2 lib/rackspace-fog/core/wait_for.rb
fog-1.4.0 lib/fog/core/wait_for.rb
brightbox-cli-0.18.1 lib/brightbox-cli/vendor/fog/lib/fog/core/wait_for.rb
michiels-fog-1.3.1 lib/fog/core/wait_for.rb
ftl-0.2.0 vendor/bundle/gems/fog-1.3.1/lib/fog/core/wait_for.rb
brightbox-cli-0.18.0 lib/brightbox-cli/vendor/fog/lib/fog/core/wait_for.rb
fog-1.3.1 lib/fog/core/wait_for.rb
fog-1.3.0 lib/fog/core/wait_for.rb
brightbox-cli-0.17.5 lib/brightbox-cli/vendor/fog/lib/fog/core/wait_for.rb
fog-1.2.0 lib/fog/core/wait_for.rb
ktheory-fog-1.1.2 lib/fog/core/wait_for.rb
brightbox-cli-0.17.4 lib/brightbox-cli/vendor/fog/lib/fog/core/wait_for.rb
brightbox-cli-0.17.3 lib/brightbox-cli/vendor/fog/lib/fog/core/wait_for.rb
brightbox-cli-0.17.2 lib/brightbox-cli/vendor/fog/lib/fog/core/wait_for.rb
fog-1.1.2 lib/fog/core/wait_for.rb