BigW Consortium Gitlab

version_check.rb 353 Bytes
Newer Older
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
7
    { version: Gitlab::VERSION }
8 9 10
  end

  def url
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.png'
17 18
  end
end