Permalink
Browse files

Added KLOC counter for AR and AP. Combined theyre at ~9KLOC

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent bf1bcff commit e0a2dab8166d67c556ab9abc13fb673d2eee1e20 @dhh dhh committed Apr 13, 2005
Showing with 48 additions and 0 deletions.
  1. +24 −0 actionpack/Rakefile
  2. +24 −0 activerecord/Rakefile
View
@@ -80,6 +80,30 @@ Rake::GemPackageTask.new(spec) do |p|
p.need_zip = true
end
+task :lines do
+ lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
+
+ for file_name in FileList["lib/**/*.rb"]
+ next if file_name =~ /vendor/
+ f = File.open(file_name)
+
+ while line = f.gets
+ lines += 1
+ next if line =~ /^\s*$/
+ next if line =~ /^\s*#/
+ codelines += 1
+ end
+ puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
+
+ total_lines += lines
+ total_codelines += codelines
+
+ lines, codelines = 0, 0
+ end
+
+ puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
+end
+
# Publishing ------------------------------------------------------
View
@@ -101,6 +101,30 @@ Rake::GemPackageTask.new(spec) do |p|
p.need_zip = true
end
+task :lines do
+ lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
+
+ for file_name in FileList["lib/active_record/**/*.rb"]
+ next if file_name =~ /vendor/
+ f = File.open(file_name)
+
+ while line = f.gets
+ lines += 1
+ next if line =~ /^\s*$/
+ next if line =~ /^\s*#/
+ codelines += 1
+ end
+ puts "L: #{sprintf("%4d", lines)}, LOC #{sprintf("%4d", codelines)} | #{file_name}"
+
+ total_lines += lines
+ total_codelines += codelines
+
+ lines, codelines = 0, 0
+ end
+
+ puts "Total: Lines #{total_lines}, LOC #{total_codelines}"
+end
+
# Publishing ------------------------------------------------------

0 comments on commit e0a2dab

Please sign in to comment.