Created
March 6, 2012 23:57
-
-
Save localshred/1989914 to your computer and use it in GitHub Desktop.
1.9.3 changes the behavior of "rescue else" in a method from previous ruby versions. A return in the method body will not trigger the else.
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
>> hmm | |
hello | |
I got here | |
in ensure |
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
>> hmm | |
hello | |
in ensure |
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
def hmm | |
puts 'hello' | |
return | |
rescue | |
puts 'in rescue' | |
else | |
puts 'I got here' | |
ensure | |
puts 'in ensure' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment