Sha256: 0c6575e15620fd78f6473f5ce96099e9157d78800fab952468c0c074eeb5c24d

Contents?: true

Size: 863 Bytes

Versions: 3

Compression:

Stored size: 863 Bytes

Contents

#!/usr/bin/env ruby

require 'rubygems'
require 'applix'

$:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
require 'can-controls-gateway'

$stderr.sync = true
$stdout.sync = true

Defaults = { 
}

def main argv
  options = Defaults.merge(Hash.from_argv argv)

  puts " -- starting #{File.basename __FILE__} at #{Time.now}"
  args = (options.delete :args)
  #debugger if (defined? debugger)
  service_url = (args.shift || 'http://gom/services/ccg/home')
  puts " .. #{service_url}"
  service = nil
  daemon = Gom::Remote::Daemon.new(service_url, options) do |daemon, path|
    service = CcgRunner.new(path, options)
    daemon.check_in 
  end
  daemon.background_loop(5) { service.run }
  daemon.actor_loop { |daemon| puts " -- gom refresh: #{Time.now}" }

rescue => e
  puts " ## #{e}\n -> #{e.backtrace.join "\n    "}"
end

main ARGV
# vim: syntax=ruby

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
tg-can-controls-gateway-0.1.2 bin/can_controls_gateway
tg-can-controls-gateway-0.1.1 bin/can_controls_gateway
tg-can-controls-gateway-0.1.0 bin/can_controls_gateway