summaryrefslogtreecommitdiff
path: root/lib/version_check.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/version_check.rb')
-rw-r--r--lib/version_check.rb18
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/version_check.rb b/lib/version_check.rb
new file mode 100644
index 00000000000..ea23344948c
--- /dev/null
+++ b/lib/version_check.rb
@@ -0,0 +1,18 @@
+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.png'
+ end
+end