Fix default gem detection for nested out-of-tree builds

The "# default:" marker records the source path relative to the build
directory, but default_gem? re-prefixed it with srcdir, resolving a
non-existent path and wrongly removing every default gemspec whenever
srcdir is deeper than one level. The sibling layout used on CI
(srcdir=../src) only canceled the double prefix by accident.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hiroshi SHIBATA 2026-06-28 18:19:48 +09:00
parent 249de200d5
commit b52a02ccc2
Notes: git 2026-06-29 08:26:12 +00:00

View File

@ -101,7 +101,7 @@ class Removal
(@defaults ||= {}).fetch(spec) do
File.open(prefixed(spec)) do |f|
if /^# default: (\S+) (\d+\.\d+)/ =~ f.gets("")
File.mtime(prefixed($1)) <= Time.at(Rational($2))
File.mtime($1) <= Time.at(Rational($2))
else
false
end