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

version_check.rb « lib - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a8b7c7371ca02eec03ad2e74eb66b47ebee7f2ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# frozen_string_literal: true

require "base64"

# This class is used to build image URL to
# check if it is a new version for update
class VersionCheck
  def self.data
    { version: Gitlab::VERSION }
  end

  def self.url
    encoded_data = Base64.urlsafe_encode64(data.to_json)

    "#{host}/check.svg?gitlab_info=#{encoded_data}"
  end

  def self.host
    'https://version.gitlab.com'
  end
end

VersionCheck.prepend_mod