diff options
author | Santiago Pastorino <santiago@wyeworks.com> | 2012-01-29 11:30:37 -0800 |
---|---|---|
committer | Santiago Pastorino <santiago@wyeworks.com> | 2012-01-29 11:30:37 -0800 |
commit | dfa0c36204beb1b519962a6a49a1ebbed91015dd (patch) | |
tree | 2794ed0b8dd33458d2509ddd974519df9f561c8b /activerecord/Rakefile | |
parent | 677e06c20f6df6c44f44af9ba95390558e67a9bc (diff) | |
parent | bf928bc7329640969917eb680da4de959b7156b7 (diff) | |
download | rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.tar.gz rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.tar.bz2 rails-dfa0c36204beb1b519962a6a49a1ebbed91015dd.zip |
Merge pull request #4744 from ndbroadbent/replace_for_loops_with_enumerables
Replaced all 'for' loops with Enumerable#each
Diffstat (limited to 'activerecord/Rakefile')
-rwxr-xr-x | activerecord/Rakefile | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/activerecord/Rakefile b/activerecord/Rakefile index d769a73dba..98020ad3ab 100755 --- a/activerecord/Rakefile +++ b/activerecord/Rakefile @@ -187,15 +187,15 @@ end task :lines do lines, codelines, total_lines, total_codelines = 0, 0, 0, 0 - for file_name in FileList["lib/active_record/**/*.rb"] + 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}" |