1

Is there a way in ruby to store the present (runtime ) environment in Ruby so that I can load from another program and "pick up where I left off?"

  • This might be possible in Rubinius or JRuby, but I don't believe its possible to marshal the entire program context in standard Ruby. It would be useful to know what exactly you're trying to do - it's possible you don't need to go this far. – Zach Kemp Jun 14 '13 at 17:36
  • I am debugging a program which works on large datasets where the bugs do not show up when small data sets are used for testing. I would like to save the processing of early parts of the program I know are correct to save time when debugging later parts. – Mouse.The.Lucky.Dog Jun 14 '13 at 17:39
  • I would have a look at [Drb](http://www.ruby-doc.org/stdlib-1.9.3/libdoc/drb/rdoc/DRb.html), a standard library module that lets you essentially fork processes by passing objects back and forth between different ruby processes. How useful it would be for you depends on how you've designed your application - it works well for object oriented designs (it's very useful for testing Rails apps without having to load the entire environment for every execution). – Zach Kemp Jun 14 '13 at 17:53

1 Answers1

0

This depends on which Ruby environment you use. It works in SmallRuby, for example, but AFAIK SmallRuby was never finished. It might also work in MagLev. I don't know of any other Ruby environment where it works.

Jörg W Mittag
  • 363,080
  • 75
  • 446
  • 653