Skip to content

Commit

Permalink
Support for custom annotations with rake notes:custom and DRY up the …
Browse files Browse the repository at this point in the history
…task definition.

e.g.  rake notes:custom ANNOTATION=WTF
  • Loading branch information
NZKoz committed Jul 3, 2008
1 parent 7098143 commit dc2d754
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions railties/lib/tasks/annotations.rake
Expand Up @@ -6,18 +6,15 @@ task :notes do
end

namespace :notes do
desc "Enumerate all OPTIMIZE annotations"
task :optimize do
SourceAnnotationExtractor.enumerate "OPTIMIZE"
["OPTIMIZE", "FIXME", "TODO"].each do |annotation|
desc "Enumerate all #{annotation} annotations"
task annotation.downcase.intern do
SourceAnnotationExtractor.enumerate annotation
end
end

desc "Enumerate all FIXME annotations"
task :fixme do
SourceAnnotationExtractor.enumerate "FIXME"
end

desc "Enumerate all TODO annotations"
task :todo do
SourceAnnotationExtractor.enumerate "TODO"
desc "Enumerate a custom annotation, specify with ANNOTATION=WTFHAX"
task :custom do
SourceAnnotationExtractor.enumerate ENV['ANNOTATION']
end
end

0 comments on commit dc2d754

Please sign in to comment.