Created
May 31, 2011 21:02
-
-
Save leobessa/1001280 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
module RaiseExit | |
def raise(msg_or_exc, msg=msg_or_exc, trace=caller) | |
warn msg.to_s | |
exit! | |
end | |
end | |
class Object | |
include RaiseExit | |
end | |
begin | |
raise "TooLazyToWork" | |
rescue | |
puts "executing rescue" | |
ensure | |
puts "executing ensure" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Considering the ruby method lookup
instead of including RaiseExit in the Kernel module...
it should be included in the Object class.