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-4.1.1 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.1.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.0.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.9.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.8.3 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.8.2 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.8.1 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.8.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.7.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.6.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.5.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.4.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.3.2 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.3.1 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.3.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.2.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.1.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-3.0.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.4.1 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-2.4.0 lib/buildkite/builder/loaders/extensions.rb