From: jeffz_2002@... Date: 2007-01-05T10:10:08+09:00 Subject: Re: Managing "requires" in projects with many subdirectories Thanks for the notes ... one final question: > Now I'm slowly going back to requires with relative paths to 'lib' > directory, that gets on the search path from the main file or command > line. Does this mean that your files would, say, look like this: (file a.rb) require 'some/thing' and then the command line becomes: $ ruby -Ipath/to/lib my_file.rb ? The reason I ask is that you still need to pull in the path/to/lib somewhere, and including it in the -I param means that subsequent devs will need to know this (yes, I know it's minor, but I'd want others to be able to cd to /tests and just write "ruby ts_all.rb", or "ruby tc_specific_test_case.rb" in any subdirectory ... trying to make life easy for them, cause I'm such a great guy). Also, minor point, but path separators are different in different OSs, aren't they? So don't you need to do something like: (file a.rb) require File.join('some', 'thing') which also becomes tiresome? Or does the ruby interpreter take care of that? Sorry, I don't have another machine to try this out on, I only have 'doze. > NB: in the > $:.unshift File.join( File.expand_path( File.dirname( __FILE__ )) , > '..', '..', 'blah' ) > I would reverse expand_path and join, to remove those .. elements, i.e. > $:.unshift File.expand_path( File.join( File.dirname( __FILE__ ), > '..', '..', 'blah' )) Yes, that's better, thanks. Thanks for putting up with my inane questions. jz