Given code:
foo2 = 'dummy2'
result = begin
foo = 'dummy'
foo
ensure
foo = foo2
end
puts result, result.class
It works differently under MRI 2.2.1 and JRuby 9.0.1.0:
MRI 2.2.1:
JRuby 9.0.1.0:
Most cases this won't be problem, but when you want to execute a block of code with a variable temporarily set to another values using the begin....ensure technique, you will get unwanted result. For example, tilt will not be able process erb files with JRuby due to this.