Get file path of script being executed

Hi all,
I have some directories in my project like:

  • communications
  • model
  • database
  • database/sqlite
  • http

Every directory contains scripts, more specifically classes, that are
called from a main script Portal.rb located in the base directory. How
could those scripts get in its own code its complete path? I try some
solutions from Internet but I just get the path to Portal.rb

Thanks,
Ubaldo

On Nov 13, 2007, at 6:04 PM, Ubaldo V. wrote:

could those scripts get in its own code its complete path? I try some
solutions from Internet but I just get the path to Portal.rb

Check the FILE variable in each one.

– fxn

On Nov 13, 2007 1:09 PM, Xavier N. [email protected] wrote:

That works great, thanks.

actual_folder = File.basedir(FILE.gsub(/\/, ‘/’)

Or something like this…

2007/11/13, Ubaldo V. [email protected]: