Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 42 lines (37 sloc) 0.656 kb
#!/usr/bin/env ruby
require 'rubygems'
require 'drb'
load File.join(File.dirname(__FILE__), "lib", "input_handler.rb")
class Client
def initialize
@repl = DRbObject.new nil, 'druby://:9000'
@input_handler = InputHandler.new
end
def run
loop do
print ">> "
line = @input_handler.getline
begin
@repl.run(line)
ret = @repl.result
rescue DRb::DRbConnError => e
puts "Server disconnected"
exit
rescue => e
puts "#{e.class}: #{e.message}"
puts e.backtrace if e.backtrace
next
end
puts ret
end
end
end
begin
client = Client.new
client.run
rescue SystemExit
exit
rescue Interrupt
puts
exit
end
Jump to Line
Something went wrong with that request. Please try again.