Practical Debugging
summary
Ruby code ships with quick introspection: a live minesweeper demo shows the app running and sometimes winning, not a promise of examples. Concrete techniques include binding.irb to drop into scope, TracePoint to trace every line, ObjectSpace to find an object's allocation site, and module.nesting or object.methods to inspect lookup. One run allocates 70,001 objects for 10,000 updates and a tiny refactor cuts it to 50,001. Vendor gems can be examined and restored with bundle exec gem pristine; examples live on the GitHub repo.
AI-written summary · about








