ara.t.howard / noaa.gov wrote:
> On Wed, 14 Mar 2007, Alex Young wrote:
> 
>> Martin DeMello wrote:
>>> Finally gotten around to changing my 'require_gem' code, and I've
>>> noticed that for many gems, the name of the file to "require" is not
>>> the same as the gem's name. Furthermore, there's no way to find out
>>> what file I *do* need to require other than looking at the directory
>>> structure of the gem. An option to gem that would list all requirable
>>> files would be a nice addition.
> 
>> Personally, I'd prefer that a require 'gemname' just loaded all files 
>> in the gem's lib directory, but that's probably just me...
> 
> yikes!  i've got about 80 libs installed!
Not *all* the gems...  just the named one :-)

F'rinstance, from my machine:

require 'activerecord'

would load gems/activerecord-1.15-1/lib/active_record.rb, and

require 'actionpack'

would load gems/actionpack-1.13.1/lib/{action_controller.rb, 
action_pack.rb, action_view.rb}

and so on.  It's just one way around the disconnect between the gem's 
name and the name of the file you need to require, which keeps catching 
me off guard.  Mainly because I'm lazy.

-- 
Alex