SyntaxFix
Write A Post
Hire A Developer
Questions
__FILE__ is the filename with extension of the file containing the code being executed.
__FILE__
In foo.rb, __FILE__ would be "foo.rb".
foo.rb
If foo.rb were in the dir /home/josh then File.dirname(__FILE__) would return /home/josh.
/home/josh
File.dirname(__FILE__)