Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2017-05-16 23:29:56 +0300
committerDouwe Maan <douwe@selenight.nl>2017-05-23 23:35:51 +0300
commite780259a650ea476be0617c435798b85a252605a (patch)
tree5f76889a54580dc2a02e8c817c2ed499c5806ce7 /lib/gitlab/dependency_linker
parentc35463d5f856c2f8025893f2e185825dfb691f8e (diff)
Autolink package names in Cartfile
Diffstat (limited to 'lib/gitlab/dependency_linker')
-rw-r--r--lib/gitlab/dependency_linker/cartfile_linker.rb20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/gitlab/dependency_linker/cartfile_linker.rb b/lib/gitlab/dependency_linker/cartfile_linker.rb
new file mode 100644
index 00000000000..f65577588f8
--- /dev/null
+++ b/lib/gitlab/dependency_linker/cartfile_linker.rb
@@ -0,0 +1,20 @@
+module Gitlab
+ module DependencyLinker
+ class CartfileLinker < MethodLinker
+ self.file_type = :cartfile
+
+ private
+
+ def link_dependencies
+ link_method_call(%w[github git binary]) do |value|
+ case value
+ when %r{\A#{REPO_REGEX}\z}
+ github_url(value)
+ when /\A#{URL_REGEX}\z/
+ value
+ end
+ end
+ end
+ end
+ end
+end