From: "ako..." Date: 2005-12-08T16:52:35+09:00 Subject: Re: code execution from file? putting aside security issues i think i was able to isolate my environment and pass only desired variables in to the code. i create a temporary module and evaluate my code in its context. then i remove this module (that is why i needed the external module A, i could not figure out how to remove a module otherwise). experts, does this look feasible? i do not know though what to do to ensure security... thanks konstantin module A x = 'x' y = 'y' module T class << self def get_binding(p) binding end end end # eval('puts x', T.get_binding(x)) -> # fails puts eval('"variable #{p}"', T.get_binding(x)) remove_const :T #puts eval('"variable #{p}"', T.get_binding(x)) -> # fails end