Line | |
---|
1 | #
|
---|
2 | # fork.rb -
|
---|
3 | # $Release Version: 0.9.5 $
|
---|
4 | # $Revision: 11708 $
|
---|
5 | # $Date: 2007-02-13 08:01:19 +0900 (Tue, 13 Feb 2007) $
|
---|
6 | # by Keiju ISHITSUKA([email protected])
|
---|
7 | #
|
---|
8 | # --
|
---|
9 | #
|
---|
10 | #
|
---|
11 | #
|
---|
12 |
|
---|
13 | @RCS_ID='-$Id: fork.rb 11708 2007-02-12 23:01:19Z shyouhei $-'
|
---|
14 |
|
---|
15 |
|
---|
16 | module IRB
|
---|
17 | module ExtendCommand
|
---|
18 | class Fork<Nop
|
---|
19 | def execute(&block)
|
---|
20 | pid = send ExtendCommand.irb_original_method_name("fork")
|
---|
21 | unless pid
|
---|
22 | class<<self
|
---|
23 | alias_method :exit, ExtendCommand.irb_original_method_name('exit')
|
---|
24 | end
|
---|
25 | if iterator?
|
---|
26 | begin
|
---|
27 | yield
|
---|
28 | ensure
|
---|
29 | exit
|
---|
30 | end
|
---|
31 | end
|
---|
32 | end
|
---|
33 | pid
|
---|
34 | end
|
---|
35 | end
|
---|
36 | end
|
---|
37 | end
|
---|
38 |
|
---|
39 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.