Created
October 23, 2014 10:58
-
-
Save sonsongithub/f5e7090478df06f403b1 to your computer and use it in GitHub Desktop.
line counter for itch
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
#!/usr/bin/env ruby | |
paths = [] | |
paths.push(ARGV[0] + "/**/*.h") | |
paths.push(ARGV[0] + "/**/*.m") | |
blacklist = ["/imobile/", "/nend/", "/Google/", "/Evernote/", "/admob/", "/TestFlight/", "/UICoderz/"] | |
lines = 0 | |
files = 0 | |
paths.each{|path| | |
Dir::glob(path).each {|f| | |
flag = false | |
blacklist.each{|blackpath| | |
if f =~ /#{blackpath}/ | |
flag = true | |
break | |
end | |
} | |
if flag == false | |
result = `wc -l #{f}` | |
elements = result.split(" ") | |
lines = lines + elements[0].to_i | |
files = files + 1 | |
end | |
} | |
} | |
puts lines | |
puts files | |
puts `git rev-list #{ARGV[0]} HEAD --count` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment