Created
March 9, 2013 11:36
-
-
Save davekonopka/5123917 to your computer and use it in GitHub Desktop.
Ruby at_exit bug:
http://bugs.ruby-lang.org/issues/5218
This file contains 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
if defined?(RUBY_ENGINE) && RUBY_ENGINE == "ruby" && RUBY_VERSION >= "1.9" | |
module Kernel | |
alias :__at_exit :at_exit | |
def at_exit(&block) | |
__at_exit do | |
exit_status = $!.status if $!.is_a?(SystemExit) | |
block.call | |
exit exit_status if exit_status | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment