sps-pub 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9953f2878cd0a886d58292decc206ad59b919612
4
- data.tar.gz: a157036cc61e7fa60e211e71f083525a6212dc1c
3
+ metadata.gz: 22e572252f6a6dc79784c6c202a10403778a1003
4
+ data.tar.gz: cd72e1257576f90d9e7b0eac6ca1cd6f3f3fbace
5
5
  SHA512:
6
- metadata.gz: 02448015d1eb3328e649dd1fea6e9739a726e28489c7e48ab6c8b96d3f680e12a1dba7711a7535a1fc5bd4aaaba255687770e5d0f09e4de06fb7110e4e8f46e0
7
- data.tar.gz: a24fa86b543e8151d487280e1787a160dcc463635fae2c60e19bf98a38d4b162eea4e7371001f1d87d97ed6bb5fcb8bdfa87ae0c80f7b8f1db00f428b4b2c678
6
+ metadata.gz: 9c721d487e4d48afb1fa8cb4cec7ec83ddd00cc3db8a15da06110a76fd4e7b546dbe4244c587b495e77c94e17ce98c49a13be3b9d9d11264a14749e93a223c99
7
+ data.tar.gz: 051752b774310b1240bd320b9d01f95e65ccaf31f33dc0cb6b08856b8c2b86edba0554583c124584d9eb1ad26ce87d3304b0ff05df9fa6720cf2d75bfbfdecef
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/sps-pub.rb CHANGED
@@ -3,26 +3,22 @@
3
3
  # file: sps-pub.rb
4
4
 
5
5
  require 'simplepubsub'
6
- require 'mqtt'
7
6
 
8
7
  class SPSPub
9
8
  include SimplePubSub
10
9
 
11
- def self.notice(s,sps_address='sps', mqtt_address='mqtt')
10
+ def self.notice(s,sps_address='sps',port='59000')
12
11
 
13
12
  topic, msg = s.split(/:\s*/,2)
14
- r = ''
15
13
 
16
- Client.connect(sps_address) do |client|
17
- r = client.publish(topic, msg)
14
+ Client.connect(sps_address, port, options={}) do |client|
15
+
16
+ opt = {stay_connected: false}.merge options
17
+ puts "about to publish : topic: %s msg: %s" % [topic, msg]
18
+ client.publish(topic, msg)
19
+ :stop if opt[:stay_connected] == false
18
20
  end
19
21
 
20
- if topic == 'xmpp' then
21
- MQTT::Client.connect(mqtt_address) do |client|
22
- client.publish(topic, msg)
23
- end
24
- end
25
- r
26
22
  end
27
23
 
28
24
  def self.listen(topic='#', sps_address='sps')
@@ -34,4 +30,4 @@ class SPSPub
34
30
  end
35
31
  end
36
32
  end
37
- end
33
+ end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sps-pub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  2cSEZ0QYbEwC3czzwEism6iYWhlBI/srC6g8JIr7pq91FybciqI5dk5RB7SE5Xgf
32
32
  p7uZNkO8qc9/fg==
33
33
  -----END CERTIFICATE-----
34
- date: 2013-10-19 00:00:00.000000000 Z
34
+ date: 2013-11-21 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: simplepubsub
@@ -47,20 +47,6 @@ dependencies:
47
47
  - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: '0'
50
- - !ruby/object:Gem::Dependency
51
- name: mqtt
52
- requirement: !ruby/object:Gem::Requirement
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: '0'
57
- type: :runtime
58
- prerelease: false
59
- version_requirements: !ruby/object:Gem::Requirement
60
- requirements:
61
- - - ">="
62
- - !ruby/object:Gem::Version
63
- version: '0'
64
50
  description:
65
51
  email: james@r0bertson.co.uk
66
52
  executables: []
metadata.gz.sig CHANGED
Binary file