Koke’s

My English alter-ego

fixmefinder.rb

Posted by Jorge Bernal April 11, 2006

Here’s some code if anyone might find it interesting. I usually put FIXME comments in my code. As much usually I forgot abut them ;P

So here’s FixmeFinder. A ruby class to find lines which contain the string “FIXME” in a bunch of files. Sounds silly but if it’s useful to me, it may be for someone else.

I also use a rake task to find fixmes:

desc "Find FIXMEs in the code"
task :fixme do
  patterns = %w[
    lib/**/*.rb
    schema/**/*.sqlr
  ]
  FixmeFinder.new(patterns).find
end

It outputs something like:

$ rake fixme
schema/actions.sqlr:448: Check this type
schema/actions.sqlr:450: Check this type

Bookmark this post: · Del.icio.us · YahooMyWeb · Spurl · Furl · Incoming links

AddThis Social Bookmark Button   AddThis Feed Button

3 Responses to “fixmefinder.rb”

Comments

  1. koke Apr 11 2006 / 7am

    Here’s some code if anyone might find it interesting. I usually put FIXME comments in my code. As much usually I forgot abut them ;P

    So here’s FixmeFinder. A ruby class to find lines which contain the string “FIXME” in a bunch of files. Sounds silly but if it’s useful to me, it may be for someone else.

    I also use a rake task to find fixmes:

    desc "Find FIXMEs in the code"
    task :fixme do
      patterns = %w[
        lib/**/*.rb
        schema/**/*.sqlr
      ]
      FixmeFinder.new(patterns).find
    end

    It outputs something like:

    $ rake fixme
    schema/actions.sqlr:448: Check this type
    schema/actions.sqlr:450: Check this type
    

  2. Anonymous Apr 11 2006 / 9am

    Why not use grep?

  3. koke Apr 12 2006 / 1am

    Yep, a “grep -rn FIXME *” can do the job, but it’s so nice to write Ruby… ;)

Leave a Reply