debian-mirror-gitlab/lib/gitlab/dependency_linker/requirements_txt_linker.rb
2018-12-23 12:14:25 +05:30

19 lines
424 B
Ruby

# frozen_string_literal: true
module Gitlab
module DependencyLinker
class RequirementsTxtLinker < BaseLinker
self.file_type = :requirements_txt
private
def link_dependencies
link_regex(/^(?<name>(?![a-z+]+:)[^#.-][^ ><=~!;\[]+)/) do |name|
"https://pypi.python.org/pypi/#{name}"
end
link_regex(%r{^(?<name>https?://[^ ]+)}, &:itself)
end
end
end
end