[Rubygems-developers] Bonus Stuff: gemenabled rwhich

Jim Weirich jim at weirichhouse.org
Wed Jul 14 15:31:22 EDT 2004

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.


-- Jim Weirich     jim at weirichhouse.org    http://onestepback.org
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)

More information about the Rubygems-developers mailing list