2002-07-09 11:17:17 +00:00
|
|
|
|
|
|
|
module IRB
|
|
|
|
module ExtendCommand
|
|
|
|
class Fork<Nop
|
|
|
|
def execute(&block)
|
2003-10-16 17:47:19 +00:00
|
|
|
pid = send(ExtendCommand.irb_original_method_name("fork"))
|
2002-07-09 11:17:17 +00:00
|
|
|
unless pid
|
|
|
|
class<<self
|
|
|
|
alias_method :exit, ExtendCommand.irb_original_method_name('exit')
|
|
|
|
end
|
|
|
|
if iterator?
|
|
|
|
begin
|
|
|
|
yield
|
|
|
|
ensure
|
|
|
|
exit
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
pid
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|