[Rubygems-developers] Problem with multiplatforms gems when using SourceIndex#search
thewoolleyman at gmail.com
Thu Dec 27 17:35:38 EST 2007
I have a test scenario where I have two test gems installed - they
have an identical platform and version, but different platforms (one
'ruby', one 'mswin32'). This is on a mac.
The problem is that I can't see how to make SourceIndex#search select
based on platform - it only seems to search based on name and version.
Given the gems described above, there's no way to specifically ask if
the ruby or mswin32 gem is installed. In other words, there's no way
to pass a Gem::Dependency that will select a specific platform.
You can pass the platform_only flag, but that's not what I want - I
want to select a specific platform that is not the current platform.
Is this the intended behavior? I know this is an edge case. In
normal usage, you wouldn't install a gem that doesn't match your
platform, but I think it's probably pretty common for people that
build multiplatform gems - you want to do a test install just to test
it out, not necessarily use it.
This could be fixed if there was a platform property added to
Dependency. Or maybe make the #search platform_only param be an
actual Platform object (defaulting to current platform) instead of
just a current-platform-or-not flag.
More information about the Rubygems-developers