Last Updated: February 25, 2016
·
453
· idrozd

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?