Several possibilities, one simple, perhaps less.
First, could you put irb execution in a loop / shell script file? Then your reboot will become a simple exit , and the script will bounce back and run your Ruby file again. If another file is used, the name (or path) can be placed in the environment variable before exiting.
Alternatively, could you call eval your rewritten script argument? This is one of the methods used by Giles Bowkett Archaeopteryx - change the code and save it, then (in this case) selects a synchronized loop to update the new code and start it using eval .
source share