…n the existing one
Previously Gem::Server would reset the gem list for certain requests. This was designed to always provide the latest installed gems for installation. When the --dir option was used, resetting the gem list would also revert to the standard gem directories. This meant the user-provided directories would always be ignored. Now the reset includes the gem directories the user provided to eliminate this problem. Fixes #696
DependencyResolver#find_conflict_state chose only the state with a matching dependency and ignored all other states. This meant that if there was another state that would result in successful resolution of the states the resolver would never try it. Now find_conflict_state prefers selecting a state with a matching dependency, but returns the first state if that did not work out. This allows the resolver to backtrack successfully. @evanphx should review this commit.
For some reason this changes the exceptions raised by the resolver because it follows a different path. I'm unsure what to make of it, but it still raises exceptions in the correct place, just not Gem::ImpossibleDependenciesError. @evanphx should review this commit.