diff options
Diffstat (limited to 'scripts/context/ruby/base/kpseremote.rb')
-rw-r--r-- | scripts/context/ruby/base/kpseremote.rb | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/scripts/context/ruby/base/kpseremote.rb b/scripts/context/ruby/base/kpseremote.rb index f1f3cb10f..d66e40e6f 100644 --- a/scripts/context/ruby/base/kpseremote.rb +++ b/scripts/context/ruby/base/kpseremote.rb @@ -1,12 +1,12 @@ require 'base/kpsefast' -class KpseRemote +case ENV['KPSEMETHOD'] + when /soap/o then require 'base/kpse/soap' + when /drb/o then require 'base/kpse/drb' + else require 'base/kpse/drb' +end - case ENV['KPSEMETHOD'] - when /soap/o then require 'base/kpse/soap' - when /drb/o then require 'base/kpse/drb' - else require 'base/kpse/drb' - end +class KpseRemote @@port = ENV['KPSEPORT'] || 7000 @@ -34,9 +34,13 @@ class KpseRemote end def initialize(port=nil) - begin - @kpse, @tree = KpseRemote::start_client(port) - rescue + if KpseRemote::available? then + begin + @kpse, @tree = KpseRemote::start_client(port) + rescue + @kpse, @tree = nil, nil + end + else @kpse, @tree = nil, nil end end |