Module: Kernel
- Defined in:
- lib/weewar-ai/__dir__.rb
Overview
Extensions for Kernel
Instance Method Summary collapse
-
#__DIR__ ⇒ Object
This is similar to
__FILE__
and__LINE__
, and returns a String representing the directory of the current file is.
Instance Method Details
#__DIR__ ⇒ Object
This is similar to __FILE__
and __LINE__
, and returns a String representing the directory of the current file is. Unlike __FILE__
the path returned is absolute.
This method is convenience for the
File.(File.dirname(__FILE__))
idiom.
18 19 20 21 |
# File 'lib/weewar-ai/__dir__.rb', line 18 def __DIR__() filename = caller[0][/^(.*):/, 1] File.(File.dirname(filename)) end |