adapted to ruby 2.0 not accepting eval with proc instead of binding