One change I made that could have future repercussions is to temporarily redirect stdout to a buffer (see line 815 in the patched file) while executing a second ruby script in-process (this is required since you need to capture the output of the script executed via Kernel#backtick). This works fine for a single threaded script but might cause problems if multiple threads start executing additional scripts concurrently. There doesn't appear to be an easy fix to this but as I'm new to the code I might have missed something.
Marc. --- Marc Hadley <marc.hadley at sun.com>
exec_ruby_scripts_in_process.patch
Description: Binary data