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.
This adds support for the
latest_specs.4.8.gz
endpoint that is required for several gem commands to work properly (e.g.gem install
andgem search
without the-a
flag). See #129 for more details.There might be a more efficient way to implement the database query. I'm not aware of a way to do proper gem version comparisons in the DB, so it seemed to just pull all of the versions and do the latest version selection in Ruby.
If a gem has platform-specific versions, the latest version for each platform will be returned by this code. That seems to match what the
latest_specs.4.8.gz
endpoint on rubygems.org does.I added several unit tests and one new integration test that shows the difference in behavior between
gem search -a
andgem search
.It might be worth adding integration tests for the
gem install
command, but I wasn't sure what kind of test infrastructure that would require. I'd be happy to write such a spec if someone can give me a little guidance there.Fixes #129