From: Mark Hulme Jones Date: 2003-03-21T03:38:51+09:00 Subject: Re: Find::Bin, use lib, in ruby Daniel Bretoi writes: > Hi, > > problem: > > I have my own set of libraries located relative to my script in ../lib > i.e. my configuration is something like > > rubyscripts/bin/script.rb > rubyscripts/lib/libforscript.rb > > How can I tell script.rb where to look for libforscript.rb without > having to use absolute paths? Adam Spiers, the co-developer of RubyPhoto, wrote a library to do this that is included as part of the RubyPhoto distribution. Grab abspath.rb and findbin.rb from: http://www.plig.net/~ture/rubyphoto/rubyphoto-latest/ and stick them in your site library directory. You should then be able to do things like: require 'findbin' $:.push FindBin::RealBin + "/../lib" in your script, similar to how the Perl module works. It even handles symlinks the same as the Perl one, IIRC. At some point he or I might even write documentation for it and parcel it up separately, though it's not a terribly big module, so you should be able to work out what's going on. -- Mark Hulme-Jones < ture@plig.net >