Sha256: 88d841e6726053e20328d3e058ab0f02fefee7f186b40b7304486d99dc7f4d78

Contents?: true

Size: 750 Bytes

Versions: 18

Compression:

Stored size: 750 Bytes

Contents

# frozen_string_literal: true

module Buildkite
  module Builder
    module Loaders
      class Templates < Abstract
        include Definition::Helper

        TEMPLATES_PATH = Pathname.new('templates').freeze

        def load
          load_from_path(global_path)
          load_from_path(pipeline_path)
        end

        private

        def load_from_path(path)
          return unless path.directory?

          path.children.sort.each do |file|
            add(file.basename('.rb'), load_definition(file, Definition::Template))
          end
        end

        def pipeline_path
          root.join(TEMPLATES_PATH)
        end

        def global_path
          buildkite_path.join(TEMPLATES_PATH)
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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