method

__dir__

v2_1_10 - Show latest stable - Class: Kernel
__dir__()
public

Returns the canonicalized absolute path of the directory of the file from which this method is called. It means symlinks in the path is resolved. If __FILE__ is nil, it returns nil. The return value equals to File.dirname(File.realpath(__FILE__)).