[Rubygems-developers] Enhancement Proposal: Would like be able to programatically specify platform
thewoolleyman at gmail.com
Tue Nov 28 16:24:55 EST 2006
I'm writing a tool ("geminstaller" on RubyForge) which will
automatically install all required gem versions for an app/server,
based on a config file. This is inspired by the way Maven handles
dependency auto-download for Java.
Anyway, it's almost releasable, except for one hitch: I can't figure
out how to programatically specify a platform for multiplatform/binary
gems; I always get prompted with the list of platform/version choices.
The crux of the problem seems to be in
Gem::RemoteInstaller.find_gem_to_install. It appears to be hardcoded
to prompt the user with a list of all gems if any binary gems exist,
with no way to programatically specify an exact name + version +
I can hack around this by overriding this method, as well as the
entire call stack up through InstallCommand, etc. I'm currently using
GemRunner as my interface point to invoke RubyGems, because I want to
avoid digging into the guts of RubyGems as much as possible.
However, this approach would require me to override several methods
(at least 4 I've found so far). I really don't like this, because
it's asking for forward-compatibility problems when new releases of
RubyGems are released.
So, what is your advice? Am I missing some easy solution to this? If
not, would you RubyGem developers be up for accepting a patch which
adds platform-specifying capability to the current code (including an
appropriate command line option)? If so, I'd like to contribute it.
I'd still have to hack around it for backward compatibility with prior
RubyGem releases, but it would be nice to know I wouldn't have to
worry about forward compatibility. Plus I think it would be a nice
P.S. Sorry if this has already been discussed in a prior thread, I
just joined the group and was too lazy to search the archives.
More information about the Rubygems-developers