Sha256: b1854e6c92145570392f358263de4e73dee2acecdceb0a47c048f103e218f518
Contents?: true
Size: 860 Bytes
Versions: 1
Compression:
Stored size: 860 Bytes
Contents
module Buildkite module Builder class StepCollection attr_reader :steps def initialize @steps = [] end def each(*types) types = types.flatten @steps.each do |step| if step.class.to_sym == :group step.steps.each(*types) do |step| yield step end elsif types.include?(step.class.to_sym) yield step elsif types.empty? yield step end end end def find(key) @steps.find { |step| step.has?(:key) && step.key == key.to_s } end def find!(key) find(key) || raise(ArgumentError, "Can't find step with key: #{key}") end def push(step) @steps.push(step) end def to_definition @steps.map(&:to_h) end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
buildkite-builder-4.0.0 | lib/buildkite/builder/step_collection.rb |