From: Kevin Smith Date: 2001-09-21T13:49:54+09:00 Subject: [ruby-talk:21477] Re: nested require files need path internally --- Yukihiro Matsumoto wrote: > Every developer who works on multi file program has to > decide where to > store files other than main one. Candidates are: > > * current directory (this is BAD) > * same directory that main file exists (this is bad > too) > * ruby library directory (e.g. /usr/lib/ruby/1.6) > * application specific directory (e.g. > /usr/share/lib/app) Now I understand. In the Windows world (where I've lived for too many years), you typically put all the files related to a program in the same directory. In unix, you typically put just the launching program in /usr/bin and the rest in an app-specific directory. Ruby needs to work well in both the typical Windows case, and the typical unix case. I definitely do not want to install my files into the ruby lib path, as they are not library files. They are simply a collection of classes used only by my app. I want my app to be as self-contained within one directory as possible. In Windows, the main.rb should definitely assume that all the related files are in the same directory. If I understand the requirelocal solution, it would allow this. There are probably standard ways in unix for a program to "know" what its directory is. I don't know what those ways are. Would the install program have to insert the actual directory into the app's /usr/bin/main.rb, so it could do the -I correctly? But I want the same main.rb in both cases. Can requirelocal work in the typical unix case as well? Kevin __________________________________________________ Terrorist Attacks on U.S. - How can you help? Donate cash, emergency relief information http://dailynews.yahoo.com/fc/US/Emergency_Information/