Permalink
Browse files

Added support tasks to Rakefile: dbg, todo, and rubyfiles

git-svn-id: svn+ssh://rubyforge.org/var/svn/rake/trunk@340 5af023f1-ac1a-0410-98d6-829a145c37ef
  • Loading branch information...
1 parent d326c81 commit b412f1a1e271c5e8fe879708626309af4f1246a8 jimweirich committed Mar 25, 2005
Showing with 32 additions and 0 deletions.
  1. +32 −0 rake/Rakefile
View
@@ -225,3 +225,35 @@ end
# publish.rf file is not found, the publish targets won't be defined.
load "publish.rf" if File.exist? "publish.rf"
+
+# Support Tasks ------------------------------------------------------
+
+def egrep(pattern)
+ Dir['**/*.rb'].each do |fn|
+ count = 0
+ open(fn) do |f|
+ while line = f.gets
+ count += 1
+ if line =~ pattern
+ puts "#{fn}:#{count}:#{line}"
+ end
+ end
+ end
+ end
+end
+
+desc "Look for TODO and FIXME tags in the code"
+task :todo do
+ egrep /#.*(FIXME|TODO|TBD)/
+end
+
+desc "Look for Debugging print lines"
+task :dbg do
+ egrep /\bDBG|\bbreakpoint\b/
+end
+
+desc "List all ruby files"
+task :rubyfiles do
+ puts Dir['**/*.rb'].reject { |fn| fn =~ /^pkg/ }
+ puts Dir['bin/*'].reject { |fn| fn =~ /CVS|(~$)|(\.rb$)/ }
+end

0 comments on commit b412f1a

Please sign in to comment.