Sha256: 72d1410595aa92804867ab1efe97ac19c079717f338d2232c6038190a7602ebc

Contents?: true

Size: 1.83 KB

Versions: 7

Compression:

Stored size: 1.83 KB

Contents

#!/usr/bin/env ruby
require 'rubygems'
require 'controller'
require 'provider'
require 'optparse'

options = {}
OptionParser.new do |opts|
  opts.banner = "Usage: controller [options]"
  opts.separator ""
  opts.separator "Specific options:"
  opts.on("-H", "--drb-server-host [HOST]", String,
  "Specify DRb Server interface to host on") do |h|
    options[:drb_server_host] = h || nil
  end
  opts.on("-d", "--drb-server-port [PORT]", Integer,
    "Specify DRb Server port to listen on") do |d|
      options[:drb_server_port] = d
  end
  opts.on("-h", "--ring-server-host [HOST]", String,
  "Specify Ring Server interface to host on") do |h|
    options[:ring_server_host] = h || nil
  end
  opts.on("-r", "--ring-server-port [PORT]", Integer,
    "Specify Ring Server port to listen on") do |r|
      options[:ring_server_port] = r
  end
  opts.on("-a", "--access-control-list [ACLS]", Array,
    "Specify a comma separated Access Control List") do |a|
      options[:acls] = a
  end
  opts.on("-l", "--log-level [LEVEL]", String,
    "Specify log level {DEBUG|INFO|ERROR}") do |l|
      case l
      when 'DEBUG'
        options[:loglevel] = Logger::DEBUG
      when 'INFO'
        options[:loglevel] = Logger::INFO
      when 'ERROR'
        options[:loglevel] = Logger::ERROR
      else
        options[:loglevel] = Logger::ERROR
      end
  end
  opts.on_tail("-h", "--help", "Show this message") do
    puts opts
    exit
  end
  end.parse!

controller = Controller.new(
  :drb_server_host  => options[:drb_server_host],
  :drb_server_port  => options[:drb_server_port]  || 11235,
  :ring_server_host => options[:ring_server_host],
  :ring_server_port => options[:ring_server_port] || 12358,
  :acls => options[:acls] || %w{ allow all },
  :loglevel => options[:loglevel]
)
controller.start
DRb.thread.join

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
watirgrid-1.1.3.pre bin/controller
watirgrid-1.1.2 bin/controller
watirgrid-1.1.1 bin/controller
watirgrid-1.1.0 bin/controller
watirgrid-1.0.6 bin/controller
watirgrid-1.0.5 bin/controller
watirgrid-1.0.4 bin/controller