Skip to content

Commit 9d6deeb

Browse files
hsbtclaude
andcommitted
Use the X.Y.0 release as the gem-version baseline
stdgems.org's "X.Y" key tracks the latest 4.0.x patch level, so once a gem gets bumped in a Ruby patch release the diff baseline shifts forward and history that should appear in NEWS.md for the next minor disappears. Prefer the explicit "X.Y.0" key when present so the baseline always points at the original X.Y.0 release; fall back to "X.Y" or the highest matching patch otherwise. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent c45ddde commit 9d6deeb

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

tool/update-NEWS-github-release.rb

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ def fetch_default_gems_versions(ruby_version)
2424
json = JSON.parse(body)
2525
gems = json["gems"] || []
2626

27+
# Prefer the initial release key (e.g. "4.0.0") over the rolling
28+
# major.minor key (e.g. "4.0") so the diff baseline reflects the original
29+
# X.Y.0 release rather than the latest patch level.
30+
initial_release_key = (ruby_version =~ /\A\d+\.\d+\z/) ? "#{ruby_version}.0" : nil
31+
2732
map = {}
2833
gems.each do |g|
2934
# Only include default gems (skip ones marked removed)
@@ -38,7 +43,9 @@ def fetch_default_gems_versions(ruby_version)
3843
category_versions = versions[category] || {}
3944
next if selected_version
4045

41-
if category_versions.key?(ruby_version)
46+
if initial_release_key && category_versions.key?(initial_release_key)
47+
selected_version = category_versions[initial_release_key]
48+
elsif category_versions.key?(ruby_version)
4249
selected_version = category_versions[ruby_version]
4350
else
4451
# Fall back to the highest patch version matching the given major.minor

0 commit comments

Comments
 (0)