2016-07-10 21:13:06 +00:00
|
|
|
module Gitlab
|
|
|
|
module DependencyLinker
|
|
|
|
LINKERS = [
|
2017-05-12 21:01:54 +00:00
|
|
|
GemfileLinker
|
2016-07-10 21:13:06 +00:00
|
|
|
].freeze
|
|
|
|
|
|
|
|
def self.linker(blob_name)
|
|
|
|
LINKERS.find { |linker| linker.support?(blob_name) }
|
|
|
|
end
|
|
|
|
|
|
|
|
def self.link(blob_name, plain_text, highlighted_text)
|
|
|
|
linker = linker(blob_name)
|
|
|
|
return highlighted_text unless linker
|
|
|
|
|
|
|
|
linker.link(plain_text, highlighted_text)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|