[ap4r-devel] [362] trunk/ap4r/Rakefile: Add: rake task to extract TODO comments.

shino at rubyforge.org shino at rubyforge.org
Thu Jan 10 04:36:13 EST 2008


Revision: 362
Author:   shino
Date:     2008-01-10 04:36:12 -0500 (Thu, 10 Jan 2008)

Log Message:
-----------
Add: rake task to extract TODO comments. 

Modified Paths:
--------------
    trunk/ap4r/Rakefile

Modified: trunk/ap4r/Rakefile
===================================================================
--- trunk/ap4r/Rakefile	2008-01-09 06:21:52 UTC (rev 361)
+++ trunk/ap4r/Rakefile	2008-01-10 09:36:12 UTC (rev 362)
@@ -163,3 +163,26 @@
   end
 end
 
+desc "List TODO comments in files"
+task :todos => "release:copy_plugin" do
+  todo_pattern = /#\s*TODO\s*:?\s*(.*)\s(\d{4}\/\d{2}\/\d{2})\s*,?(?:by)?\s*(\S+)/i
+  Pathname.glob("lib/**/*") do |file|
+    next unless file.file?
+
+    line_no = 0
+    first_time = true
+    file.each_line do |line|
+      line_no += 1
+      m = todo_pattern.match(line)
+      if m
+        if first_time
+          puts file
+          first_time = false
+        end
+        puts "L.#{"%4d" % line_no}: #{m[1]}  --  #{m[2].strip} by #{m[3].strip}"
+      end
+    end
+    puts unless first_time
+  end
+  
+end




More information about the ap4r-devel mailing list