Class: IRB::ExtendCommand::Fork

Inherits:
Nop show all
Defined in:
lib/irb/cmd/fork.rb

Instance Attribute Summary

Attributes inherited from Nop

#irb_context

Instance Method Summary collapse

Methods inherited from Nop

execute, #initialize, #irb

Constructor Details

This class inherits a constructor from IRB::ExtendCommand::Nop

Instance Method Details

#executeObject



18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/irb/cmd/fork.rb', line 18

def execute
  pid = __send__ ExtendCommand.irb_original_method_name("fork")
  unless pid
    class << self
      alias_method :exit, ExtendCommand.irb_original_method_name('exit')
    end
    if block_given?
      begin
        yield
      ensure
        exit
      end
    end
  end
  pid
end