[Rubygems-developers] Suggestion: require_gem 'x/y'

Chad Fowler chad at chadfowler.com
Fri Jun 25 09:25:47 EDT 2004


On 24/6/2004, at 3:29 PM, Gavin Sinclair wrote:

> I mentioned recently that my 'extensions' project doesn't have a
> default file that gets loaded.  Thus you would have to do this:
>
>   require_gem 'extensions'
>   require 'extensions/string'
>
> It occured to me today that this is an option:
>
>   require_gem 'extensions/string'
>
> It's easy to implement, seems logical, and breaks nothing.  Of course,
> you can still have
>
>   require_gem 'extensions/string', '> 0.3'
>
> Any problems with this?
>

I assume this implies that you would have a hierarchical gem namespace, 
and that each one of the 'extensions' thingies (like "string") would be 
a separate gem?

Would you see that looking like:

/usr/local/lib/ruby/gems/1.8/gems/extensions/string/lib
                                                                         
                     lib/string.rb
                                                                         
                     test/
                                                                         
                     etc
?

Would there still be an "extensions" gem?

This seems generally OK to me.  I would hate for people to start trying 
to shoe-horn in limiting categories into their gem names, like 
"xml/parsers/lovelyxml-0.0.1" or something like that.  I'm very much 
against gems having explicit categories assigned to them.  That being 
said, it's not enough of an aversion to hold up a useful feature if 
people generally agree.

As a sanity check, is this so bad:

>   require_gem 'extensions'
>   require 'extensions/string'

?

Chad



More information about the Rubygems-developers mailing list