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