Skip to content

Instantly share code, notes, and snippets.

@localshred
Created March 6, 2012 23:57
Show Gist options
  • Save localshred/1989914 to your computer and use it in GitHub Desktop.
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.
>> hmm
hello
I got here
in ensure
>> hmm
hello
in ensure
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