Welcome to mirror list, hosted at ThFree Co, Russian Federation.

combined_pipeline.rb « pipeline « banzai « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 56b424dc8e008a09a8123b65ade6e95ca5acede5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

module Banzai
  module Pipeline
    module CombinedPipeline
      def self.new(*pipelines)
        Class.new(BasePipeline) do
          const_set :PIPELINES, pipelines

          def self.pipelines
            self::PIPELINES
          end

          def self.filters
            FilterArray.new(pipelines.flat_map(&:filters))
          end

          def self.transform_context(context)
            pipelines.reduce(context) do |context, pipeline|
              pipeline.transform_context(context)
            end
          end
        end
      end
    end
  end
end