#!/usr/bin/env ruby require 'rubygems' $LOAD_PATH.unshift(File.dirname(__FILE__) + '/../lib') unless $LOAD_PATH.include?(File.dirname(__FILE__) + '/../lib') require 'drbproxy' require 'drbproxy/server' args = ARGV raise ArgumentError, "expected array of args" unless args.is_a?(Array) @options = {} opt = OptionParser.new opt.banner = "Usage: drbserver [options]\n\n" opt.separator "Options:" opt.on("-f", "--file [FILE]") {|file| @options[:file] = file } opt.on("-d", "--debug") {|ignore| @options[:debug] = true } # opt.on("-p", "--port [PORT]") {|port| @options[:port] = port } opt.parse!(args) if @options[:file] require @options[:file] end DRb.start_service(DRbProxy::DRB_URI, DRbProxy::Server.new(@options)) puts "DRbProxy started: #{DRb.uri}" # Wait for the drb server thread to finish before exiting. DRb.thread.join