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

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Furl
  • Google Bookmarks
  • email
  • StumbleUpon

Most Commented Posts

1 Star2 Stars3 Stars4 Stars5 Stars (No Ratings Yet)
Loading ... Loading ...

3 Responses to “fixmefinder.rb”

  1. koke says:

    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 says:

    Why not use grep?

  3. koke says:

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

Leave a Reply