aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/Rakefile
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-28 01:10:47 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-05-28 01:10:47 -0300
commitbe18476fb24ef21a956e79143b6bcde3ec744a64 (patch)
tree895f8254ede600e9c14fca3fffe5aa4067b20efc /actionview/Rakefile
parent8cc515006568600095e2b1e33a935ff029f24bdf (diff)
parentb9e0073b4152b04bbdaf5b23e30651d506fd0ab8 (diff)
downloadrails-be18476fb24ef21a956e79143b6bcde3ec744a64.tar.gz
rails-be18476fb24ef21a956e79143b6bcde3ec744a64.tar.bz2
rails-be18476fb24ef21a956e79143b6bcde3ec744a64.zip
Merge pull request #20263 from arunagw/aa-remove-custom-lines-actionview
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 4ecc9c6c6c..2b884bf2a0 100644
--- a/actionview/Rakefile
+++ b/actionview/Rakefile
@@ -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