[Rubygems-developers] Bonus Stuff: gemenabled rwhich

Chad Fowler chad at chadfowler.com
Thu Jul 15 20:47:04 EDT 2004


On Jul 14, 2004, at 3:31 PM, Jim Weirich wrote:

> Attached is a gem-enabled version of rwhich.  Rwhich is a script that
> finds the location of a require file by searching Ruby's LOAD_PATH for 
> a
> match.  Unfortunately, RubyGems renders the traditional implementation 
> of
> rwhich impotent.  The attached version will search any installed 
> rubygems
> directories as well as the traditional Ruby loadpath.
>
> I'm thinking that the "all_load_paths" function in rwhich would be a
> generally useful method for gem-enabled software.  all_load_paths and
> perhaps latest_load_paths could certainly be used by the DBI interface
> when it tries to autolocate its DBD drivers.  I would rather have 
> RubyGems
> provide this functionality rather than having each Gem-aware package
> duplicate it.
>
> Thoughts?
>

I agree that we should provide some API-level gem functionality that 
may or may not be required for the core gem tools themselves.  I'm 
guessing there won't be a *ton* of these things, but you've obviously 
come up with a good one here.  Probably need to have a separate require 
for this kind of stuff so it doesn't end up getting loaded during the 
more typical usage scenarios.  I say go ahead and include it!

Chad



More information about the Rubygems-developers mailing list