From 2ea7ab1c3c73bb8d26c86c12a50e7edd28067f35 Mon Sep 17 00:00:00 2001 From: Hiroshi SHIBATA Date: Tue, 12 May 2026 16:03:10 +0900 Subject: [PATCH] Compare versions semantically in ruby_latest_full_version? Previously this depended on the order of entries in www.ruby-lang.org's releases.yml, so when a repository_dispatch build was triggered before releases.yml had been updated with the new release, the major.minor alias (e.g. 4.0) was not produced. As a result 4.0 kept pointing at 4.0.2 even after 4.0.3 and 4.0.4 had been built. Compare with Gem::Version against a candidate set that always includes the version being built so the alias is correct regardless of releases.yml timing, and double-digit teeny versions also order correctly. Fixes #165 Co-Authored-By: Claude Opus 4.7 (1M context) --- Rakefile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Rakefile b/Rakefile index 6f1e0b5..4d01d6e 100644 --- a/Rakefile +++ b/Rakefile @@ -83,7 +83,9 @@ end def ruby_latest_full_version?(version) ver2 = version.split('.')[0,2].join('.') - ruby_versions[ver2][0] == version + candidates = ((ruby_versions[ver2] || []) + [version]).uniq.select { |v| v.match?(/\A\d+\.\d+\.\d+\z/) } + return false if candidates.empty? + candidates.max_by { |v| Gem::Version.new(v) } == version end def ruby_version_exist?(version)