require 'sandbox' require 'pp' module Interface def self.mputs(*s) puts(*s) end end box=Sandbox.safe pp box box.ref Interface box.eval("def self.a;\nInterface::mputs 123\nend\n self.a") box.eval('self.a') normal=Sandbox.new normal.eval("a=12") pp normal.eval("a") s=Sandbox.safe s.eval("a=12") pp s.eval("a") s=Sandbox.safe s.ref Interface s.eval("$a=12") pp s.eval("$a")