version_check.rb 353 Bytes
Newer Older
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
1 2 3
require "base64"

# This class is used to build image URL to
4 5 6
# check if it is a new version for update
class VersionCheck
  def data
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
7
    { version: Gitlab::VERSION }
8 9 10
  end

  def url
Dmitriy Zaporozhets's avatar
Dmitriy Zaporozhets committed
11 12
    encoded_data = Base64.urlsafe_encode64(data.to_json)
    "#{host}?gitlab_info=#{encoded_data}"
13 14 15
  end

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