gitlab-releases 1.0.1 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/README.md +6 -3
- data/lib/gitlab_releases/release_versions.rb +13 -0
- data/lib/gitlab_releases/version.rb +1 -1
- data/lib/gitlab_releases.rb +4 -0
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1f9a73b90b46892ca18e3a95eba76136dd3d1f55e8c0eec56a39068076b1e4b3
|
4
|
+
data.tar.gz: d82099b7bf7cd5d0761e8c5b538df4628d8e754127858a8e18d03d94fb03dbcc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aefa80ca4044fee1975419c938eb174c326c0bbfd7b662c89af5f2d6695ad4affb94391fba49e74f90d375e68d26bb6878425e133b2837258f09d88ce09472a3
|
7
|
+
data.tar.gz: 8d13eaea034f5682daba9d8de01ca5d42bcdd921fdc93ca64b23b9037bb3c41fae759aaf7da3be4c7f58283c8657bf603fca34b066f0f5b70d12b3a589b77978
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Library to interact with GitLab releases and versions. The information is fetche
|
|
12
12
|
Gemfile:
|
13
13
|
|
14
14
|
```
|
15
|
-
gem 'gitlab-releases', '~> 1.0
|
15
|
+
gem 'gitlab-releases', '~> 1.1.0'
|
16
16
|
```
|
17
17
|
|
18
18
|
Install:
|
@@ -35,11 +35,12 @@ There are different methods available:
|
|
35
35
|
* `active_version` - Returns the active GitLab version.
|
36
36
|
* `current_version` - Returns the current GitLab minor version.
|
37
37
|
* `next_versions` - Returns the next GitLab patch versions (for patch and security releases).
|
38
|
-
* `previous_version` - Returns the
|
38
|
+
* `previous_version` - Returns the latest patch of the previous minor version.
|
39
39
|
* `version_for_date` - Returns the active GitLab version for the given date
|
40
40
|
* `current_minor_for_date` - Returns the current GitLab minor for the given date
|
41
41
|
* `previous_minors` - Returns the previous minors for the given version
|
42
42
|
* `next_patch_release_date` - Calculates the next best effort date for a GitLab patch release.
|
43
|
+
* `latest_patch_for_version` - Returns the latest patch for the given minor version
|
43
44
|
|
44
45
|
To make use of it:
|
45
46
|
|
@@ -83,6 +84,8 @@ To make use of it:
|
|
83
84
|
=> ["16.6", "16.5", "16.4"]
|
84
85
|
> GitlabReleases.next_patch_release_date
|
85
86
|
=> "2024-03-13"
|
87
|
+
> GitlabReleases.latest_patch_for_version('16.6')
|
88
|
+
=> "16.6.10"
|
86
89
|
|
87
90
|
```
|
88
91
|
|
@@ -103,4 +106,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
|
|
103
106
|
Everyone interacting in the Releases project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/gitlab-org/ruby/gems/gitlab-releases/-/blob/main/CODE_OF_CONDUCT.md).
|
104
107
|
|
105
108
|
[Delivery team tracker]: https://gitlab.com/gitlab-com/gl-infra/delivery
|
106
|
-
[Releases documentation]: https://gitlab.com/gitlab-org/ruby/gems/gitlab-releases/-/blob/
|
109
|
+
[Releases documentation]: https://gitlab.com/gitlab-org/ruby/gems/gitlab-releases/-/blob/main/docs/releases.md
|
@@ -155,6 +155,19 @@ class ReleaseVersions
|
|
155
155
|
next_versions.second.previous_patch
|
156
156
|
end
|
157
157
|
|
158
|
+
# Returns the latest patch for a given minor version
|
159
|
+
#
|
160
|
+
# For example:
|
161
|
+
# - If the given version is 16.7 and available versions include 16.7.0, 16.7.1, 16.7.2
|
162
|
+
# it will return 16.7.2
|
163
|
+
# - If the given version is 16.5 and available versions include 16.5.0, 16.5.1
|
164
|
+
# it will return 16.5.1
|
165
|
+
def self.latest_patch_for_version(version)
|
166
|
+
minor_version = ReleaseVersion.new(version).to_minor
|
167
|
+
|
168
|
+
available_versions.find { |v| v.start_with?("#{minor_version}.") }
|
169
|
+
end
|
170
|
+
|
158
171
|
def self.sort(versions)
|
159
172
|
::VersionSorter.sort(versions).uniq
|
160
173
|
end
|
data/lib/gitlab_releases.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gitlab-releases
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Mayra Cabrera
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-03-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -86,7 +86,7 @@ dependencies:
|
|
86
86
|
- - "~>"
|
87
87
|
- !ruby/object:Gem::Version
|
88
88
|
version: 2.3.0
|
89
|
-
description:
|
89
|
+
description:
|
90
90
|
email:
|
91
91
|
- mcabrera@gitlab.com
|
92
92
|
executables: []
|
@@ -121,7 +121,7 @@ metadata:
|
|
121
121
|
homepage_uri: https://gitlab.com/gitlab-org/ruby/gems/gitlab-releases
|
122
122
|
source_code_uri: https://gitlab.com/gitlab-org/ruby/gems/gitlab-releases
|
123
123
|
changelog_uri: https://gitlab.com/gitlab-org/ruby/gems/gitlab-releases/-/blob/main/CHANGELOG.md
|
124
|
-
post_install_message:
|
124
|
+
post_install_message:
|
125
125
|
rdoc_options: []
|
126
126
|
require_paths:
|
127
127
|
- lib
|
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
137
137
|
version: '0'
|
138
138
|
requirements: []
|
139
139
|
rubygems_version: 3.5.9
|
140
|
-
signing_key:
|
140
|
+
signing_key:
|
141
141
|
specification_version: 4
|
142
142
|
summary: Utilities for GitLab releases and versions
|
143
143
|
test_files: []
|