[Rubygems-developers] Specifying equivalent modules?

Charles Oliver Nutter charles.nutter at sun.com
Wed Apr 18 23:43:03 EDT 2007

Eric Hodel wrote:
> On Apr 17, 2007, at 22:01, Charles Oliver Nutter wrote:
>> Jim Weirich wrote:
>>> On 4/17/07, Charles Oliver Nutter <charles.nutter at sun.com> wrote:
>>>> Is there a way in RubyGems today to specify that one of a number of
>>>> modules would be considered equivalent, and to load whichever is
>>>> actually present? So that during install, options could be  
>>>> presented for
>>>> multiple named gems that provide the same functionality?
>>> Would it work to just make platform dependent variants of the gems in
>>> question? Currently, RubyGems will make you manually choose the right
>>> platform (future versions will autoselect the correct platform for
>>> you).
>> I think it's more than just choosing the right platform...it's an  
>> issue
>> that if every gem out there depends on "mongrel" there's not a  
>> thing we
>> can do to force them to install and run with "jmongrel", even if  
>> the two
>> are nearly identical.
> No, they'd install the java platformed mongrel, much like there's a  
> mswin and ruby platformed mysql gem.  Nothing changes in code  
> anywhere, people running jruby instead install java gems.

Well, but that's the point...we have to have a java-platformed mongrel, 
which means that Zed, who 'owns' the "mongrel" gem name, would have to 
be responsible for publishing a Java platform gem. As much as we'd like 
to just give our working Java code to gem owners, it seems unreasonable 
to expect that they'll all do this publishing for us, and it seems 
inappropriate for us to publish our own gem called "mongrel" that only 
supports Java.

It's also not an all-or-nothing thing...most gems don't have native code 
and will work fine in JRuby, so splitting off a separate repository just 
for those gems that do have native code seems like a lot of hassle.

- Charlie

More information about the Rubygems-developers mailing list