When a file is downloaded / required via a symbolic link, all methods, keywords, etc. that relate to the file name seem to refer to the link name, not the real file name. For example, suppose I have a file foo.rbwith its contents, for example:
puts __FILE__, __dir__, caller
and a symbolic link bar.rbpointing to foo.rb. If I load / require foo.rbvia a symbolic link bar.rb, then all the file names specified by the above commands describe the name of the symbolic link bar.rb, not the real file name foo.rb.
Is there a way to call colleagues __FILE__, __dir__, calleretc. with file names pointing to the real file, not symbolic link names?
sawa source
share