2018-12-13 13:39:08 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
require "base64"
|
|
|
|
|
|
|
|
# This class is used to build image URL to
|
|
|
|
# check if it is a new version for update
|
|
|
|
class VersionCheck
|
2019-02-15 15:39:39 +05:30
|
|
|
def self.data
|
2015-09-11 14:41:01 +05:30
|
|
|
{ version: Gitlab::VERSION }
|
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
def self.url
|
2015-09-11 14:41:01 +05:30
|
|
|
encoded_data = Base64.urlsafe_encode64(data.to_json)
|
2019-02-15 15:39:39 +05:30
|
|
|
|
2015-09-11 14:41:01 +05:30
|
|
|
"#{host}?gitlab_info=#{encoded_data}"
|
|
|
|
end
|
|
|
|
|
2019-02-15 15:39:39 +05:30
|
|
|
def self.host
|
2016-01-14 18:37:52 +05:30
|
|
|
'https://version.gitlab.com/check.svg'
|
2015-09-11 14:41:01 +05:30
|
|
|
end
|
|
|
|
end
|