Sha256: 664e1d363ce0d9feda8f848e6d9d8c6ff2e1e1e46b23c4bcba6fc4dcbdb14e42

Contents?: true

Size: 1.12 KB

Versions: 17

Compression:

Stored size: 1.12 KB

Contents

# frozen_string_literal: true

require_relative '../../bolt/config'

module Bolt
  class Config
    class Modulepath
      BOLTLIB_PATH = File.expand_path('../../../bolt-modules', __dir__)
      MODULES_PATH = File.expand_path('../../../modules', __dir__)

      # 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.
      attr_reader :user_modulepath

      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

      # 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
      def full_modulepath
        @boltlib_path + @user_modulepath + @builtin_content_path
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
bolt-3.29.0 lib/bolt/config/modulepath.rb
bolt-3.28.0 lib/bolt/config/modulepath.rb
bolt-3.27.4 lib/bolt/config/modulepath.rb
bolt-3.27.2 lib/bolt/config/modulepath.rb
bolt-3.27.1 lib/bolt/config/modulepath.rb
bolt-3.26.2 lib/bolt/config/modulepath.rb
bolt-3.26.1 lib/bolt/config/modulepath.rb
bolt-3.25.0 lib/bolt/config/modulepath.rb
bolt-3.24.0 lib/bolt/config/modulepath.rb
bolt-3.23.1 lib/bolt/config/modulepath.rb
bolt-3.23.0 lib/bolt/config/modulepath.rb
bolt-3.22.1 lib/bolt/config/modulepath.rb
bolt-3.22.0 lib/bolt/config/modulepath.rb
bolt-3.21.0 lib/bolt/config/modulepath.rb
bolt-3.20.0 lib/bolt/config/modulepath.rb
bolt-3.19.0 lib/bolt/config/modulepath.rb
bolt-3.18.0 lib/bolt/config/modulepath.rb