Skip to content

Commit

Permalink
Merge pull request #20263 from arunagw/aa-remove-custom-lines-actionview
Browse files Browse the repository at this point in the history
Remove custom `lines` and use `/tools/line_statistics`
  • Loading branch information
rafaelfranca committed May 28, 2015
2 parents 8cc5150 + b9e0073 commit be18476
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions actionview/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -52,25 +52,7 @@ Gem::PackageTask.new(spec) do |p|
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

0 comments on commit be18476

Please sign in to comment.