2015-12-16 00:07:31 -05:00
|
|
|
# frozen_string_literal: false
|
2011-06-27 11:18:22 -04:00
|
|
|
require 'drb/drb'
|
|
|
|
require 'drb/extserv'
|
|
|
|
|
2014-05-31 23:07:58 -04:00
|
|
|
module DRbTests
|
|
|
|
|
2011-06-27 11:18:22 -04:00
|
|
|
class Foo
|
|
|
|
include DRbUndumped
|
|
|
|
end
|
|
|
|
|
|
|
|
class Bar
|
|
|
|
include DRbUndumped
|
|
|
|
def initialize
|
|
|
|
@foo = Foo.new
|
|
|
|
end
|
|
|
|
attr_reader :foo
|
2011-06-28 23:35:48 -04:00
|
|
|
|
2011-06-27 11:18:22 -04:00
|
|
|
def foo?(foo)
|
|
|
|
@foo == foo
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2014-05-31 23:07:58 -04:00
|
|
|
end
|
|
|
|
|
2011-06-27 11:18:22 -04:00
|
|
|
if __FILE__ == $0
|
|
|
|
def ARGV.shift
|
|
|
|
it = super()
|
|
|
|
raise "usage: #{$0} <uri> <name>" unless it
|
|
|
|
it
|
|
|
|
end
|
|
|
|
|
2014-05-31 23:07:58 -04:00
|
|
|
DRb.start_service('druby://localhost:0', DRbTests::Bar.new)
|
2014-02-06 20:54:40 -05:00
|
|
|
es = DRb::ExtServ.new(ARGV.shift, ARGV.shift)
|
2011-06-27 11:18:22 -04:00
|
|
|
DRb.thread.join
|
2014-02-06 20:54:40 -05:00
|
|
|
es.stop_service if es.alive?
|
2011-06-27 11:18:22 -04:00
|
|
|
end
|
2014-05-31 23:07:58 -04:00
|
|
|
|