class IRB::JobManager
def switch(key)
If the given irb session is already active, an IrbSwitchedToCurrentThread
Raises an IrbAlreadyDead exception if the given +key+ is no longer alive.
Array.
Changes the current active irb session to the given +key+ in the jobs
def switch(key) th, irb = search(key) fail IrbAlreadyDead unless th.alive? fail IrbSwitchedToCurrentThread if th == Thread.current @current_job = irb th.run Thread.stop @current_job = irb(Thread.current) end