Skip to content
This repository
Browse code

Support for custom annotations with rake notes:custom and DRY up the …

…task definition.

e.g.  rake notes:custom ANNOTATION=WTF
  • Loading branch information...
commit dc2d754d60378b529c239e1291932503d4d8fca5 1 parent 7098143
Michael Koziarski authored June 22, 2008

Showing 1 changed file with 8 additions and 11 deletions. Show diff stats Hide diff stats

  1. 19  railties/lib/tasks/annotations.rake
19  railties/lib/tasks/annotations.rake
@@ -6,18 +6,15 @@ task :notes do
6 6
 end
7 7
 
8 8
 namespace :notes do
9  
-  desc "Enumerate all OPTIMIZE annotations"
10  
-  task :optimize do
11  
-    SourceAnnotationExtractor.enumerate "OPTIMIZE"
  9
+  ["OPTIMIZE", "FIXME", "TODO"].each do |annotation|
  10
+    desc "Enumerate all #{annotation} annotations"
  11
+    task annotation.downcase.intern do
  12
+      SourceAnnotationExtractor.enumerate annotation
  13
+    end
12 14
   end
13 15
 
14  
-  desc "Enumerate all FIXME annotations"
15  
-  task :fixme do
16  
-    SourceAnnotationExtractor.enumerate "FIXME"
17  
-  end
18  
-
19  
-  desc "Enumerate all TODO annotations"
20  
-  task :todo do
21  
-    SourceAnnotationExtractor.enumerate "TODO"
  16
+  desc "Enumerate a custom annotation, specify with ANNOTATION=WTFHAX"
  17
+  task :custom do
  18
+    SourceAnnotationExtractor.enumerate ENV['ANNOTATION']
22 19
   end
23 20
 end

0 notes on commit dc2d754

Please sign in to comment.
Something went wrong with that request. Please try again.