Sha256: 66c3c8a9ae08c0483ce94c12e4a154b0f201cf5063b61021d13cde52db4839e3

Contents?: true

Size: 968 Bytes

Versions: 22

Compression:

Stored size: 968 Bytes

Contents

module Buildkite
  module Builder
    class Group
      include Buildkite::Pipelines::Attributes

      attr_reader :label
      attr_reader :data

      attribute :depends_on, append: true
      attribute :key

      def self.to_sym
        name.split('::').last.downcase.to_sym
      end

      def initialize(label, steps, &block)
        @label = label
        @data = Data.new
        @data.steps = StepCollection.new(
          steps.templates,
          steps.plugins
        )
        @data.notify = []

        @dsl = Dsl.new(self)
        @dsl.extend(Extensions::Steps)
        @dsl.extend(Extensions::Notify)
        instance_eval(&block) if block_given?
        self
      end

      def to_h
        attributes = super
        { group: label }.merge(attributes).merge(data.to_definition)
      end

      def method_missing(method_name, *args, **kwargs, &_block)
        @dsl.public_send(method_name, *args, **kwargs, &_block)
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
buildkite-builder-3.8.2 lib/buildkite/builder/group.rb
buildkite-builder-3.8.1 lib/buildkite/builder/group.rb
buildkite-builder-3.8.0 lib/buildkite/builder/group.rb
buildkite-builder-3.7.0 lib/buildkite/builder/group.rb
buildkite-builder-3.6.0 lib/buildkite/builder/group.rb
buildkite-builder-3.5.0 lib/buildkite/builder/group.rb
buildkite-builder-3.4.0 lib/buildkite/builder/group.rb
buildkite-builder-3.3.2 lib/buildkite/builder/group.rb
buildkite-builder-3.3.1 lib/buildkite/builder/group.rb
buildkite-builder-3.3.0 lib/buildkite/builder/group.rb
buildkite-builder-3.2.0 lib/buildkite/builder/group.rb
buildkite-builder-3.1.0 lib/buildkite/builder/group.rb
buildkite-builder-3.0.0 lib/buildkite/builder/group.rb
buildkite-builder-2.4.1 lib/buildkite/builder/group.rb
buildkite-builder-2.4.0 lib/buildkite/builder/group.rb
buildkite-builder-2.3.0 lib/buildkite/builder/group.rb
buildkite-builder-2.2.0 lib/buildkite/builder/group.rb
buildkite-builder-2.1.0 lib/buildkite/builder/group.rb
buildkite-builder-2.0.0 lib/buildkite/builder/group.rb
buildkite-builder-2.0.0.beta4 lib/buildkite/builder/group.rb