Sha256: 73cb580265e2f98e03284531a955deeabf6c04004b1f7ddcd2f97a0190b5099a

Contents?: true

Size: 640 Bytes

Versions: 10

Compression:

Stored size: 640 Bytes

Contents

# frozen_string_literal: false
#
#   fork.rb -
#   	$Release Version: 0.9.6 $
#   	$Revision$
#   	by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
#
#


# :stopdoc:
module IRB
  module ExtendCommand
    class Fork < Nop
      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
    end
  end
end
# :startdoc:


Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
irb-1.2.4 lib/irb/cmd/fork.rb
irb-1.2.3 lib/irb/cmd/fork.rb
irb-1.2.2 lib/irb/cmd/fork.rb
irb-1.2.1 lib/irb/cmd/fork.rb
irb-1.2.0 lib/irb/cmd/fork.rb
irb-1.1.0 lib/irb/cmd/fork.rb
irb-1.1.0.pre.4 lib/irb/cmd/fork.rb
irb-1.1.0.pre.3 lib/irb/cmd/fork.rb
irb-1.1.0.pre.1 lib/irb/cmd/fork.rb
irb-1.1.0.pre.2 lib/irb/cmd/fork.rb