Module: Puppet::Pops::Loader::ModuleLoaders Private

Defined in:
lib/puppet/pops/loader/module_loaders.rb

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Defined Under Namespace

Classes: AbstractPathBasedModuleLoader, FileBased, GemBased

Class Method Summary collapse

Class Method Details

.environment_loader_from(parent_loader, loaders, env_path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



40
41
42
43
44
45
46
47
# File 'lib/puppet/pops/loader/module_loaders.rb', line 40

def self.environment_loader_from(parent_loader, loaders, env_path)
  ModuleLoaders::FileBased.new(parent_loader,
    loaders,
    ENVIRONMENT,
    File.join(env_path, 'lib'),
    ENVIRONMENT
  )
end

.module_loader_from(parent_loader, loaders, module_name, module_path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



49
50
51
52
53
54
55
56
# File 'lib/puppet/pops/loader/module_loaders.rb', line 49

def self.module_loader_from(parent_loader, loaders, module_name, module_path)
  ModuleLoaders::FileBased.new(parent_loader,
                                                     loaders,
                                                     module_name,
                                                     File.join(module_path, 'lib'),
                                                     module_name
                                                     )
end

.pcore_resource_type_loader_from(parent_loader, loaders, environment_path) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



58
59
60
61
62
63
64
65
# File 'lib/puppet/pops/loader/module_loaders.rb', line 58

def self.pcore_resource_type_loader_from(parent_loader, loaders, environment_path)
  ModuleLoaders::FileBased.new(parent_loader,
    loaders,
    nil,
    environment_path,
    'pcore_resource_types'
  )
end

.system_loader_from(parent_loader, loaders) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/puppet/pops/loader/module_loaders.rb', line 24

def self.system_loader_from(parent_loader, loaders)
  # Puppet system may be installed in a fixed location via RPM, installed as a Gem, via source etc.
  # The only way to find this across the different ways puppet can be installed is
  # to search up the path from this source file's __FILE__ location until it finds the base of
  # puppet.
  #
  puppet_lib = File.join(File.dirname(__FILE__), '../../..')
  ModuleLoaders::FileBased.new(parent_loader,
                                                     loaders,
                                                     nil,
                                                     puppet_lib,   # may or may not have a 'lib' above 'puppet'
                                                     'puppet_system',
                                                      [:func_4x]   # only load ruby functions from "puppet"
                                                     )
end