2018-10-06 23:10:08 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2015-05-08 12:14:56 +00:00
|
|
|
require "base64"
|
|
|
|
|
|
|
|
# This class is used to build image URL to
|
2015-02-13 04:31:55 +00:00
|
|
|
# check if it is a new version for update
|
|
|
|
class VersionCheck
|
2018-12-14 17:47:49 +00:00
|
|
|
def self.data
|
2015-05-08 12:14:56 +00:00
|
|
|
{ version: Gitlab::VERSION }
|
2015-02-13 04:31:55 +00:00
|
|
|
end
|
|
|
|
|
2018-12-14 17:47:49 +00:00
|
|
|
def self.url
|
2015-05-08 12:14:56 +00:00
|
|
|
encoded_data = Base64.urlsafe_encode64(data.to_json)
|
2018-12-14 17:47:49 +00:00
|
|
|
|
2015-05-08 12:14:56 +00:00
|
|
|
"#{host}?gitlab_info=#{encoded_data}"
|
2015-02-13 04:31:55 +00:00
|
|
|
end
|
|
|
|
|
2018-12-14 17:47:49 +00:00
|
|
|
def self.host
|
2015-12-30 01:23:07 +00:00
|
|
|
'https://version.gitlab.com/check.svg'
|
2015-02-13 04:31:55 +00:00
|
|
|
end
|
|
|
|
end
|