Skip to content

Instantly share code, notes, and snippets.

@jjb
Created January 23, 2020 22:35
Show Gist options
  • Save jjb/e34b94d8b8da6cc4f68d7b28118e1a8f to your computer and use it in GitHub Desktop.
Save jjb/e34b94d8b8da6cc4f68d7b28118e1a8f to your computer and use it in GitHub Desktop.
lines = `find . -name '*.rb'`.split("\n")
problems = []
lines.each_slice(100) do |slice|
threads = []
slice.each do |l|
threads << Thread.new do
result = `ruby -c #{l}`
if "Syntax OK" == result.strip
print "."
else
print "!"
problems << l
end
end
end
threads.each{|t| t.join }
end
puts "problems:\n#{problems}" unless 0 == problems.size
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment