[Rubygems-developers] multiple specific versions of dependencies

Eric Hodel drbrain at segment7.net
Thu May 15 03:47:43 EDT 2008

On May 1, 2008, at 09:06 AM, Jeremy d wrote:

> Hello guys,
> I have an interesting use case for you, and I've been working to patch
> RubyGems in an attempt to match this functionality.
> User needs to install multiple specifically versioned gems in the
> quickest way possible.  Example command line would be similar to this
> "gem install mongrel-1.0 daemons-1.0.8 rails rake-0.7.1".
> I've been working with the latest RubyGems to see if the patch would
> still fit and it is relying on having more caching available in order
> to hot-wire the dependency tree.  I've ported it most of the way, but
> I have a failing test that specifies the installation of dependencies
> out of order.  I've tracked it down to line 99 of
> dependency_installer.rb, previously the gems_and_sources contained a
> large list of specs, in which I could cherry-pick the right
> dependency.   Now with the new caching, it only returns the latest
> version of a dependency.  Is there a way I can still access a larger
> list of dependencies from the cache and select the specific version
> needed?

Gem::SourceInfoCache.search takes an "all" paramater than is false by  
default.  When you detect a version, you should make it switch to true.

> I'm attaching the patch for 1.0.1 so you can see it in action.  Also
> included is the patch in progress for 1.1.1, with 1 failing test.  The
> patch adds an entirely new gem command called quickinstall, to retain
> original functionality as much as possible, while adding default
> options for speedup.  To use it: gem quickinstall mongrel-1.0
> daemons-1.0.8

I'll take a look at it over the weekend.

More information about the Rubygems-developers mailing list