diff options
author | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-07-09 11:17:17 +0000 |
---|---|---|
committer | keiju <keiju@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-07-09 11:17:17 +0000 |
commit | af064b04b1622897995fe1177aabfb60db90e6f7 (patch) | |
tree | 326cb343c08c55d2d93fa5223c01f940d3591f8b /lib/irb/cmd/fork.rb | |
parent | 93602810e93b5da1c7161fb4b5c1a4025434a9ce (diff) | |
download | ruby-af064b04b1622897995fe1177aabfb60db90e6f7.tar.gz |
* irb 0.9
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2627 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/irb/cmd/fork.rb')
-rw-r--r-- | lib/irb/cmd/fork.rb | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/irb/cmd/fork.rb b/lib/irb/cmd/fork.rb new file mode 100644 index 0000000000..1cc4458b13 --- /dev/null +++ b/lib/irb/cmd/fork.rb @@ -0,0 +1,25 @@ + +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 + + |