Skip to content

Instantly share code, notes, and snippets.

@benwoodward
Created February 14, 2013 11:41
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 benwoodward/4952286 to your computer and use it in GitHub Desktop.
Save benwoodward/4952286 to your computer and use it in GitHub Desktop.
Locate and open (in TextMate) at location of method source. http://pragmaticstudio.com/blog/2013/2/13/view-source-ruby-methods
# source_for(Person.new, :update)
def source_for(object, method)
location = object.method(method).source_location
`mate #{location[0]} -l #{location[1]}`
location
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment