mqtt_pipe 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/mqtt_pipe/packer.rb +2 -0
- data/lib/mqtt_pipe/pipe.rb +4 -4
- data/lib/mqtt_pipe/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab00c4945131d2bd9dc41e1bdf19d35f5e9c3a56
|
4
|
+
data.tar.gz: d82e569abe98f9fc1c8fc85752bc171a58178043
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a0324c1de740f409032b13f3d781599f1235227ba3fdb2247174edc78dbd157a8581cfbd3c32aaf08359521400a3b8d0e265c1c87c303249cad2c14707c66a27
|
7
|
+
data.tar.gz: 611f2e017a4cd98f2f9c01b605b063cde862d43c6290072c8027034af764529d2e32f9ace71b8728c294b0eef523bbbdb6a9e6b7111e69fece6640db1a077f65
|
data/lib/mqtt_pipe/packer.rb
CHANGED
data/lib/mqtt_pipe/pipe.rb
CHANGED
@@ -52,7 +52,7 @@ module MQTTPipe
|
|
52
52
|
|
53
53
|
def open host, port: 1883, &block
|
54
54
|
listener_thread = nil
|
55
|
-
client
|
55
|
+
client = MQTT::Client.connect host: host, port: port
|
56
56
|
context = Context.new client
|
57
57
|
|
58
58
|
unless @listeners.empty?
|
@@ -83,7 +83,7 @@ module MQTTPipe
|
|
83
83
|
end
|
84
84
|
|
85
85
|
# Call user block
|
86
|
-
|
86
|
+
if block_given?
|
87
87
|
begin
|
88
88
|
context.instance_eval &block
|
89
89
|
rescue ConnectionError
|
@@ -100,8 +100,8 @@ module MQTTPipe
|
|
100
100
|
end
|
101
101
|
|
102
102
|
ensure
|
103
|
-
client.disconnect
|
104
|
-
listener_thread.exit
|
103
|
+
client.disconnect if client
|
104
|
+
listener_thread.exit if listener_thread
|
105
105
|
end
|
106
106
|
|
107
107
|
private
|
data/lib/mqtt_pipe/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mqtt_pipe
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sebastian Lindberg
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mqtt
|
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
123
123
|
version: '0'
|
124
124
|
requirements: []
|
125
125
|
rubyforge_project:
|
126
|
-
rubygems_version: 2.4.5
|
126
|
+
rubygems_version: 2.4.5.1
|
127
127
|
signing_key:
|
128
128
|
specification_version: 4
|
129
129
|
summary: A gem for sending a small set of objects via MQTT.
|