summaryrefslogtreecommitdiff
path: root/lib/version_check.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2018-12-14 11:47:49 -0600
committerRobert Speicher <rspeicher@gmail.com>2018-12-14 13:56:03 -0600
commit04a3e48c2a0e31e31f8ba0e9036597428ee3a373 (patch)
tree641d1554ce6199fe3059ea3f4200e39cec9a95e9 /lib/version_check.rb
parenteafc8e2f481751b973260287c844b70bd408dcb2 (diff)
downloadgitlab-ce-04a3e48c2a0e31e31f8ba0e9036597428ee3a373.tar.gz
Use class methods for VersionCheck
All of these methods are stateless, there was no point to have them as instance methods. Mostly this allows us to remove an `allow_any_instance_of` usage.
Diffstat (limited to 'lib/version_check.rb')
-rw-r--r--lib/version_check.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/version_check.rb b/lib/version_check.rb
index ccf7bb493db..c9f102f6b19 100644
--- a/lib/version_check.rb
+++ b/lib/version_check.rb
@@ -5,16 +5,17 @@ require "base64"
# This class is used to build image URL to
# check if it is a new version for update
class VersionCheck
- def data
+ def self.data
{ version: Gitlab::VERSION }
end
- def url
+ def self.url
encoded_data = Base64.urlsafe_encode64(data.to_json)
+
"#{host}?gitlab_info=#{encoded_data}"
end
- def host
+ def self.host
'https://version.gitlab.com/check.svg'
end
end