CHips L MINI SHELL

CHips L pro

Current Path : /opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/
Upload File :
Current File : //opt/puppetlabs/puppet/lib/ruby/vendor_ruby/hiera/recursive_guard.rb

# Allow for safe recursive lookup of values during variable interpolation.
#
# @api private
class Hiera::InterpolationLoop < StandardError; end

class Hiera::RecursiveGuard
  def initialize
    @seen = []
  end

  def check(value, &block)
    if @seen.include?(value)
      raise Hiera::InterpolationLoop, "Lookup recursion detected in [#{@seen.join(', ')}]"
    end
    @seen.push(value)
    ret = yield
    @seen.pop
    ret
  end
end

Copyright 2K16 - 2K18 Indonesian Hacker Rulez