Method: Path.file

Defined in:
lib/path.rb

.file(from = nil) ⇒ Object

Path to the current file Path(__FILE__).



12
13
14
15
16
# File 'lib/path.rb', line 12

def file(from = nil)
  from ||= caller # this can not be moved as a default argument, JRuby optimizes it
                                 # v This : is there to define a group without capturing
  new(from.first.rpartition(/:\d+(?:$|:in )/).first).expand
end