https://tenderlovemaking.com/2016/02/05/i-am-a-puts-debugger... is ruby gold for this kind of stuff. As a Ruby developer, probably one of the most impactful "quick tips" I've ever picked up is this:
foo.method(:bar).source_location
That is wildly useful when debugging/figuring out where the actual code for some method is at runtime.
Re:Building GitHub with Ruby on Rails
by throwaway445232 on Saturday April 08, 2023 @03:27AM
(#35491328)
you can't click on it and jump to source? is this the power of ruby metaprogramming?
Like, a lot of times I see some baz.foobarify() I have really hard time understanding where the heck that comes from. RubyMine makes wonders and control-clicking gets me there about half of time, but the rest of it it's either "search in all files, hoping that `def foobarify` is unique enough" or "this is crazy, but I'm gonna set a breakpoint, run it and see where this rabbit hole goes".
It feels kinda like Scala (or, to lesser degree, Haskell) magic operators problem, but worse.
I consider myself proficient with a decent number of languages and frameworks, but Ruby/Rails is one arcane mystery that just never clicked. So I really wonder what's the trick to make metaprogramming shenanigans manageable at this scale?