Sha256: 9eb08f4c35d500dd0884021d54e4246e16fd048338baf636bd626ef5e8e334ea

Contents?: true

Size: 838 Bytes

Versions: 48

Compression:

Stored size: 838 Bytes

Contents

# frozen_string_literal: true

require 'pathname'

module Buildkite
  module Builder
    module Loaders
      class Extensions < Abstract
        EXTENSIONS_PATH = Pathname.new('extensions').freeze

        def load
          load_extensions_from_path(global_extensions_path)
          load_extensions_from_path(pipeline_extensions_path)
        end

        private

        def load_extensions_from_path(path)
          return unless path.directory?

          path.children.map do |file|
            required_status = require(file.to_s)
            add(file.basename, { required: required_status })
          end
        end

        def global_extensions_path
          buildkite_path.join(EXTENSIONS_PATH)
        end

        def pipeline_extensions_path
          root.join(EXTENSIONS_PATH)
        end
      end
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
buildkite-builder-2.3.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.2.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.1.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.0.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.0.0.beta4 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.0.0.beta3 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.0.0.beta2 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.0.0.beta1 lib/buildkite/builder/loaders/extensions.rb