Skip to content

Instantly share code, notes, and snippets.

@jbury
Created February 28, 2015 00:42
Show Gist options
  • Save jbury/a6b299c6eb7c91e879c4 to your computer and use it in GitHub Desktop.
Save jbury/a6b299c6eb7c91e879c4 to your computer and use it in GitHub Desktop.
if ARGV.length != 1
puts "I need the path to the files. No more, no less."
exit
end
unless File.directory?(ARGV[0])
puts "That directory, #{ARGV[0]}, doesn't exist... Try again."
exit
end
gameDir=ARGV[0]
goodGames = Array.new
remainingGames = Dir.entries(gameDir)
puts remainingGames.length
remainingGames.each { |game|
if game.include? "[!]"
goodGames << game
remainingGames.delete(game)
end }
puts remainingGames.length
puts goodGames.length
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment