hi all,
can anyone explain why this doesn’t work?
class MyBinding
def my_test
“success!”
end
end
b = MyBinding.new.instance_eval{binding}
thread = Thread.start do
$SAFE = 4
cmd = ‘my_test’
result = eval(cmd, b)
end
p thread.value
i know i can’t modify the binding object in $SAFE=4, but i thought i
could access it at least. what is an alternate approach? i am trying
to execute code in a safe(ish) way within a context of my choice.
thanks,
nick