Sha256: 72ca801a9fc2fc66f2d19c08f2b834094cc82800569775d7b264e16579844d5a

Contents?: true

Size: 879 Bytes

Versions: 122

Compression:

Stored size: 879 Bytes

Contents

module Puppet::Pops::Loader

# A PredefinedLoader is a loader that is manually populated with loaded elements
# before being used. It never loads anything on its own.
# When searching for a type, it must exist or an error is raised
#
class PredefinedLoader < BaseLoader
  def find(typed_name)
    if typed_name.type == :type
      raise Puppet::Pops::Loaders::LoaderError, "Cannot load undefined type '#{typed_name.name.capitalize}'"
    else
      nil
    end
  end

  def to_s()
    "(PredefinedLoader '#{loader_name}')"
  end

  # Allows shadowing since this loader is used internally for things like function local types
  # And they should win as there is otherwise a risk that the local types clash with built in types
  # that were added after the function was written, or by resource types loaded by the 3x auto loader.
  #
  def allow_shadowing?
    true
  end
end

end

Version data entries

122 entries across 122 versions & 2 rubygems

Version Path
puppet-retrospec-1.8.0 vendor/pup410/lib/puppet/pops/loader/predefined_loader.rb
puppet-retrospec-1.7.0 vendor/pup410/lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.12 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.12-x86-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.12-x64-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.12-universal-darwin lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.11 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.11-x86-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.11-x64-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.11-universal-darwin lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.10 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.10-x86-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.10-x64-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.10-universal-darwin lib/puppet/pops/loader/predefined_loader.rb
puppet-retrospec-1.6.1 vendor/pup410/lib/puppet/pops/loader/predefined_loader.rb
puppet-retrospec-1.6.0 vendor/pup410/lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.9 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.9-x86-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.9-x64-mingw32 lib/puppet/pops/loader/predefined_loader.rb
puppet-4.10.9-universal-darwin lib/puppet/pops/loader/predefined_loader.rb