repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
history
|
raw
|
HEAD
* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git]
/
sample
/
drb
/
gw_ct.rb
blob
062278401839c3a9fcdb36874c2ae5c20f2f396c
1
require 'drb/drb'
2
3
class Foo
4
include DRbUndumped
5
6
def foo(n)
7
n + n
8
end
9
10
def bar(n)
11
yield(n) + yield(n)
12
end
13
end
14
15
DRb.start_service(nil)
16
puts DRb.uri
17
18
ro = DRbObject.new(nil, ARGV.shift)
19
ro[:tcp] = Foo.new
20
gets
21
22
it = ro[:unix]
23
p [it, it.foo(1)]
24
gets
25
26
p it.bar('2') {|n| n * 3}
27
gets
28
29