Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 35 lines (30 sloc) 526 Bytes
#!/usr/bin/env ruby
require 'rubygems'
require 'drb'
class Client
def initialize
@repl = DRbObject.new nil, 'druby://:9000'
end
def run
line = ARGV.join(' ')
begin
@repl.run(line)
ret = @repl.result
rescue DRb::DRbConnError => e
ret = "XRasp server unavailable."
rescue => e
ret = "#{e.class}: #{e.message}\n"
ret += e.backtrace if e.backtrace
end
puts "#{ARGV.join(' ')} => #{ret}"
end
end
begin
client = Client.new
client.run
rescue SystemExit
exit
rescue Interrupt
puts
exit
end