In the following function:
def outer
puts "open"
proc{ return 42 }.call
ensure
puts "close"
end
the ensure block is not executed in this case, as it is with CRuby and JRuby.
Replacing the proc with just return 42 behaves as expected. So does exiting via a block argument, like this:
def inner(&block)
puts "open"
return block.call
ensure
puts "close"
end
def outer
inner { return 42 }
end
outer()