mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
3407b7d8a6
This reverts commit 4dba0c1a8e
.
Matz's comment is "send is not deprecated. __send__ is safer".
But "Prefer #send over #__send__" is not reasonable.
37 lines
642 B
Ruby
37 lines
642 B
Ruby
# 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:
|