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

26 lines
546 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
def self.filters
pipelines.flat_map(&:filters)
end
def self.transform_context(context)
pipelines.reduce(context) { |context, pipeline| pipeline.transform_context(context) }
end
def self.pipelines
self::PIPELINES
end
end
end
end
end
end