/usr/share/doc/ruby1.8-examples/examples/drb/ring_inspect.rb is in ruby1.8-examples 1.8.7.352-2ubuntu1.6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | require 'rinda/ring'
require 'drb/drb'
class Inspector
def initialize
end
def primary
Rinda::RingFinger.primary
end
def list_place
Rinda::RingFinger.to_a
end
def list(idx = -1)
if idx < 0
ts = primary
else
ts = list_place[idx]
raise "RingNotFound" unless ts
end
ts.read_all([:name, nil, nil, nil])
end
end
def main
DRb.start_service
r = Inspector.new
end
|