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

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 endIt outputs something like:
Why not use grep?
Yep, a “grep -rn FIXME *” can do the job, but it’s so nice to write Ruby…