source: extensions/gsdl-video/trunk/installed/cmdline/lib/ruby/1.8/drb/invokemethod.rb@ 18425

Last change on this file since 18425 was 18425, checked in by davidb, 15 years ago

Video extension to Greenstone

File size: 775 bytes
Line 
1# for ruby-1.8.0
2
3module DRb
4 class DRbServer
5 module InvokeMethod18Mixin
6 def block_yield(x)
7 if x.size == 1 && x[0].class == Array
8 x[0] = DRbArray.new(x[0])
9 end
10 block_value = @block.call(*x)
11 end
12
13 def perform_with_block
14 @obj.__send__(@msg_id, *@argv) do |*x|
15 jump_error = nil
16 begin
17 block_value = block_yield(x)
18 rescue LocalJumpError
19 jump_error = $!
20 end
21 if jump_error
22 case jump_error.reason
23 when :retry
24 retry
25 when :break
26 break(jump_error.exit_value)
27 else
28 raise jump_error
29 end
30 end
31 block_value
32 end
33 end
34 end
35 end
36end
Note: See TracBrowser for help on using the repository browser.