3 lines, codelines, total_lines, total_codelines = 0, 0, 0, 0
4 for file_name in FileList['lib/**/*.rb']
5 f = File.open(file_name)
8 next if line =~ /^\s*$/
9 next if line =~ /^\s*#/
12 puts "L: #{sprintf('%4d', lines)}, " +
13 "LOC #{sprintf('%4d', codelines)} | #{file_name}"
15 total_codelines += codelines
17 lines, codelines = 0, 0
20 puts "Total: Lines #{total_lines}, LOC #{total_codelines}"