# MRI will exit on ^C, but no dice on Rubinius: we swallow all exceptions in the signal thread
trap('INT') { raise Interrupt, nil }
loop do
begin
sleep 5
rescue Interrupt
puts "kapow!"
exit
end
end
|
Pastie
Support Pastie
or read my
Pastie << self
blog
# MRI will exit on ^C, but no dice on Rubinius: we swallow all exceptions in the signal thread
trap('INT') { raise Interrupt, nil }
loop do
begin
sleep 5
rescue Interrupt
puts "kapow!"
exit
end
end
|