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

26 lines
569 B
Ruby
Raw Normal View History

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