summaryrefslogtreecommitdiff
path: root/lib/version_check.rb
blob: c9f102f6b19b99317065707c3fd00f4e9f24df31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# 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}?gitlab_info=#{encoded_data}"
  end

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