diff options
-rwxr-xr-x | actionpack/Rakefile | 14 | ||||
-rwxr-xr-x | activerecord/Rakefile | 14 |
2 files changed, 14 insertions, 14 deletions
diff --git a/actionpack/Rakefile b/actionpack/Rakefile index 75d16ceb05..bb1e704767 100755 --- a/actionpack/Rakefile +++ b/actionpack/Rakefile @@ -57,13 +57,13 @@ task :lines do FileList["lib/**/*.rb"].each do |file_name| 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 + 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}" diff --git a/activerecord/Rakefile b/activerecord/Rakefile index e7d74b4f3e..98020ad3ab 100755 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -189,13 +189,13 @@ task :lines do FileList["lib/active_record/**/*.rb"].each do |file_name| 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 + 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}" |