debian-mirror-gitlab/lib/version_check.rb

21 lines
384 B
Ruby
Raw Normal View History

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
def data
{ version: Gitlab::VERSION }
end
def url
encoded_data = Base64.urlsafe_encode64(data.to_json)
"#{host}?gitlab_info=#{encoded_data}"
end
def host
'https://version.gitlab.com/check.svg'
2015-09-11 14:41:01 +05:30
end
end