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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5665bd9b120f74096ef018dcb84b1976a3778158601b037f73f5c5b2529e0a5
4
- data.tar.gz: 1bd41e2eb052e9e64f04b2142b990b9c90f4812f7419db4aba0b88f89ab19c50
3
+ metadata.gz: a2d81243492d9418167e8a70f6f9b36525db84fb631751f3a592e0197e30c106
4
+ data.tar.gz: ef91ae54abde7a9ad9936405f0f2a16d1d1b77896c5abb52613c60b55a7fe1fb
5
5
  SHA512:
6
- metadata.gz: d016635c53c1b5df5bf12fb89b7015e001a0d47338a806f3a4826fa7dd728cf49df6e6b92008a7ec8d48b1d3a2690c37cf2220893882560f7e4d36c164bd6691
7
- data.tar.gz: 230f4b4f1d62978286290fd58865242fb630a0b6efc198f4e3061d84c922dffc96c7319043b4af3cbb8522e38bb75a8aec428c8394761833951b252cfd9636ef
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.17] - 2026-02-24
8
+ ## [0.4.18] - 2026-02-25
9
9
 
10
- ### Fixed
10
+ ### Added
11
11
 
12
- - Forward tag_pattern to git fragment handler in call and finalize (dd35249)
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
- ## [0.4.16] - 2026-02-24
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
- - Run bundle install after reissue:bump changes the version (104bfd8)
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
@@ -247,7 +247,8 @@ module Reissue
247
247
  changelog_file:,
248
248
  retain_changelogs:,
249
249
  fragment: fragment,
250
- tag_pattern:
250
+ tag_pattern:,
251
+ version_file:
251
252
  )
252
253
  finalize_message = "Finalize the changelog for version #{version} on #{date}"
253
254
  if commit_finalize
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Reissue
4
- VERSION = "0.4.17"
4
+ VERSION = "0.4.18"
5
+ RELEASE_DATE = "2026-02-25"
5
6
  end
@@ -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
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reissue
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.17
4
+ version: 0.4.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Gay