2005-04-13 15:27:09 +00:00
|
|
|
#
|
2009-03-06 03:56:38 +00:00
|
|
|
# fork.rb -
|
2009-07-07 11:36:20 +00:00
|
|
|
# $Release Version: 0.9.6 $
|
2005-04-13 15:27:09 +00:00
|
|
|
# $Revision$
|
|
|
|
# by Keiju ISHITSUKA(keiju@ruby-lang.org)
|
|
|
|
#
|
|
|
|
# --
|
|
|
|
#
|
2009-03-06 03:56:38 +00:00
|
|
|
#
|
2005-04-13 15:27:09 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
@RCS_ID='-$Id$-'
|
|
|
|
|
2002-07-09 11:17:17 +00: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 07:37:47 +00:00
|
|
|
def execute
|
2005-04-13 15:27:09 +00:00
|
|
|
pid = send ExtendCommand.irb_original_method_name("fork")
|
2009-03-06 03:56:38 +00:00
|
|
|
unless pid
|
2010-05-23 08:48:44 +00:00
|
|
|
class << self
|
2002-07-09 11:17:17 +00:00
|
|
|
alias_method :exit, ExtendCommand.irb_original_method_name('exit')
|
|
|
|
end
|
|
|
|
if iterator?
|
|
|
|
begin
|
|
|
|
yield
|
|
|
|
ensure
|
|
|
|
exit
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
pid
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|