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