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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9eb995dda9d228f1276dd94091d8e4e243eeae66
4
- data.tar.gz: 54dbf42a2f536c7865cd3c529489ea34fccf7f1a
3
+ metadata.gz: ab00c4945131d2bd9dc41e1bdf19d35f5e9c3a56
4
+ data.tar.gz: d82e569abe98f9fc1c8fc85752bc171a58178043
5
5
  SHA512:
6
- metadata.gz: 8f23a64abaf8a1db9a9288b8a93367b8b5552e46c0b30645eb0bb4fdb5d9aa5a27f4f10dde32ce2ff5a2a7ee4483a69387e6b0293ff38a0548e82048283752e6
7
- data.tar.gz: 31e0b5d28c07cc7d3b44b701dec0160559b88a7ea7a80ef6cc79127838ab5fcf26b609494f62f026e4e16b4beeed0d5c4031f2b09d266b2e818d795500181b6e
6
+ metadata.gz: a0324c1de740f409032b13f3d781599f1235227ba3fdb2247174edc78dbd157a8581cfbd3c32aaf08359521400a3b8d0e265c1c87c303249cad2c14707c66a27
7
+ data.tar.gz: 611f2e017a4cd98f2f9c01b605b063cde862d43c6290072c8027034af764529d2e32f9ace71b8728c294b0eef523bbbdb6a9e6b7111e69fece6640db1a077f65
@@ -1,3 +1,5 @@
1
+ require 'stringio'
2
+
1
3
  module MQTTPipe
2
4
 
3
5
  ##
@@ -52,7 +52,7 @@ module MQTTPipe
52
52
 
53
53
  def open host, port: 1883, &block
54
54
  listener_thread = nil
55
- client = MQTT::Client.connect host: host, port: port
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
- unless block.nil?
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 unless listener_thread.nil?
103
+ client.disconnect if client
104
+ listener_thread.exit if listener_thread
105
105
  end
106
106
 
107
107
  private
@@ -1,3 +1,3 @@
1
1
  module MQTTPipe
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
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
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-09-29 00:00:00.000000000 Z
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.