reissue 0.4.17 → 0.4.18
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 +12 -5
- data/README.md +22 -0
- data/lib/reissue/rake.rb +2 -1
- data/lib/reissue/version.rb +2 -1
- data/lib/reissue/version_updater.rb +13 -0
- data/lib/reissue.rb +7 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a2d81243492d9418167e8a70f6f9b36525db84fb631751f3a592e0197e30c106
|
|
4
|
+
data.tar.gz: ef91ae54abde7a9ad9936405f0f2a16d1d1b77896c5abb52613c60b55a7fe1fb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dd54fb9cbe9012fa1629526e146a913d468bbe7e56cfd39281c23d740f6178e847a03d9add2e71430a56580fa0a28187e30385bbc8f71a6a38c8b703c3866b2d
|
|
7
|
+
data.tar.gz: d023c5ab1a84d4789b4373c0810c6ee96973c27290a3df6e1357aa808e87ceb78d1b82c7313c095bcca3d9735f30e6ad5828b320d41a938f43db57c38ebe0c5f
|
data/CHANGELOG.md
CHANGED
|
@@ -5,14 +5,21 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](http://keepachangelog.com/)
|
|
6
6
|
and this project adheres to [Semantic Versioning](http://semver.org/).
|
|
7
7
|
|
|
8
|
-
## [0.4.
|
|
8
|
+
## [0.4.18] - 2026-02-25
|
|
9
9
|
|
|
10
|
-
###
|
|
10
|
+
### Added
|
|
11
11
|
|
|
12
|
-
-
|
|
12
|
+
- RELEASE_DATE constant tracking in VersionUpdater (496ec6b)
|
|
13
|
+
- Reset RELEASE_DATE to Unreleased when bumping version via Reissue.call (a7894cc)
|
|
14
|
+
- Update RELEASE_DATE to actual date during Reissue.finalize (8253796)
|
|
15
|
+
- RELEASE_DATE to the version.rb (6e08782)
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
13
18
|
|
|
14
|
-
|
|
19
|
+
- Pass version_file to Reissue.finalize from rake task (83682ff)
|
|
20
|
+
|
|
21
|
+
## [0.4.17] - 2026-02-24
|
|
15
22
|
|
|
16
23
|
### Fixed
|
|
17
24
|
|
|
18
|
-
-
|
|
25
|
+
- Forward tag_pattern to git fragment handler in call and finalize (dd35249)
|
data/README.md
CHANGED
|
@@ -170,6 +170,28 @@ Reissue::Task.create :reissue do |task|
|
|
|
170
170
|
end
|
|
171
171
|
```
|
|
172
172
|
|
|
173
|
+
## Tracking Release Dates
|
|
174
|
+
|
|
175
|
+
Reissue can automatically manage a `RELEASE_DATE` constant in your version file alongside `VERSION`. This is completely optional — if no `RELEASE_DATE` is present, nothing changes.
|
|
176
|
+
|
|
177
|
+
### Opting In
|
|
178
|
+
|
|
179
|
+
Add a `RELEASE_DATE` constant to your version file:
|
|
180
|
+
|
|
181
|
+
```ruby
|
|
182
|
+
module MyGem
|
|
183
|
+
VERSION = "0.1.0"
|
|
184
|
+
RELEASE_DATE = "Unreleased"
|
|
185
|
+
end
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
### What Happens Automatically
|
|
189
|
+
|
|
190
|
+
- **On finalize** (`rake build` / `rake reissue:finalize`): `RELEASE_DATE` is set to the actual release date (e.g., `"2024-06-15"`)
|
|
191
|
+
- **On bump** (`rake reissue` / post-release): `RELEASE_DATE` is reset to `"Unreleased"`
|
|
192
|
+
|
|
193
|
+
No configuration is needed — Reissue detects the constant and updates it automatically.
|
|
194
|
+
|
|
173
195
|
## Using Git Trailers for Changelog Entries
|
|
174
196
|
|
|
175
197
|
Reissue can extract changelog entries directly from git commit messages using trailers. This keeps your changelog data close to the code changes.
|
data/lib/reissue/rake.rb
CHANGED
data/lib/reissue/version.rb
CHANGED
|
@@ -108,6 +108,19 @@ module Reissue
|
|
|
108
108
|
VERSION_MATCH = /(?<major>\d+)\.(?<minor>[a-zA-Z\d]+)\.(?<patch>[a-zA-Z\d]+)(?<add>\.(?<pre>[a-zA-Z\d]+))?/
|
|
109
109
|
def version_regex = VERSION_MATCH
|
|
110
110
|
|
|
111
|
+
RELEASE_DATE_MATCH = /RELEASE_DATE\s*=\s*"([^"]*)"/
|
|
112
|
+
|
|
113
|
+
def release_date_regex = RELEASE_DATE_MATCH
|
|
114
|
+
|
|
115
|
+
def update_release_date(date, version_file: @version_file)
|
|
116
|
+
body = File.read(@version_file)
|
|
117
|
+
return unless body.match?(release_date_regex)
|
|
118
|
+
updated = body.gsub(release_date_regex) do |match|
|
|
119
|
+
match.sub(/=\s*"[^"]*"/, "= \"#{date}\"")
|
|
120
|
+
end
|
|
121
|
+
File.write(version_file, updated)
|
|
122
|
+
end
|
|
123
|
+
|
|
111
124
|
# Writes the updated version to the specified file.
|
|
112
125
|
#
|
|
113
126
|
# @param version_file [String] The version_file to the version file (optional, defaults to @version_file).
|
data/lib/reissue.rb
CHANGED
|
@@ -50,6 +50,7 @@ module Reissue
|
|
|
50
50
|
|
|
51
51
|
version_updater = VersionUpdater.new(version_file, version_redo_proc:)
|
|
52
52
|
new_version = version_updater.call(segment, version_file:)
|
|
53
|
+
version_updater.update_release_date("Unreleased", version_file:)
|
|
53
54
|
if changelog_file
|
|
54
55
|
changelog_updater = ChangelogUpdater.new(changelog_file)
|
|
55
56
|
changelog_updater.call(new_version, date:, changes:, changelog_file:, version_limit:, retain_changelogs:, fragment:, tag_pattern:)
|
|
@@ -65,7 +66,7 @@ module Reissue
|
|
|
65
66
|
# @param fragment_directory [String] @deprecated Use fragment parameter instead
|
|
66
67
|
#
|
|
67
68
|
# @return [Array] The version number and release date.
|
|
68
|
-
def self.finalize(date = Date.today, changelog_file: "CHANGELOG.md", retain_changelogs: false, fragment: nil, fragment_directory: nil, tag_pattern: nil)
|
|
69
|
+
def self.finalize(date = Date.today, changelog_file: "CHANGELOG.md", retain_changelogs: false, fragment: nil, fragment_directory: nil, tag_pattern: nil, version_file: nil)
|
|
69
70
|
# Handle deprecation
|
|
70
71
|
if fragment_directory && !fragment
|
|
71
72
|
warn "[DEPRECATION] `fragment_directory` parameter is deprecated. Please use `fragment` instead."
|
|
@@ -119,6 +120,11 @@ module Reissue
|
|
|
119
120
|
# Now finalize with the date
|
|
120
121
|
changelog = changelog_updater.finalize(date:, changelog_file:, retain_changelogs:)
|
|
121
122
|
|
|
123
|
+
if version_file
|
|
124
|
+
version_updater = VersionUpdater.new(version_file)
|
|
125
|
+
version_updater.update_release_date(date.to_s, version_file:)
|
|
126
|
+
end
|
|
127
|
+
|
|
122
128
|
changelog["versions"].first.slice("version", "date").values
|
|
123
129
|
end
|
|
124
130
|
|