aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/Rakefile
diff options
context:
space:
mode:
authorArun Agrawal <arunagw@gmail.com>2015-05-22 14:37:02 +0200
committerArun Agrawal <arunagw@gmail.com>2015-05-22 16:35:08 +0200
commitb9e0073b4152b04bbdaf5b23e30651d506fd0ab8 (patch)
tree34428d1ff8ca9a7cf81f15892266368ae520ddbf /actionview/Rakefile
parent1214f0b74f6b2910b3f0cdbd1410d0e507e99654 (diff)
downloadrails-b9e0073b4152b04bbdaf5b23e30651d506fd0ab8.tar.gz
rails-b9e0073b4152b04bbdaf5b23e30651d506fd0ab8.tar.bz2
rails-b9e0073b4152b04bbdaf5b23e30651d506fd0ab8.zip
Remove custom `lines` and use `/tools/line_statistics`
Diffstat (limited to 'actionview/Rakefile')
-rw-r--r--actionview/Rakefile24
1 files changed, 3 insertions, 21 deletions
diff --git a/actionview/Rakefile b/actionview/Rakefile
index 2b752b83df..8190b3c027 100644
--- a/actionview/Rakefile
+++ b/actionview/Rakefile
@@ -59,25 +59,7 @@ task :release => :package do
end
task :lines do
- lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
-
- FileList["lib/**/*.rb"].each do |file_name|
- next if file_name =~ /vendor/
- File.open(file_name, 'r') do |f|
- while line = f.gets
- lines += 1
- next if line =~ /^\s*$/
- next if line =~ /^\s*#/
- codelines += 1
- end
- 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}"
+ load File.expand_path('..', File.dirname(__FILE__)) + '/tools/line_statistics'
+ files = FileList["lib/**/*.rb"]
+ CodeTools::LineStatistics.new(files).print_loc
end