Sha256: 9eb08f4c35d500dd0884021d54e4246e16fd048338baf636bd626ef5e8e334ea

Contents?: true

Size: 838 Bytes

Versions: 47

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

47 entries across 47 versions & 1 rubygems

Version Path
buildkite-builder-4.15.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.14.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.13.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.12.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.11.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.10.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.8.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.7.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.6.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.5.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.4.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.3.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.2.5 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.2.4 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.2.3 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.2.2 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.2.1 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.2.0 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.1.2 lib/buildkite/builder/loaders/extensions.rb
buildkite-builder-4.1.1 lib/buildkite/builder/loaders/extensions.rb