Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2018-12-14 20:47:49 +0300
committerRobert Speicher <rspeicher@gmail.com>2018-12-14 22:56:03 +0300
commit04a3e48c2a0e31e31f8ba0e9036597428ee3a373 (patch)
tree641d1554ce6199fe3059ea3f4200e39cec9a95e9 /lib
parenteafc8e2f481751b973260287c844b70bd408dcb2 (diff)
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')
-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