summaryrefslogtreecommitdiff
path: root/lib/version_check.rb
blob: 91ad07feee544ea4135f870e63b7847bb696ce2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
require "base64"

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

  def url
    encoded_data = Base64.urlsafe_encode64(data.to_json)
    "#{host}?gitlab_info=#{encoded_data}"
  end

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