Skip to content

Instantly share code, notes, and snippets.

@DuckOfDoom
Last active August 29, 2015 14:15
Show Gist options
  • Save DuckOfDoom/2e7e18958bc6c2d73a68 to your computer and use it in GitHub Desktop.
Save DuckOfDoom/2e7e18958bc6c2d73a68 to your computer and use it in GitHub Desktop.
Line counter
dirs = Dir.glob('**/Assets/Scripts') + Dir.glob('**/Assets/Tests')
files = []
dirs.each do |d|
files.concat(Dir.glob( File.join(d, '**', '*.cs')))
end
filesCount = files.length
linesCount = 0
files.each do |f|
linesCount += IO.readlines(f).length
end
puts "#{linesCount} lines total in #{filesCount} files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment