Class: Bolt::Config::Modulepath
- Inherits:
-
Object
- Object
- Bolt::Config::Modulepath
- Defined in:
- lib/bolt/config/modulepath.rb
Constant Summary collapse
- BOLTLIB_PATH =
File.('../../../bolt-modules', __dir__)
- MODULES_PATH =
File.('../../../modules', __dir__)
Instance Attribute Summary collapse
-
#user_modulepath ⇒ Object
readonly
The user_modulepath only includes the original modulepath and is used during pluginsync.
Instance Method Summary collapse
-
#full_modulepath ⇒ Object
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.
-
#initialize(user_modulepath, boltlib_path: BOLTLIB_PATH, builtin_content_path: MODULES_PATH) ⇒ Modulepath
constructor
A new instance of Modulepath.
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_modulepath ⇒ Object (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_modulepath ⇒ Object
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 |