No, not the heavyweight annotations that you see in Java or C# – these are just a way to denote the todos and other mental reminders we often litter in our code comments:
1 2 3 4 5 6 7 8 9 |
class ContactsController < ApplicationController # TODO: factor out model verification to a filter # OPTIMIZE: optimize this # FIXME: it's broken def index ... end end |
With this new rake task we can now spit out a list of items we’ve annotated:
1 2 3 4 5 |
rake notes app/controllers/contacts_controller.rb: * [ 3] [TODO] factor out model verification to a filter * [ 4] [OPTIMIZE] optimize this * [ 5] [FIXME] it's broken |
You can also only list the annotations of a particular kind with rake notes:todo, rake notes:optimize and rake notes:fixme.
1 2 |
cd lib/tasks && \ wget http://dev.rubyonrails.org/export/7553/trunk/railties/lib/tasks/annotations.rake |
tags: rubyonrails, rails

Someone’s been very busy lately! Lots going on in the world of Edge Rails.
I love how lightweight and useful this is!
Nice, very nice… I am used to this stuff from VisualStudio and love this feature. Now it will be available to rails… so nice ;)
Could this perhaps be extracted from rails? I’d really like to use this for non-rails projects, too!
hell, i’d love for it to be backported to a plugin for 1.2
Nice. I already use that style of annotations, so this should be a huge help.
You should be able to use this in any version of rails (just tested it in 1.2.2). Just do this from your rails root:
svn export http://svn.rubyonrails.org/rails/trunk/railties/lib/tasks/annotations.rake lib/tasks/annotations.rake
@JD: Thanks for the tip – gonna move it up to the post itself…
Yes, thank you, love it.
This is a great addition, BUT something is broken in my app (running on Edge Rails). Whenever I run any rake task:
Any ideas?