Skip to content

Instantly share code, notes, and snippets.

@ebeigarts
Created August 23, 2011 14:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ebeigarts/1165255 to your computer and use it in GitHub Desktop.
Save ebeigarts/1165255 to your computer and use it in GitHub Desktop.
#!/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
@ebeigarts
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment