1require 'drb/drb'
2require 'drb/extserv'
3
4class EvalAttack
5  def initialize
6    @four = DRb::DRbServer.new('druby://localhost:0', self, {:safe_level => 4})
7  end
8
9  def four
10    DRbObject.new_with_uri(@four.uri)
11  end
12
13  def remote_class
14    DRbObject.new(self.class)
15  end
16end
17
18
19if __FILE__ == $0
20  def ARGV.shift
21    it = super()
22    raise "usage: #{$0} <uri> <name>" unless it
23    it
24  end
25
26  $SAFE = 1
27
28  DRb.start_service('druby://localhost:0', EvalAttack.new, {:safe_level => 2})
29  es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
30  DRb.thread.join
31end
32