class Puppet::Pops::Loader::ModuleLoaders::GemBased

Loads from a gem specified as a URI, gem://gemname/optional/path/in/gem, or just a String gemname. The source reference (shown in errors etc.) is the expanded path of the gem as this is believed to be more helpful - given the location it should be quite obvious which gem it is, without the location, the user would need to go on a hunt for where the file actually is located.

TODO: How does this get instantiated? Does the gemname refelect the name of the module (the namespace)

or is that specified a different way? Can a gem be the container of multiple modules?

@api private

Attributes

gem_ref[R]

Public Class Methods

new(parent_loader, loaders, module_name, gem_ref, loader_name, loadables = LOADABLE_KINDS) click to toggle source

Create a kind of ModuleLoader for one module The parameters are:

  • parent_loader - typically the loader for the root

  • module_name - the name of the module (non qualified name)

  • gem_ref - [URI, String] gem reference to the root of the module (URI, gem://gemname/optional/path/in/gem), or

    just the gem's name as a String.
    # File lib/puppet/pops/loader/module_loaders.rb
545 def initialize(parent_loader, loaders, module_name, gem_ref, loader_name, loadables = LOADABLE_KINDS)
546   @gem_ref = gem_ref
547   super parent_loader, loaders, module_name, gem_dir(gem_ref), loader_name, loadables
548 end

Public Instance Methods

to_s() click to toggle source
    # File lib/puppet/pops/loader/module_loaders.rb
550 def to_s()
551   "(ModuleLoader::GemBased '#{loader_name}' '#{@gem_ref}' [#{module_name}])"
552 end