diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | lib/drb/extservm.rb | 8 | ||||
-rw-r--r-- | test/drb/drbtest.rb | 3 |
3 files changed, 14 insertions, 3 deletions
@@ -1,3 +1,9 @@ +Mon Nov 8 23:38:35 2004 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp> + + * lib/drb/extservm.rb: add DRb::ExtServManager#uri=. + [ruby-dev:24743] + + Mon Nov 8 22:20:19 2004 Dave Thomas <dave@pragprog.com> * lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_class): diff --git a/lib/drb/extservm.rb b/lib/drb/extservm.rb index 50009dbae2..b649c9c006 100644 --- a/lib/drb/extservm.rb +++ b/lib/drb/extservm.rb @@ -25,8 +25,9 @@ module DRb @waiting = [] @queue = Queue.new @thread = invoke_thread + @uri = nil end - attr_reader :server + attr_accessor :uri def service(name) while true @@ -84,10 +85,11 @@ module DRb return if @servers.include?(name) @servers[name] = false end + uri = @uri || DRb.uri if RUBY_PLATFORM =~ /mswin32/ - system("cmd /c start /b #{command} #{DRb.uri} #{name}") + system("cmd /c start /b #{command} #{uri} #{name}") else - system("#{command} #{DRb.uri} #{name} &") + system("#{command} #{uri} #{name} &") end end end diff --git a/test/drb/drbtest.rb b/test/drb/drbtest.rb index 792cdcb7c7..777f88fbee 100644 --- a/test/drb/drbtest.rb +++ b/test/drb/drbtest.rb @@ -4,6 +4,8 @@ require 'drb/extservm' require 'timeout' require 'rbconfig' +DRb::DRbServer.new(nil) + class DRbService @@manager = DRb::ExtServManager.new @@ruby = File.join( @@ -17,6 +19,7 @@ class DRbService DRb::ExtServManager.command[nm] = "#{@@ruby} #{@@dir}/#{nm}" end @server = @@server = DRb::DRbServer.new(nil, @@manager, {}) + @@manager.uri = @@server.uri def self.manager @@manager end |