The following is wrong. Only read the rest of this reply if you want to see how dumb I am.
This is not a bug.
"a = 5 unless defined? a" is not meant to be equivalent to this:
unless defined? a
a = 5
end
It is supposed to be (and is) equivalent to this:
a = unless defined? a
5
end*