Sha256: 75992cece0c6749195c256b72dac908a17e5ca26622927a5b8dda8686be1e834

Contents?: true

Size: 402 Bytes

Versions: 14

Compression:

Stored size: 402 Bytes

Contents

# frozen_string_literal: true

# Repeat the block until it returns a truthy value. Returns the value.
Puppet::Functions.create_function(:'ctrl::do_until') do
  # @example Run a task until it succeeds
  #   ctrl::do_until() || {
  #     run_task('test', $target, _catch_errors => true).ok?
  #   }
  dispatch :do_until do
    block_param
  end

  def do_until
    until (x = yield); end
    x
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
bolt-1.21.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.20.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.19.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.18.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.17.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.16.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.15.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.14.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.13.1 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.13.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.12.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.11.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.10.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb
bolt-1.9.0 bolt-modules/ctrl/lib/puppet/functions/ctrl/do_until.rb