summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2023-04-27 21:09:08 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2023-04-27 21:09:08 +0000
commite49c47d3bc5603e8e9d6ad40fc7fccae9f885843 (patch)
treec01f9e16d6bfc242c0b36b8b8b70d4d31a9c0af0 /lib
parentfbcf5b688d3133065705b24b73330f9b9bf19181 (diff)
downloadgitlab-ce-e49c47d3bc5603e8e9d6ad40fc7fccae9f885843.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib')
-rw-r--r--lib/gitlab/source.rb43
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/gitlab/source.rb b/lib/gitlab/source.rb
new file mode 100644
index 00000000000..feacf28cf9c
--- /dev/null
+++ b/lib/gitlab/source.rb
@@ -0,0 +1,43 @@
+# frozen_string_literal: true
+
+module Gitlab
+ class Source # rubocop:disable Gitlab/NamespacedClass
+ class << self
+ def ref
+ return Gitlab.revision if Gitlab.pre_release?
+
+ "v#{Gitlab::VERSION}"
+ end
+
+ def release_url
+ path = if Gitlab.pre_release?
+ url_helpers.namespace_project_commits_path(group, project, ref)
+ else
+ url_helpers.namespace_project_tag_path(group, project, ref)
+ end
+
+ host_url + path
+ end
+
+ private
+
+ def host_url
+ Gitlab::Saas.com_url
+ end
+
+ def group
+ 'gitlab-org'
+ end
+
+ def project
+ 'gitlab-foss'
+ end
+
+ def url_helpers
+ Rails.application.routes.url_helpers
+ end
+ end
+ end
+end
+
+Gitlab::Source.prepend_mod