B
Bertram Scharpf
Hi,
do I have any possibiliy to save and restore global
and instance variables? I think of something like:
user@host$ cat l.rb
class C ; @@i = 0 ; end
$g = ""
cache_globals { load 'm.rb' }
assert $g == "" and C.instance_eval { @@i.zero? }
user@host$ cat m.rb
C.instance_eval { @@i += 99 }
$g << "foo"
user@host$
There are several workarounds, for example starting another
process. What is the smartest way to do it?
Thanks in advance.
Bertram
do I have any possibiliy to save and restore global
and instance variables? I think of something like:
user@host$ cat l.rb
class C ; @@i = 0 ; end
$g = ""
cache_globals { load 'm.rb' }
assert $g == "" and C.instance_eval { @@i.zero? }
user@host$ cat m.rb
C.instance_eval { @@i += 99 }
$g << "foo"
user@host$
There are several workarounds, for example starting another
process. What is the smartest way to do it?
Thanks in advance.
Bertram