Just a little Rubinius trick

Published September 3, 2008

Rubinius can do it all.

def pwn_locals
  MethodContext.current.sender.locals[0] = 666
end

a = 8
pwn_locals
puts a
# => 666

Isn't that just awesome?