Since there may be a lot of Ghost Methods inside a ruby gem, I don\'t think it is a good idea to study the inner mechanism of a ruby gem just by reading
I would love to know if there's a better way to do this, but how I usually do it is:
bundle show gemname
. I'm on a Mac so I usually pipe this to pbcopy so it gets copied to my clipboard. bundle show rails | pbcopy
mvim /path/to/gem/directory
debugger
above the line in question.p variable_name
), and move line by line with the ruby debugger commands.*Knowing where to put the breakpoint can take some understanding of the code, but you should start in lib/gemname.rb