From b9e0073b4152b04bbdaf5b23e30651d506fd0ab8 Mon Sep 17 00:00:00 2001 From: Arun Agrawal Date: Fri, 22 May 2015 14:37:02 +0200 Subject: Remove custom `lines` and use `/tools/line_statistics` --- actionview/Rakefile | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) (limited to 'actionview/Rakefile') 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 -- cgit v1.2.3