Last active
August 29, 2015 14:15
-
-
Save DuckOfDoom/2e7e18958bc6c2d73a68 to your computer and use it in GitHub Desktop.
Line counter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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