Enumerating annotations in directories of your choosing with rake:notes – a post at Steven Luscher’s blog

App Lib and Spec folders

By default, rake:notes searches for annotations in the app, lib, and test directories. If you have code in other directories that you would like to be searched for annotations, you can override rake:notes‘ defaults by overriding SourceAnnotationExtractor#find.

I use RSpec and Cucumber, and wanted rake:notes to traverse my spec and features directories. To achieve this, I created a file called lib/tasks/notes.rake:

# Override the directories that the
# SourceAnnotationExtractor traverses
# when you call rake notes
class SourceAnnotationExtractor
  def find_with_custom_directories
    find_without_custom_directories(%w(app lib spec features))
  end
  alias_method_chain :find, :custom_directories
end

Tags: , ,

be the first person to comment on this post:

Want to include some code? Use Pastie and stick the link into your comment. Linebreaks, block quotes, and preformatted code blocks will be removed.

Please make an attempt to prove that you’re still human before submitting your comment.

If you've written a post of your own in response to this one, feel free to trackback from your own site.

be the first person to comment on this entry.