In Ruby 2.0.0-p0, the __dir__ variable was introduced for easy access to the directory of the file currently being executed.
__dir__
Why is __dir__
I think that is because __FILE__ is a parse-time constant whereas __dir__ is a function and returns File.dirname(File.realpath(__FILE__))
__FILE__
File.dirname(File.realpath(__FILE__))
For more details, see This discussion