How to find all those stray y, puts and prints in your code

Posted by Andre Foeken Tue, 28 Aug 2007 15:49:23 GMT

I have it all the time, I add some nasty console output to my ruby and some gets left behind. I wanted this to stop so I built a small regex to solve my problem.

    {   name = 'console.output.ruby';
        match = '^\s*(y|puts|print|printf)[ ].*';
    },

If you add this to the ruby language def in Textmate and then update your style theme with a bright color (scope: console.output.ruby), those nasty buggers will really stand out.

If you just want to get rid of them just run the regex above on your file (replace).

Posted in  | Tags , , , , ,  | 2 comments