Sha256: c3b7b17853b71822a10900688b7295f29a0e9bab42a3522c96becb0ac6f4d64d

Contents?: true

Size: 623 Bytes

Versions: 3

Compression:

Stored size: 623 Bytes

Contents

#
#   fork.rb - 
#   	$Release Version: 0.9.5 $
#   	$Revision: 11708 $
#   	$Date: 2007-02-12 15:01:19 -0800 (Mon, 12 Feb 2007) $
#   	by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
#   
#

@RCS_ID='-$Id: fork.rb 11708 2007-02-12 23:01:19Z shyouhei $-'


module IRB
  module ExtendCommand
    class Fork<Nop
      def execute(&block)
	pid = send ExtendCommand.irb_original_method_name("fork")
	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


Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rubysl-irb-1.0.2 lib/irb/cmd/fork.rb
rubysl-irb-1.0.1 lib/irb/cmd/fork.rb
rubysl-irb-1.0.0 lib/irb/cmd/fork.rb