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
- study: "In 2 years, work perf of high school recruited devs indistinguishable from more experienced peers"(paraphrase)http://tcrn.ch/daXoHA (link)
- Attention Software Developers: We better be rich before we turn 50 http://tcrn.ch/daXoHA :( (link)
- @integrum was mentioned in the devshow podcast #14 for its hiring practice of having developers download a project from Git and re-factor. (link)
- @supairish good point! (link)
- Like the unobtrusive js in Rails 3 but stuck on 2.3.dumb? Just include Rv3 jquery adapter (a .js file) in ur project! http://bit.ly/bqjVGH (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
- Tobi:
^^ shit, ok now I see it's not your fault, its (my... - Tobi:
Thanks for this great writeup! btw. you missed... - Chris Young:
Thanks for letting me know. I updated the link.... - maxjgon:
The link of the project in Github is broken!... - Chris Young:
Oh I see . . . Maybe I should check out this so-c...