Sha256: 0711f3625faf7f2cdeb9067502b3be8b8d1f21763eaaadd4fe28c1a01c11f949

Contents?: true

Size: 813 Bytes

Versions: 13

Compression:

Stored size: 813 Bytes

Contents

# frozen_string_literal: true

module Buildkite
  module Builder
    class Extension
      class << self
        attr_reader :dsl

        def dsl(&block)
          @dsl = Module.new(&block) if block_given?
          @dsl
        end
      end

      attr_reader :context
      attr_reader :options
      attr_reader :options_block

      def initialize(context, **options, &block)
        @context = context
        @options = options
        @options_block = block

        prepare
      end

      def build
        # Override to provide extra functionality.
      end

      private

      def log
        context.logger
      end

      def prepare
        # Override to provide extra functionality.
      end

      def pipeline(&block)
        context.dsl.instance_eval(&block)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
buildkite-builder-4.6.0 lib/buildkite/builder/extension.rb
buildkite-builder-4.5.0 lib/buildkite/builder/extension.rb
buildkite-builder-4.4.0 lib/buildkite/builder/extension.rb
buildkite-builder-4.3.0 lib/buildkite/builder/extension.rb
buildkite-builder-4.2.5 lib/buildkite/builder/extension.rb
buildkite-builder-4.2.4 lib/buildkite/builder/extension.rb
buildkite-builder-4.2.3 lib/buildkite/builder/extension.rb
buildkite-builder-4.2.2 lib/buildkite/builder/extension.rb
buildkite-builder-4.2.1 lib/buildkite/builder/extension.rb
buildkite-builder-4.2.0 lib/buildkite/builder/extension.rb
buildkite-builder-4.1.2 lib/buildkite/builder/extension.rb
buildkite-builder-4.1.1 lib/buildkite/builder/extension.rb
buildkite-builder-4.1.0 lib/buildkite/builder/extension.rb