Skip to content

Instantly share code, notes, and snippets.

@fakenickels
Created September 16, 2012 00:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fakenickels/3730633 to your computer and use it in GitHub Desktop.
Save fakenickels/3730633 to your computer and use it in GitHub Desktop.
Count lines of a project. It scans folder( and subfolders ) files and count total lines
#!/usr/bin/ruby
require 'find'
if ARGV[0]
puts "Wait..."
Find.find( ARGV[0] ) do |f|
totalLength += IO.readlines(f).size if File.file? f
end
end
puts "\tProject total lines #{totalLength}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment