Skip to content

Instantly share code, notes, and snippets.

@hsbt
Created February 12, 2019 13:41
Show Gist options
  • Save hsbt/c760a01d06a81bb17dbc8fe84997c348 to your computer and use it in GitHub Desktop.
Save hsbt/c760a01d06a81bb17dbc8fe84997c348 to your computer and use it in GitHub Desktop.
require 'find'
require 'open3'
Dir.glob("latest-gem/*") do |dir|
Find.find(dir) do |fn|
next unless File.file? fn
_, _, _, wait_thr = *Open3.popen3("ruby -c #{fn}")
if wait_thr.value.exitstatus != 0
puts fn
File.unlink fn
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment