diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-22 18:09:48 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-06-22 18:09:48 +0300 |
commit | 640007842a876dfa551578feccfd0fe2307c522a (patch) | |
tree | 4204c45a13b9beac3040df00572ffe0ecdb0ca40 /lib/gitlab/version_info.rb | |
parent | 421f6c92d5984d035a7a6687d70277ba88f5f92b (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/version_info.rb')
-rw-r--r-- | lib/gitlab/version_info.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/gitlab/version_info.rb b/lib/gitlab/version_info.rb index aa6d5310161..88a5b735d8c 100644 --- a/lib/gitlab/version_info.rb +++ b/lib/gitlab/version_info.rb @@ -52,5 +52,21 @@ module Gitlab def valid? @major >= 0 && @minor >= 0 && @patch >= 0 && @major + @minor + @patch > 0 end + + def hash + [self.class, to_s].hash + end + + def eql?(other) + (self <=> other) == 0 + end + + def same_minor_version?(other) + @major == other.major && @minor == other.minor + end + + def without_patch + self.class.new(@major, @minor, 0) + end end end |