gitlab-org--gitlab-foss/lib/gitlab/markdown/combined_pipeline.rb

28 lines
575 B
Ruby
Raw Normal View History

2015-10-21 06:18:23 -04:00
require 'gitlab/markdown'
module Gitlab
module Markdown
module CombinedPipeline
def self.new(*pipelines)
Class.new(Pipeline) do
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
pipelines.flat_map(&:filters)
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