Restart ruby program

ruby

Solution

Just run `Kernel.exec` function that will replace running process with the new one.

The advantage of `exec` function is that there's no time span when two different bots are run simultaneously. It was one process and after `exec` call it's instantly replaced with the new one.

Problem

I am writing an IRC bot and my intention is to have "!reboot" reboot the bot. I have already got it to part from a channel and break the running loop, but I cannot get it to re-run the file. It needs to start a new process and load up a new version of the file, so that any new commands etc. and configuration changes can be loaded.

Original source