From: Tim Bates Date: 2003-01-11T20:23:51+09:00 Subject: 'require' search path I wish 'require' would count the current directory as the directory the file is in, rather than the directory the script is being run from. My test scripts do require 'test/tc_default' This works fine if you're running the test script which runs all the tests, as it resides in the parent directory. However, if you cd into the test directory and run a test case directly, it can't find it, since it's looking for 'test/test/tc_default' instead, which of course doesn't exist. The same goes for my executable file, sitting in the bin directory. I've had to add a line $: << __FILE__.sub(/\w*$/, '') + '../lib' in order to get it to run out of the tarball (I don't want to have to install it while testing...) Then I added a pre-setup.rb (hook for install.rb) which removes this line when the file is installed. This works, but it is very kludgy to me - surely there's a better way? (Oh, and it means once you run install.rb, the file is no longer the same one you downloaded... this in itself is bad, I think.) Tim Bates -- tim@bates.id.au