Class: Bolt::Config::Modulepath

Inherits:
Object
  • Object
show all
Defined in:
lib/bolt/config/modulepath.rb

Constant Summary collapse

BOLTLIB_PATH =
File.expand_path('../../../bolt-modules', __dir__)
MODULES_PATH =
File.expand_path('../../../modules', __dir__)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user_modulepath, boltlib_path: BOLTLIB_PATH, builtin_content_path: MODULES_PATH) ⇒ Modulepath

Returns a new instance of Modulepath.


16
17
18
19
20
# File 'lib/bolt/config/modulepath.rb', line 16

def initialize(user_modulepath, boltlib_path: BOLTLIB_PATH, builtin_content_path: MODULES_PATH)
  @user_modulepath = Array(user_modulepath).flatten
  @boltlib_path = Array(boltlib_path).flatten
  @builtin_content_path = Array(builtin_content_path).flatten
end

Instance Attribute Details

#user_modulepathObject (readonly)

The user_modulepath only includes the original modulepath and is used during pluginsync. We don't want to pluginsync any of the content from BOLT_MODULES since that content includes core modules that can conflict with modules installed with an agent.


14
15
16
# File 'lib/bolt/config/modulepath.rb', line 14

def user_modulepath
  @user_modulepath
end

Instance Method Details

#full_modulepathObject

The full_modulepath includes both the BOLTLIB path and the MODULES_PATH to ensure bolt functions and built-in content are available in the compliler


25
26
27
# File 'lib/bolt/config/modulepath.rb', line 25

def full_modulepath
  @boltlib_path + @user_modulepath + @builtin_content_path
end