Debugging with caller
So you have some code that is being used a lot (library for example) behaving strangely under some circumstances, and you'd like to see what`s going on. Here is the way:
# inside library...
binding.pry if caller.grep(/filename_of_client_code_that_breaks_library\.rb:64/).present?
Written by Titov Andrey
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ruby
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#