Ruby on Rails latest stable (v2.2.1) - 1 note - Superclass: Object

Implements the logic behind the rake tasks for annotations like

  rake notes
  rake notes:optimize

and friends. See rake -T notes and railties/lib/tasks/annotations.rake.

Annotation objects are triplets :line, :tag, :text that represent the line where the annotation lives, its tag, and its text. Note the filename is not stored.

Annotations are looked for in comments and modulus whitespace they have to start with the tag optionally followed by a colon. Everything up to the end of the line (or closing ERb comment tag) is considered to be their text.

Show files where this class is defined (1 file)
Register or log in to add new notes.
July 23, 2008
5 thanks

Custom annotation types

For group work you may need something more than FIXME, OPTIMIZE and TODO. Just create new rake file and place it to lib/tasks:

  require 'source_annotation_extractor'

  task :notes do
    SourceAnnotationExtractor.enumerate "WTF|OMG", :tag => true
  end

  namespace :notes do
    desc "Enumerate all WTF annotations"
    task :wtf do
      SourceAnnotationExtractor.enumerate "WTF"
    end

    desc "Enumerate all OMG annotations"
    task :omg do
      SourceAnnotationExtractor.enumerate "OMG"
    end
  end

or create an array of new types and generate tasks dynamicaly.