ezmq 0.4.0 → 0.4.1
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/README.md +2 -0
- data/doc/EZMQ.html +1 -1
- data/doc/EZMQ/Client.html +1 -1
- data/doc/EZMQ/Context.html +1 -1
- data/doc/EZMQ/Pair.html +1 -1
- data/doc/EZMQ/Publisher.html +1 -1
- data/doc/EZMQ/Puller.html +1 -1
- data/doc/EZMQ/Pusher.html +1 -1
- data/doc/EZMQ/Server.html +1 -1
- data/doc/EZMQ/Socket.html +1 -1
- data/doc/EZMQ/Subscriber.html +2 -2
- data/doc/_index.html +1 -1
- data/doc/file.README.html +1 -1
- data/doc/index.html +1 -1
- data/doc/top-level-namespace.html +1 -1
- data/ezmq.gemspec +1 -1
- data/lib/ezmq/subscribe.rb +1 -1
- data/tests/ezmq/subscribe.rb +14 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0bade41d9cd93e37ed71c3ca05e561e6686f5c02
|
|
4
|
+
data.tar.gz: 94d879ede128fa5d4f6a464a42a5aa040f028784
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 452e45b1844532d19e186b3c30d54c65fa70ff5246949f0af9ee6ba299b738e44c56b0117d0ac94f0ef3fc0434cf98a1f09cbc9df6fda22792e96c64801e87e8
|
|
7
|
+
data.tar.gz: 46e55ac264085bd630e48db2e1275a0ae2252d022cb79a120738a94f720fb86f59cea498dd7291b1924b4f58e06b1cbebfe08891b62a9d7698bcb7fa4a3be370
|
data/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
[EZMQ (Effortless ZeroMQ)](https://colstrom.github.io/ezmq/)
|
|
2
2
|
========================
|
|
3
3
|
|
|
4
|
+
[](https://gitter.im/colstrom/ezmq?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
|
5
|
+
|
|
4
6
|
[](http://badge.fury.io/rb/ezmq)
|
|
5
7
|
[](https://gemnasium.com/colstrom/ezmq)
|
|
6
8
|
[](https://codeclimate.com/github/colstrom/ezmq)
|
data/doc/EZMQ.html
CHANGED
|
@@ -251,7 +251,7 @@
|
|
|
251
251
|
</div>
|
|
252
252
|
|
|
253
253
|
<div id="footer">
|
|
254
|
-
Generated on
|
|
254
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
255
255
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
256
256
|
0.8.7.6 (ruby-2.0.0).
|
|
257
257
|
</div>
|
data/doc/EZMQ/Client.html
CHANGED
|
@@ -405,7 +405,7 @@
|
|
|
405
405
|
</div>
|
|
406
406
|
|
|
407
407
|
<div id="footer">
|
|
408
|
-
Generated on
|
|
408
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
409
409
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
410
410
|
0.8.7.6 (ruby-2.0.0).
|
|
411
411
|
</div>
|
data/doc/EZMQ/Context.html
CHANGED
|
@@ -216,7 +216,7 @@ entire context can be terminated, closing all sockets within it.</code></pre>
|
|
|
216
216
|
</div>
|
|
217
217
|
|
|
218
218
|
<div id="footer">
|
|
219
|
-
Generated on
|
|
219
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
220
220
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
221
221
|
0.8.7.6 (ruby-2.0.0).
|
|
222
222
|
</div>
|
data/doc/EZMQ/Pair.html
CHANGED
|
@@ -270,7 +270,7 @@ end can send or receive messages.</code></pre>
|
|
|
270
270
|
</div>
|
|
271
271
|
|
|
272
272
|
<div id="footer">
|
|
273
|
-
Generated on
|
|
273
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
274
274
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
275
275
|
0.8.7.6 (ruby-2.0.0).
|
|
276
276
|
</div>
|
data/doc/EZMQ/Publisher.html
CHANGED
|
@@ -420,7 +420,7 @@
|
|
|
420
420
|
</div>
|
|
421
421
|
|
|
422
422
|
<div id="footer">
|
|
423
|
-
Generated on
|
|
423
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
424
424
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
425
425
|
0.8.7.6 (ruby-2.0.0).
|
|
426
426
|
</div>
|
data/doc/EZMQ/Puller.html
CHANGED
|
@@ -270,7 +270,7 @@ sources.</code></pre>
|
|
|
270
270
|
</div>
|
|
271
271
|
|
|
272
272
|
<div id="footer">
|
|
273
|
-
Generated on
|
|
273
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
274
274
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
275
275
|
0.8.7.6 (ruby-2.0.0).
|
|
276
276
|
</div>
|
data/doc/EZMQ/Pusher.html
CHANGED
|
@@ -271,7 +271,7 @@ destinations.</code></pre>
|
|
|
271
271
|
</div>
|
|
272
272
|
|
|
273
273
|
<div id="footer">
|
|
274
|
-
Generated on
|
|
274
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
275
275
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
276
276
|
0.8.7.6 (ruby-2.0.0).
|
|
277
277
|
</div>
|
data/doc/EZMQ/Server.html
CHANGED
|
@@ -390,7 +390,7 @@
|
|
|
390
390
|
</div>
|
|
391
391
|
|
|
392
392
|
<div id="footer">
|
|
393
|
-
Generated on
|
|
393
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
394
394
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
395
395
|
0.8.7.6 (ruby-2.0.0).
|
|
396
396
|
</div>
|
data/doc/EZMQ/Socket.html
CHANGED
|
@@ -1292,7 +1292,7 @@ address instead.</p>
|
|
|
1292
1292
|
</div>
|
|
1293
1293
|
|
|
1294
1294
|
<div id="footer">
|
|
1295
|
-
Generated on
|
|
1295
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
1296
1296
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
1297
1297
|
0.8.7.6 (ruby-2.0.0).
|
|
1298
1298
|
</div>
|
data/doc/EZMQ/Subscriber.html
CHANGED
|
@@ -646,7 +646,7 @@
|
|
|
646
646
|
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span>
|
|
647
647
|
<span class='ivar'>@socket</span><span class='period'>.</span><span class='id identifier rubyid_recv_string'>recv_string</span> <span class='id identifier rubyid_message'>message</span>
|
|
648
648
|
|
|
649
|
-
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(?<topic>[^\ ]*)\ (?<body>.*)</span><span class='regexp_end'
|
|
649
|
+
<span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='id identifier rubyid_message'>message</span><span class='period'>.</span><span class='id identifier rubyid_match'>match</span><span class='lparen'>(</span><span class='tstring'><span class='regexp_beg'>/</span><span class='tstring_content'>^(?<topic>[^\ ]*)\ (?<body>.*)</span><span class='regexp_end'>/m</span></span><span class='rparen'>)</span>
|
|
650
650
|
|
|
651
651
|
<span class='id identifier rubyid_decoded'>decoded</span> <span class='op'>=</span> <span class='lparen'>(</span><span class='id identifier rubyid_options'>options</span><span class='lbracket'>[</span><span class='symbol'>:decode</span><span class='rbracket'>]</span> <span class='op'>||</span> <span class='ivar'>@decode</span><span class='rparen'>)</span><span class='period'>.</span><span class='id identifier rubyid_call'>call</span> <span class='id identifier rubyid_message'>message</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>body</span><span class='tstring_end'>'</span></span><span class='rbracket'>]</span>
|
|
652
652
|
<span class='kw'>if</span> <span class='id identifier rubyid_block_given?'>block_given?</span>
|
|
@@ -837,7 +837,7 @@ set, this will only remove one.</p>
|
|
|
837
837
|
</div>
|
|
838
838
|
|
|
839
839
|
<div id="footer">
|
|
840
|
-
Generated on
|
|
840
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
841
841
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
842
842
|
0.8.7.6 (ruby-2.0.0).
|
|
843
843
|
</div>
|
data/doc/_index.html
CHANGED
|
@@ -188,7 +188,7 @@
|
|
|
188
188
|
</div>
|
|
189
189
|
|
|
190
190
|
<div id="footer">
|
|
191
|
-
Generated on
|
|
191
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
192
192
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
193
193
|
0.8.7.6 (ruby-2.0.0).
|
|
194
194
|
</div>
|
data/doc/file.README.html
CHANGED
|
@@ -238,7 +238,7 @@ sudo aptitude install libzmq3-dev
|
|
|
238
238
|
</div></div>
|
|
239
239
|
|
|
240
240
|
<div id="footer">
|
|
241
|
-
Generated on
|
|
241
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
242
242
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
243
243
|
0.8.7.6 (ruby-2.0.0).
|
|
244
244
|
</div>
|
data/doc/index.html
CHANGED
|
@@ -238,7 +238,7 @@ sudo aptitude install libzmq3-dev
|
|
|
238
238
|
</div></div>
|
|
239
239
|
|
|
240
240
|
<div id="footer">
|
|
241
|
-
Generated on
|
|
241
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
242
242
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
243
243
|
0.8.7.6 (ruby-2.0.0).
|
|
244
244
|
</div>
|
|
@@ -103,7 +103,7 @@
|
|
|
103
103
|
</div>
|
|
104
104
|
|
|
105
105
|
<div id="footer">
|
|
106
|
-
Generated on
|
|
106
|
+
Generated on Fri Feb 20 17:02:39 2015 by
|
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
|
108
108
|
0.8.7.6 (ruby-2.0.0).
|
|
109
109
|
</div>
|
data/ezmq.gemspec
CHANGED
data/lib/ezmq/subscribe.rb
CHANGED
|
@@ -36,7 +36,7 @@ module EZMQ
|
|
|
36
36
|
message = ''
|
|
37
37
|
@socket.recv_string message
|
|
38
38
|
|
|
39
|
-
message = message.match(/^(?<topic>[^\ ]*)\ (?<body>.*)/)
|
|
39
|
+
message = message.match(/^(?<topic>[^\ ]*)\ (?<body>.*)/m)
|
|
40
40
|
|
|
41
41
|
decoded = (options[:decode] || @decode).call message['body']
|
|
42
42
|
if block_given?
|
data/tests/ezmq/subscribe.rb
CHANGED
|
@@ -9,6 +9,7 @@ context 'Subscribers' do
|
|
|
9
9
|
@publisher.send 'message'
|
|
10
10
|
@publisher.send 'message', topic: 'bad'
|
|
11
11
|
@publisher.send 'message', topic: 'good'
|
|
12
|
+
@publisher.send "message\nmessage", topic: 'multiline'
|
|
12
13
|
end
|
|
13
14
|
end
|
|
14
15
|
end
|
|
@@ -21,7 +22,7 @@ context 'Subscribers' do
|
|
|
21
22
|
messages << message
|
|
22
23
|
topics << topic
|
|
23
24
|
end
|
|
24
|
-
assert_equal 1000, messages.
|
|
25
|
+
assert_equal 1000, messages.size
|
|
25
26
|
assert topics.include? ''
|
|
26
27
|
assert topics.include? 'bad'
|
|
27
28
|
assert topics.include? 'good'
|
|
@@ -76,6 +77,18 @@ context 'Subscribers' do
|
|
|
76
77
|
assert_equal false, topics.include?('bad')
|
|
77
78
|
end
|
|
78
79
|
|
|
80
|
+
should 'receive the message as it was sent' do
|
|
81
|
+
@subscriber.subscribe ''
|
|
82
|
+
messages = []
|
|
83
|
+
1000.times do
|
|
84
|
+
message, _ = @subscriber.receive
|
|
85
|
+
messages << message
|
|
86
|
+
end
|
|
87
|
+
assert_equal 2, messages.uniq.size
|
|
88
|
+
assert messages.include? 'message'
|
|
89
|
+
assert messages.include? "message\nmessage"
|
|
90
|
+
end
|
|
91
|
+
|
|
79
92
|
should 'return the contents of a message with a subscribed topic' do
|
|
80
93
|
# assert
|
|
81
94
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: ezmq
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Chris Olstrom
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2015-02-
|
|
11
|
+
date: 2015-02-21 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: ffi-rzmq
|