2018-11-05 23:45:35 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-05-16 16:30:29 -04:00
|
|
|
module Gitlab
|
|
|
|
module DependencyLinker
|
|
|
|
class RequirementsTxtLinker < BaseLinker
|
|
|
|
self.file_type = :requirements_txt
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def link_dependencies
|
2017-06-23 14:07:29 -04:00
|
|
|
link_regex(/^(?<name>(?![a-z+]+:)[^#.-][^ ><=~!;\[]+)/) do |name|
|
2017-05-16 16:30:29 -04:00
|
|
|
"https://pypi.python.org/pypi/#{name}"
|
|
|
|
end
|
|
|
|
|
|
|
|
link_regex(%r{^(?<name>https?://[^ ]+)}, &:itself)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|