When reading source code, I always want to know the full path of the file when it is loaded, is there any callback method in ruby to accomplish this, or any other way to do
To get the full path of the file, you must assemble a string in the following way (where yourfileobject is an object of Ruby's File class).
File.expand_path(File.dirname(yourfileobject)) + "/" + yourfileobject.path