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

source.rb « gitlab « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0e9fb39156d537d324d6b5523766b0b2a53d2006 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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

        Gitlab::Utils.append_path(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