-
-
Save wuputah/66735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
begin | |
sleep(1000) | |
rescue Exception | |
raise "Oh how awful, I was sleeping here!" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby 1.rb & | |
[1] 70877 | |
$ kill -TERM %1 | |
test.rb:4: Oh how awful, I was sleeping here! (RuntimeError) | |
[1]+ Exit 1 ruby test.rb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trap('TERM') { Kernel.exit! } | |
begin | |
sleep(1000) | |
rescue Exception | |
raise "Oh how awful, I was sleeping here!" | |
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ruby test.rb & | |
[1] 70966 | |
$ kill -TERM %1 | |
[1]+ Exit 1 ruby test.rb |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment