Skip to content

Instantly share code, notes, and snippets.

@nzifnab
Created May 11, 2011 20:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nzifnab/967220 to your computer and use it in GitHub Desktop.
Save nzifnab/967220 to your computer and use it in GitHub Desktop.
Who called me!
# file_1.rb
#-----------------------------
require 'file_2'
where_am_i()
#-----------------------------
# file_2.rb
#-----------------------------
def where_am_i
# THIS DOESN'T WORK, I want the file/line from file_1, not this file/line.
puts "where_am_i called from #{__FILE__}:#{__LINE__}"
end
#-----------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment