Different behavior of binding for 1.8 and 1.9

Ruby 1.8.x uses the receiver of #binding as self in the binding.

  Kernel.eval("self")         => Kernel
  Kernel.binding.eval("self") => Kernel
  eval("self")                => main
  binding.eval("self")        => main

Ruby 1.9.x uses the current call context as self in the binding.

  Kernel.eval("self")         => Kernel
  Kernel.binding.eval("self") => main # difference
  eval("self")                => main
  binding.eval("self")        => main

In case when we execute binding where caller is Kernel, self of binding
is 'Kernel' (this is valid for ruby 1.8). But for 1.9 self of binding
when caller is Kernel should be self from current context.

  Kernel.binding.self == self   # valid for ruby 1.9
  Kernel.binding.self == Kernel # valid for ruby 1.8

When you call #eval method, binding is created dynamically and self of
binding is in this case Kernel.