Skip to content

Commit 75bc582

Browse files
committed
Include prerelease gems in compact index during incremental update
In `update_index`, the call to `update_compact_index` only received `released` specs, excluding prerelease gems from the compact index files (`versions`, `info/<gemname>`). Since modern Bundler prefers the compact index, prerelease gems were effectively invisible after an incremental `--update`. Fix by passing all specs (both released and prerelease) to `update_compact_index`. Fixes #48
1 parent 61a8570 commit 75bc582

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/rubygems/indexer.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ def update_index
450450

451451
if @build_compact
452452
Gem.time "Updated compact index files" do
453-
files += update_compact_index released, @dest_directory, @directory
453+
files += update_compact_index specs, @dest_directory, @directory
454454
end
455455
end
456456

test/rubygems/test_gem_indexer.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,11 +462,12 @@ def test_update_index
462462
assert_equal <<~INFO_FILE, File.read(File.join(infodir, "d"))
463463
#{info_d_file.chomp}
464464
2.1 |checksum:#{file_sha256(File.join(gems, "d-2.1.gem"))}
465+
2.2.a |checksum:#{file_sha256(File.join(gems, "d-2.2.a.gem"))}
465466
INFO_FILE
466467

467468
assert_equal <<~VERSIONS_FILE, File.read(File.join(@indexerdir, "versions"))
468469
#{versions_file.chomp}
469-
d 2.1 #{file_md5(File.join(@indexerdir, "info", "d"))}
470+
d 2.1,2.2.a #{file_md5(File.join(@indexerdir, "info", "d"))}
470471
e 1 #{file_md5(File.join(@indexerdir, "info", "e"))}
471472
VERSIONS_FILE
472473

0 commit comments

Comments
 (0)