Created
August 23, 2011 14:23
-
-
Save ebeigarts/1165255 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/ruby | |
at_exit do | |
raise "X" rescue nil | |
end | |
at_exit do | |
nil | |
end | |
at_exit do | |
exit 1 | |
end | |
at_exit do | |
exit 2 | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ruby 1.9.4dev (2011-08-23 trunk 33027) [x86_64-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
0
ruby 1.9.3dev (2011-07-31 revision 32789) [x86_64-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
0
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
0
ruby 1.8.7 (2011-06-30 patchlevel 352) [i686-darwin10.8.0]
$ ruby at_exit.rb ; echo $?
1
jruby 1.6.3 (ruby-1.8.7-p330) (2011-07-07 965162f) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [darwin-x86_64-java]
$ jruby at_exit.rb ; echo $?
1
jruby 1.6.3 (ruby-1.9.2-p136) (2011-07-07 965162f) (Java HotSpot(TM) 64-Bit Server VM 1.6.0_26) [darwin-x86_64-java]
$ jruby --1.9 at_exit.rb ; echo $?
1