'which' command for Ruby (like csh which?)

From: Dan Bikle [mailto:dan.bikle@gmail.com]
Sent: Friday, September 09, 2005 12:53 AM
To: ruby-talk ML
Subject: 'which' command for Ruby (like csh which?)

Hi,

suppose I have,

require "redgreenblue"
in
runme.rb

Is there a way I can tell which
redgreenblue.rb file will get pulled in to runme.rb
at run time?

Check your $LOAD_PATH. Wherever redgreenblue.rb shows up first is the
one Ruby will use.

Most UNIX shells have a 'which' builtin command which
offers similar behavior.

If I type
which runme
the builtin which command will tell which runme file
the shell would run should I choose to run it.

Thanks.

-Dan

The 'which' command may tell you where executables are. There's a
File.which method in the 'ptools' package, but again that only looks for
executable files. You could try the "find" package if you really want
to drill through your $LOAD_PATH.

Regards,

Dan

ยทยทยท

-----Original Message-----