#!/usr/bin/env ruby require 'rubygems' require 'applix' $:.unshift File.join(File.dirname(__FILE__), '..', 'lib') require 'gom/sensor_port' Defaults = { :verbose => false } def usage puts "#{__FILE__} serve " end Applix.main(ARGV, Defaults) do any { usage } # example: gom-sensor-port serve http://gom.dev.artcom.de/sensors/udp handle(:serve) do |*args, options| puts "args: #{args.inspect}" puts "opts: #{options}" path, _ = *args _, node_path = (Gom::Remote::Connection.init path) gsp = Gom::SensorPort.new(node_path, options) gsp.listen end end