diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 05:06:40 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-13 05:06:40 +0000 |
commit | e0a2dab8166d67c556ab9abc13fb673d2eee1e20 (patch) | |
tree | 17bd135273eefd78a6a495ad9b302ff693b152a9 /actionpack/Rakefile | |
parent | bf1bcff2bd16199b0dd8c25f2bcdd437f655835c (diff) | |
download | rails-e0a2dab8166d67c556ab9abc13fb673d2eee1e20.tar.gz rails-e0a2dab8166d67c556ab9abc13fb673d2eee1e20.tar.bz2 rails-e0a2dab8166d67c556ab9abc13fb673d2eee1e20.zip |
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
Diffstat (limited to 'actionpack/Rakefile')
-rwxr-xr-x | actionpack/Rakefile | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/actionpack/Rakefile b/actionpack/Rakefile index dbfaca4ded..aadcbe5eb2 100755 --- a/actionpack/Rakefile +++ b/actionpack/Rakefile @@ -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 ------------------------------------------------------ |