It puts the lotion on its skin
14 December 2009 in Debugging, Ruby on Rails, TestingHave you ever pulled your hair out trying to find a stray puts statement in your code after a mad night of debugging? Searching for puts across the whole project doesn’t seem to be very helpful. Here’s an easy fix:
Drop this line of code into your environment.rb file and run your tests:
def puts(wheremyputsizat) raise end
That code will override the puts statement and raise an error every time you call puts in your project. You’ll get the file name and line number of each hard-to-find puts statement. Just don’t forget to take that the code out of your environment when you are done.
No comments yet.
Leave a comment
Tweets
- It's not the strongest of the species that survive, nor the most intelligent, but the ones most responsive to change."- Charles Darwin (link)
- Correction: Excellent software is the *byproduct* of excellent communication (link)
- @DayleyAgile thanks for the invite to speak at the Phoenix Scrum User Group on Feb 18th http://tr.im/NQuA #PhxSUG (link)
- I really enjoyed the scrum user's group #PhxSUG tonight. Stealing @AgileForAll's ideas for the retrospective tomorrow. (link)
- Thanks for the link @marick: "The estimate was awesome because the client was awesome." http://tr.im/KiYR (link)
- Introducing netrecorder, my first ruby gem.
3 January 2010 - How to build a ruby gem and host it on gemcutter
3 January 2010 - DEMO!
18 December 2009 - It puts the lotion on its skin
14 December 2009 - Cucumber Code Ratio
14 December 2009
- Chris Young:
Oh I see . . . Maybe I should check out this so-c... - Nicholas Orr:
Oh I see. I've read it a bit closer and there are ... - Chris Young:
Thanks Clayton, I updated the post.... - Clayton:
One problem I ran into using this guide is that yo... - Chris Young:
@Nicholas, I didn't go manual, I used 'echoe' - ma...