Let gem install use Compact Index API only when present. #9314
+266
−63
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While I was working on publishing some gems in private repositories, I have realized bundler already uses Compact Index API only when present, but gem commands sometimes not.
This is first change in chain to update gem commands (
gem installhere) to be able to use Compact Index API only when present. The change is simple, Compact Index API/info/:gemendpoint already provides all info needed to provide gemspec stub needed to resolve dependencies.I have added also (in separate commit) infrastructure for simple stub of Compact Index API (reusing same API as
spec_fetcher) and in last commit I have ported some basicgem installtests to use Compact Index API (as new default option).As a side-effect it is also faster. Running simple command like
GEM_HOME=/tmp/gem_test gem installwith empty GEM_HOME makes gem install 5s faster locally on my Linux (Fedora) computer.