3 ms·
Eloquent Ruby is a simply fantastic book that should be required reading for everyone. and yeah inheriting someone else's codebase that has a gem that installs
by weaksauce 3y ago
Eloquent Ruby is a simply fantastic book that should be required reading for everyone. and yeah inheriting someone else's codebase that has a gem that installs some new dsl that you have no idea where it came from can be a nightmare.
- ezekg 3y agoIf you’re ever curious about where a method comes from, you can use method(:some_new_dsl).source_location [0]. [0]: https://docs.ruby-lang.org/en/3.2/Method.html#method-i-source_location https://docs.ruby-lang.org/en/3.2/Method.html#method-i-sourc...
- weaksauce 3y agooh yeah i've definitely used that in the past. just saying you have to get the code to run to that point and it's just a pain to figure out what is going on sometimes. a lot of times it's easy enough by browsing the gem file. however things get more murky when you have some dynamically generated methods and it just tells you the thing was created by eval.