2005-04-13 11:27:09 -04:00
|
|
|
#
|
2009-03-05 22:56:38 -05:00
|
|
|
# fork.rb -
|
2009-07-07 07:36:20 -04:00
|
|
|
# $Release Version: 0.9.6 $
|
2005-04-13 11:27:09 -04:00
|
|
|
# $Revision$
|
|
|
|
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
|
|
|
|
#
|
|
|
|
# --
|
|
|
|
#
|
2009-03-05 22:56:38 -05:00
|
|
|
#
|
2005-04-13 11:27:09 -04:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2012-12-13 00:22:30 -05:00
|
|
|
# :stopdoc:
|
2002-07-09 07:17:17 -04:00
|
|
|
module IRB
|
|
|
|
module ExtendCommand
|
|
|
|
class Fork<Nop
|
* ext/pathname/lib/pathname.rb, ext/tk/lib/multi-tk.rb,
ext/tk/sample/demos-en/widget, lib/benchmark.rb, lib/irb/cmd/fork.rb,
lib/mkmf.rb, lib/net/ftp.rb, lib/net/smtp.rb, lib/open3.rb,
lib/pstore.rb, lib/rexml/element.rb, lib/rexml/light/node.rb,
lib/rinda/tuplespace.rb, lib/rss/maker/base.rb,
lib/rss/maker/entry.rb, lib/scanf.rb, lib/set.rb, lib/shell.rb,
lib/shell/command-processor.rb, lib/shell/process-controller.rb,
lib/shell/system-command.rb, lib/uri/common.rb: remove unused block
arguments to avoid creating Proc objects.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33638 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2011-11-05 03:37:47 -04:00
|
|
|
def execute
|
2014-08-08 21:36:49 -04:00
|
|
|
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
|
2002-07-09 07:17:17 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2012-12-13 00:22:30 -05:00
|
|
|
# :startdoc:
|
2002-07-09 07:17:17 -04:00
|
|
|
|
|
|
|
|