rubygems/rubygems — pull request #950 by jeremyevans (2014-06-20 23:09:21+00:00)
Title: Make gem -g Gemfile respect --conservative (Fixes #929)

This is the least intrusive way I could think to support the
combination of -g and --conservative. This took a while to
figure out, but it should correctly handle dependencies and
make sure that currently installed gems are used instead of
installing new gems, as long as the currently installed gems
meet the version requirements.

Implmentation wise, this adds a hash attribute to the Resolver
for gems that should be skipped instead of new installations
made if the versions match. The RequestSet sets this variable
with the specifications of all of the currently installed gems
if --conservative is used.

When finding possible dependencies in the resolver, we still query
the rubygems.org API, but then we restrict the returned results
to only gems that match the currently installed gems, if any
do. The reason for this choice of implementation is parts of
rubygems expect Gem::Resolver::APISpecification instances,
and I couldn't think of a good way to create them otherwise.