Sha256: c34a0614c5cc6365daf7e0ae20ad17c79b4a8bd507d78bd5d5620ce500511285

Contents?: true

Size: 559 Bytes

Versions: 12

Compression:

Stored size: 559 Bytes

Contents

# Makes iteration continue with the next value, optionally with a given value for this iteration.
# If a value is not given it defaults to `undef`
#
# @since 4.7.0
#
Puppet::Functions.create_function(:next) do
  dispatch :next_impl do
    optional_param 'Any', :value
  end

  def next_impl(value = nil)
    stacktrace = Puppet::Pops::PuppetStack.stacktrace()
    if stacktrace.size > 0
      file, line = stacktrace[0]
    else
      file = nil
      line = nil
    end

    exc = Puppet::Pops::Evaluator::Next.new(value, file, line)
    raise exc
  end
end

Version data entries

12 entries across 12 versions & 2 rubygems

Version Path
bolt-0.20.3 vendored/puppet/lib/puppet/functions/next.rb
bolt-0.20.2 vendored/puppet/lib/puppet/functions/next.rb
bolt-0.19.1 vendored/puppet/lib/puppet/functions/next.rb
bolt-0.19.0 vendored/puppet/lib/puppet/functions/next.rb
bolt-0.18.2 vendored/puppet/lib/puppet/functions/next.rb
bolt-0.18.1 vendored/puppet/lib/puppet/functions/next.rb
bolt-0.18.0 vendored/puppet/lib/puppet/functions/next.rb
puppet-5.5.0 lib/puppet/functions/next.rb
puppet-5.5.0-x86-mingw32 lib/puppet/functions/next.rb
puppet-5.5.0-x64-mingw32 lib/puppet/functions/next.rb
puppet-5.5.0-universal-darwin lib/puppet/functions/next.rb
bolt-0.17.2 vendored/puppet/lib/puppet/functions/next.rb