gitlab-org--gitlab-foss/lib/banzai/pipeline/combined_pipeline.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
600 B
Ruby
Raw Normal View History

# frozen_string_literal: true
module Banzai
module Pipeline
2015-10-21 10:18:23 +00:00
module CombinedPipeline
def self.new(*pipelines)
Class.new(BasePipeline) do
2015-10-21 10:18:23 +00:00
const_set :PIPELINES, pipelines
2015-12-08 11:29:48 +00:00
def self.pipelines
self::PIPELINES
end
2015-10-21 10:18:23 +00:00
def self.filters
2016-03-01 20:54:35 +00:00
FilterArray.new(pipelines.flat_map(&:filters))
2015-10-21 10:18:23 +00:00
end
def self.transform_context(context)
2015-12-08 11:29:48 +00:00
pipelines.reduce(context) do |context, pipeline|
pipeline.transform_context(context)
end
2015-10-21 10:18:23 +00:00
end
end
end
end
end
end