Class: S41C::Sandbox
Overview
:nodoc
Instance Method Summary collapse
-
#eval_code ⇒ Object
:nodoc.
-
#initialize(ole, dump) ⇒ Sandbox
constructor
:nodoc.
Methods included from Utils
Constructor Details
#initialize(ole, dump) ⇒ Sandbox
:nodoc
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/s41c/sandbox.rb', line 10 def initialize(ole, dump) @ole = ole dump.untaint hsh = Marshal.load(dump) @vars = hsh[:vars] @code = proc { $SAFE = 3 instance_eval hsh[:code], __FILE__, __LINE__ } end |
Instance Method Details
#eval_code ⇒ Object
:nodoc
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/s41c/sandbox.rb', line 22 def eval_code begin @code.call rescue WIN32OLERuntimeError => e "Error: #{to_utf8(e.)}" rescue Exception => e "Error: #{e.}" rescue => e "Error: #{e.} from #{__FILE__}:#{__LINE__}" end end |