releases 0.1.1 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 40847d20ecf623f40ac43ae4516a987dfef492623cae863d4d3869da565ae024
4
- data.tar.gz: 0124b51e8f546abd13421a3449738355d2133e94c8e6108c610a3b72b91eb519
3
+ metadata.gz: b3045a4bf992cb95e413e0d9b966d25180124bf8213142aa80271537cfabe72d
4
+ data.tar.gz: c16860e87255020ba3399374572afc1739f151ac9a5a2871ae4061e7f336c7d4
5
5
  SHA512:
6
- metadata.gz: 571b2bc56190f62c43f5aa9eb4580fbc6190d6618f5efd62cb7be4854664901fdc604fea2d0726c8df06ed11840f03b46a1d110794852ff0129b22f77940f3c5
7
- data.tar.gz: 9558687db01e04b2da6879b0d350a7e1e087bed31108bf100fb1593a9ebbb109455c8473433508ebe27041fc84405718a8b9e09fe3d18d3b9621ac543f12dbf7
6
+ metadata.gz: ea7d01bef315ddb956caf4e991a2483f62df91e26d08d20c7f1bf01762eaa68b6089a66d6fa4b258da4d2b1d42507d4c9355791314119eb052e3051e7a4be335
7
+ data.tar.gz: d54108a88c9c1a2a6a0512704a7a7e7e8a4dc5b73ef726e41185834a20b08bd46f800e97b0c1c4d4a175709039b5428e6222b5e8ebcfe071230d1835f18a2f59
data/CHANGELOG.md CHANGED
@@ -2,4 +2,16 @@
2
2
 
3
3
  ## [0.1.0] - 2023-08-01
4
4
 
5
- - Initial release
5
+ - Initial release. Starting with 16.6, GitLab monthly release date will be moved from the 22nd to the 3rd Thursday of each month, this gem automatically calculates the release dates and the associated version for 12 months in advance.
6
+
7
+ ## [0.1.1] - 2023-08-21
8
+
9
+ - Gem renamed to `releases` to account for new utility methods included (`active_version`, `current_version`, `next_versions`)
10
+
11
+ ## [0.1.2] - 2023-08-22
12
+
13
+ - Yanked version
14
+
15
+ ## [0.1.3] - 2023-08-22
16
+
17
+ - `version_for_date` and `previous_version` methods included.
data/Gemfile CHANGED
@@ -17,6 +17,7 @@ group :development, :test do
17
17
  gem 'rspec', '~> 3.0'
18
18
  gem 'rspec-parameterized', '>= 1.0.0'
19
19
  gem 'rubocop', '~> 1.21'
20
+ gem 'timecop', '~> 0.9.0'
20
21
  gem 'vcr', '~> 6.2.0'
21
22
  gem 'webmock', '~> 3.18.0'
22
23
  end
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- releases (0.2.0)
4
+ releases (0.1.1)
5
5
  activesupport (~> 7.0.0)
6
6
  gitlab (~> 4.19.0)
7
7
  http (~> 5.1.0)
@@ -117,6 +117,7 @@ GEM
117
117
  ruby-progressbar (1.13.0)
118
118
  terminal-table (3.0.2)
119
119
  unicode-display_width (>= 1.1.1, < 3)
120
+ timecop (0.9.8)
120
121
  tzinfo (2.0.6)
121
122
  concurrent-ruby (~> 1.0)
122
123
  unf (0.1.4)
@@ -147,6 +148,7 @@ DEPENDENCIES
147
148
  rspec (~> 3.0)
148
149
  rspec-parameterized (>= 1.0.0)
149
150
  rubocop (~> 1.21)
151
+ timecop (~> 0.9.0)
150
152
  vcr (~> 6.2.0)
151
153
  version_sorter (~> 2.3.0)
152
154
  webmock (~> 3.18.0)
data/README.md CHANGED
@@ -1,25 +1,37 @@
1
- [![Gem Version](https://badge.fury.io/rb/release_dates.svg)](https://badge.fury.io/rb/release_dates)
1
+ [![Gem Version](https://badge.fury.io/rb/releases.svg)](https://badge.fury.io/rb/releases)
2
2
 
3
- # Release Dates
3
+ # Releases
4
4
 
5
- Library to calculate the relative dates for the releases. Starting with 16.6, GitLab monthly release date will be moved from the 22nd to the 3rd Thursday of each month, this gem automatically calculates the release dates and the associated version for 12 months in advance.
5
+ Library to interact with GitLab releases and versions. The information is fetched from two sources:
6
+
7
+ 1. [versions.gitlab.com](https://version.gitlab.com/)
8
+ 1. [`releases.yml`](https://gitlab.com/gitlab-com/www-gitlab-com/-/blob/master/data/releases.yml)
6
9
 
7
10
  ## Installation
8
11
 
9
12
  ```
10
- $ gem install release_dates
13
+ $ gem install releases
11
14
  ```
12
15
 
13
16
  ## Usage
14
17
 
18
+ There are different methods available:
19
+
20
+ * `upcoming_releases` - Returns the GitLab release date and the associated version for the next 12 months.
21
+ * `active_version` - Returns the active GitLab version.
22
+ * `current_version` - Returns the current GitLab version.
23
+ * `next_versions` - Returns the next GitLab patch versions (for patch and security releases).
24
+
25
+ To make use of it:
26
+
15
27
  1. Create a personal access token with `read_api` scope.
16
28
  1. Store it under `PRODUCTION_TOKEN`
17
29
  1. Open up an irb session:
18
30
 
19
31
  ```ruby
20
- $ require 'release_dates'
21
-
22
- $ ReleaseDates.execute
32
+ > require 'releases'
33
+ > releases = Releases
34
+ > releases.upcoming_releases
23
35
  =>
24
36
  {"16.2"=>"2023-07-22",
25
37
  "16.3"=>"2023-08-22",
@@ -34,11 +46,18 @@ $ ReleaseDates.execute
34
46
  "17.0"=>"2024-05-16",
35
47
  "17.1"=>"2024-06-20",
36
48
  "17.2"=>"2024-07-18"}
49
+
50
+ > releases.active_version
51
+ => "16.3"
52
+ > releases.current_version
53
+ => "16.2"
54
+ > releases.next_versions
55
+ => ["16.2.5", "16.1.5", "16.0.9"]
37
56
  ```
38
57
 
39
58
  ## Contributing
40
59
 
41
- Bug reports and pull requests are welcome on GitLub at https://gitlab.com/gitlab-org/delivery/release_dates. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/gitlab-org/delivery/release_dates/blob/main/CODE_OF_CONDUCT.md).
60
+ Bug reports and pull requests are welcome on GitLab at https://gitlab.com/gitlab-org/delivery/releases. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://gitlab.com/gitlab-org/delivery/releases/blob/main/CODE_OF_CONDUCT.md).
42
61
 
43
62
  ## License
44
63
 
@@ -46,4 +65,4 @@ The gem is available as open source under the terms of the [MIT License](https:/
46
65
 
47
66
  ## Code of Conduct
48
67
 
49
- Everyone interacting in the ReleaseDates project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://gitlab.com/gitlab-org/delivery/release_dates/main/CODE_OF_CONDUCT.md).
68
+ 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/delivery/releases/main/CODE_OF_CONDUCT.md).
@@ -54,7 +54,7 @@ class ReleaseVersions
54
54
  end.take(count)
55
55
  end
56
56
 
57
- # Returns the current GitLab version
57
+ # Returns the current GitLab minor version
58
58
  def self.current_version
59
59
  ReleaseVersion.new(next_versions.first.to_minor)
60
60
  end
@@ -68,7 +68,7 @@ class ReleaseVersions
68
68
  Date.parse(date)
69
69
  end
70
70
 
71
- # Returns the active version of GitLab
71
+ # Returns the active minor GitLab Version
72
72
  def self.active_version
73
73
  version_for_date(DateTime.now)
74
74
  end
@@ -99,6 +99,21 @@ class ReleaseVersions
99
99
  ReleaseVersion.new(row['version'])
100
100
  end
101
101
 
102
+ # Returns the N-1 version supported based on the current_list
103
+ #
104
+ # For example:
105
+ # => current_list
106
+ # => ["16.3.0", "16.2.4", "16.1.4", "16.2.3"]
107
+ # => previous_version
108
+ # => ['16.2.4']
109
+ def self.previous_version
110
+ ReleaseVersion.new(sort(current_list).reverse[1])
111
+ end
112
+
113
+ def self.sort(versions)
114
+ ::VersionSorter.sort(versions).uniq
115
+ end
116
+
102
117
  def self.raw_versions
103
118
  ReleaseVersionClient.versions
104
119
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Releases
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.3"
5
5
  end
data/lib/releases.rb CHANGED
@@ -21,10 +21,18 @@ module Releases
21
21
  ReleaseVersions.active_version
22
22
  end
23
23
 
24
+ def self.version_for_date(date)
25
+ ReleaseVersions.version_for_date(date)
26
+ end
27
+
24
28
  def self.next_versions
25
29
  ReleaseVersions.next_versions
26
30
  end
27
31
 
32
+ def self.previous_version
33
+ ReleaseVersions.previous_version
34
+ end
35
+
28
36
  def self.release_date
29
37
  ReleaseVersions.previous_release_date
30
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: releases
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mayra Cabrera
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-08-21 00:00:00.000000000 Z
11
+ date: 2023-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -110,8 +110,8 @@ licenses:
110
110
  - MIT
111
111
  metadata:
112
112
  homepage_uri: https://gitlab.com/gitlab-org/delivery/releases
113
- source_code_uri: https://gitlab.com/groups/gitlab-org/delivery/releases
114
- changelog_uri: https://gitlab.com/groups/gitlab-org/delivery/releases/CHANGELOG.md
113
+ source_code_uri: https://gitlab.com/gitlab-org/delivery/releases
114
+ changelog_uri: https://gitlab.com/gitlab-org/delivery/releases/CHANGELOG.md
115
115
  post_install_message:
116
116
  rdoc_options: []
117
117
  require_paths: