Skip to content

Instantly share code, notes, and snippets.

Created June 5, 2015 16:32
Show Gist options
  • Save anonymous/477d4fa51d08aee72121 to your computer and use it in GitHub Desktop.
Save anonymous/477d4fa51d08aee72121 to your computer and use it in GitHub Desktop.
%w[QUIT INT].each do |signal_name|
Signal.trap(signal_name) do |signal_number|
Thread.new {
puts Signal.signame(signal_number)
close_logger
bot.quit('So long and thanks for all the fish.')
exit 0
}.join
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment