||An extension for dumping and loading nodes, modules and classes
||experimental, but usable
||2003-11-09 04:21:38 GMT
(Projects of this owner)
Nodewrap is Ruby module that provides direct access to Ruby's internal node structure. This isn't particularly useful in and of itself, but Node objects can be dumped and loaded using Ruby's builtin marshalling mechanism. Methods to dump and load classes and modules are also provided, and with a little work, entire class hierarchies can be dumped from one Ruby process and loaded into another.
def foo; puts "this is a test..."; end
s = Marshal.dump(Foo)
p Marshal.load(s) #=> #<Class 0lx4027be20>