diff options
author | Brandon Labuschagne <blabuschagne@gitlab.com> | 2019-01-11 12:02:55 +0200 |
---|---|---|
committer | Brandon Labuschagne <blabuschagne@gitlab.com> | 2019-01-11 12:02:55 +0200 |
commit | 342b1029d483e140745be4ecacedf17aa3d04d77 (patch) | |
tree | d12fdf5e99093ba1103190236f56e26b9de28c6f | |
parent | 14fb1493c52f8819d255e6ffc5752dee50b9a592 (diff) | |
download | gitlab-ce-25341-add-what-s-new-menu-item-in-top-navigation.tar.gz |
Minor refactoring25341-add-what-s-new-menu-item-in-top-navigation
-rw-r--r-- | lib/gitlab.rb | 4 | ||||
-rw-r--r-- | lib/gitlab/release_blog_post.rb | 1 | ||||
-rw-r--r-- | spec/lib/gitlab_spec.rb | 4 |
3 files changed, 5 insertions, 4 deletions
diff --git a/lib/gitlab.rb b/lib/gitlab.rb index 351c4c4e2f7..5c9f501e45d 100644 --- a/lib/gitlab.rb +++ b/lib/gitlab.rb @@ -46,7 +46,7 @@ module Gitlab end def self.minor_release - version_info.major.to_s + '.' + version_info.minor.to_s + "#{version_info.major}.#{version_info.minor}" end def self.previous_release @@ -57,7 +57,7 @@ module Gitlab "#{version_info.major}.#{version_info.minor - 1}" end else - (version_info.major.to_i - 1).to_s + "#{version_info.major.to_i - 1}" end end diff --git a/lib/gitlab/release_blog_post.rb b/lib/gitlab/release_blog_post.rb index c6146323677..8b51b700401 100644 --- a/lib/gitlab/release_blog_post.rb +++ b/lib/gitlab/release_blog_post.rb @@ -21,6 +21,7 @@ module Gitlab response['feed']['entry'].each do |entry| return entry['id'] if entry['release'] == installed_version || matches_previous_release_post(entry['release'], installed_version) end + nil end end diff --git a/spec/lib/gitlab_spec.rb b/spec/lib/gitlab_spec.rb index 14bbc7e8f43..6ac3d115bc6 100644 --- a/spec/lib/gitlab_spec.rb +++ b/spec/lib/gitlab_spec.rb @@ -114,13 +114,13 @@ describe Gitlab do expect(subject).to eql '10' end - it 'returns the current minor version when the GitLab patch version is not final, but above zero' do + it 'returns the current minor version when the GitLab patch version is RC and > 0' do stub_const('Gitlab::VERSION', '11.2.1-rc3') expect(subject).to eql '11.2' end - it 'returns the previous minor version when the GitLab patch version is not final and is zero' do + it 'returns the previous minor version when the GitLab patch version is RC and 0' do stub_const('Gitlab::VERSION', '11.2.0-rc3') expect(subject).to eql '11.1' |