Sha256: 0700fea5ce9c0b9d6d02a45dee37e7d5ec4154dfb90abb54bd6b71b0694d2354

Contents?: true

Size: 641 Bytes

Versions: 1

Compression:

Stored size: 641 Bytes

Contents

#!/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 <GOM URL, e.g: http://gom.dev.artcom.de/sensors/udp>"
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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gom-sensor-ports-0.2.4 bin/gom-sensor-port