From: matz@... (Yukihiro Matsumoto) Date: 2000-03-24T23:58:58+09:00 Subject: [ruby-talk:02133] Re: Question the sequence in $: Hi, In message "[ruby-talk:02129] Question the sequence in $:" on 00/03/24, Clemens Hintze writes: |As you can see the local directory "." is at the end of the load |path. That means, that my current directory is the last one to be |searched for libs. | |Is this intended? Yes, It's intended. Mostly because security reason. If you want to load your own file, I think you should express it explicitly. But you can use RUBYOPT environment variable for your purpose. export RUBYOPT RUBYOPT='I." ruby -e 'p $LOAD_PATH' [".", "/usr/lib/ruby/site_ruby/1.5/i586-linux", "/usr/lib/ruby/site_ruby/1.5", "/usr/lib/ruby/site_ruby", "/usr/lib/ruby/1.5/i586-linux", "/usr/lib/ruby/1.5", "."] |I think everywhere the sequence should be: | | local -> site -> system | |Other opinions? I think relative path is too dangerous. BTW, the sequence in the Perl's load path is reversed somehow. |And while thinking about this, I have another proposal. How about to |include the directory from where the program was started into the load |path too? That would enable me to put my application with its support |libs into an own subdirectory and after starting, the load path would |already contain this directory too! So its support libs could easily |be required too. But this should only happen, of course, if $0 is not |'-' or '-e'. I can understand you. But `$0' path is not portable. matz.