Skip to content

Instantly share code, notes, and snippets.

@ploubser
Created November 4, 2013 17:42
Show Gist options
  • Save ploubser/7306395 to your computer and use it in GitHub Desktop.
Save ploubser/7306395 to your computer and use it in GitHub Desktop.
require "timeout"
require "systemu"
begin
Timeout::timeout(1) do
systemu("ruby -e 'loop{}'", {}){}
# IO.popen("ruby -e \"exec \"sleep 5\"\"", {}) do |thing|
# puts thing.read
# end
end
rescue Timeout::Error
puts "Timeout"
end
~
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment