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

Constant Summary collapse

ENVIRONMENT =

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

'environment'.freeze

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.



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

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.



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

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.



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

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.



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

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