ezmq 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: d3c62092c0a324eaaa9c9db6881f2dd6f4f41e44
4
+ data.tar.gz: f7dc5b7cecceab6d97de4955e86ba377e5c2cde5
5
+ SHA512:
6
+ metadata.gz: 06c11e303f1c7ee81d971d5a1f28e4b6f64ea70285621abff0f89af119ee810b7dc957afbf07c3697a9a19854353001c7a168d2956ee85160bbb5ad195aa417f
7
+ data.tar.gz: b7060b0a12b208d4aee9d3248b9c13fc5eaf50af6ed4e27a82fc941375ea8552cec93da5648deed3732a1b22217a65e20f9f0a2f669fbbd4412f164a80c3c92c
@@ -0,0 +1 @@
1
+ .yardoc/
data/Gemfile ADDED
@@ -0,0 +1,3 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'ffi-rzmq', github: 'chuckremes/ffi-rzmq'
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014 Chris Olstrom
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,25 @@
1
+ EZMQ (Effortless ZeroMQ)
2
+ ========================
3
+
4
+ EZMQ is a wrapper around the wonderful `ffi-rzmq` gem, which (as the name suggests) uses FFI, and exposes a fairly raw C-like interface. As elegant as 0MQ is, C doesn't feel like Ruby, and FFI bindings feel like C. EZMQ makes some reasonable assumptions to help you focus on what makes your code special, and not worry about setting up 0MQ.
5
+
6
+ Any of the magical hand-wavey bits (contexts, sockets, etc) are still exposed for tinkering, EZMQ just starts you off with some sane defaults.
7
+
8
+ Operating System Notes
9
+ ----------------------
10
+
11
+ As this relies on [ffi-rzmq](https://github.com/chuckremes/ffi-rzmq), you will need to have the zeromq libraries available.
12
+
13
+ For OSX, [Homebrew](http://brew.sh/) is probably the easiest way to handle this:
14
+
15
+ ```brew install zeromq```
16
+
17
+ For Ubuntu, [Chris Lea's PPA](https://launchpad.net/~chris-lea/+archive/ubuntu/zeromq) is a good choice:
18
+
19
+ ```
20
+ sudo add-apt-repository ppa:chris-lea/zeromq
21
+ sudo aptitude update
22
+ sudo aptitude install libzmq3-dev
23
+ ```
24
+
25
+ For Windows, you should really consult the [ØMQ documentation](http://zeromq.org/docs:windows-installations).
@@ -0,0 +1,34 @@
1
+ # require 'simplecov'
2
+
3
+ task default: [:test]
4
+
5
+ task :test do
6
+ sh 'rspec'
7
+ end
8
+
9
+ task audit: [:style, :complexity, :duplication, :design, :documentation]
10
+
11
+ task :style do
12
+ sh 'rubocop'
13
+ end
14
+
15
+ task :complexity do
16
+ sh 'flog *.rb **/*.rb'
17
+ end
18
+
19
+ task :duplication do
20
+ sh 'flay'
21
+ end
22
+
23
+ task :design do
24
+ sh 'roodi'
25
+ sh 'reek *.rb **/*.rb'
26
+ end
27
+
28
+ task :rework do
29
+ sh 'churn'
30
+ end
31
+
32
+ task :documentation do
33
+ sh 'inch'
34
+ end
@@ -0,0 +1,126 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Module: EZMQ
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '';
20
+ framesUrl = "frames.html#!EZMQ.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="_index.html">Index (E)</a> &raquo;
35
+
36
+
37
+ <span class="title">EZMQ</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Module: EZMQ
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+ <dt class="r1 last">Defined in:</dt>
82
+ <dd class="r1 last">lib/ezmq.rb</dd>
83
+
84
+ </dl>
85
+ <div class="clear"></div>
86
+
87
+ <h2>Overview</h2><div class="docstring">
88
+ <div class="discussion">
89
+
90
+ <p>Syntactic sugar for 0MQ, because Ruby shouldn&#39;t feel like C.</p>
91
+
92
+
93
+ </div>
94
+ </div>
95
+ <div class="tags">
96
+
97
+
98
+ </div><h2>Defined Under Namespace</h2>
99
+ <p class="children">
100
+
101
+
102
+
103
+
104
+ <strong class="classes">Classes:</strong> <span class='object_link'><a href="EZMQ/Client.html" title="EZMQ::Client (class)">Client</a></span>, <span class='object_link'><a href="EZMQ/Publisher.html" title="EZMQ::Publisher (class)">Publisher</a></span>, <span class='object_link'><a href="EZMQ/Server.html" title="EZMQ::Server (class)">Server</a></span>, <span class='object_link'><a href="EZMQ/Socket.html" title="EZMQ::Socket (class)">Socket</a></span>, <span class='object_link'><a href="EZMQ/Subscriber.html" title="EZMQ::Subscriber (class)">Subscriber</a></span>
105
+
106
+
107
+ </p>
108
+
109
+
110
+
111
+
112
+
113
+
114
+
115
+
116
+
117
+ </div>
118
+
119
+ <div id="footer">
120
+ Generated on Tue Jan 6 11:26:34 2015 by
121
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
122
+ 0.8.7.6 (ruby-2.0.0).
123
+ </div>
124
+
125
+ </body>
126
+ </html>
@@ -0,0 +1,385 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6
+ <title>
7
+ Class: EZMQ::Client
8
+
9
+ &mdash; Documentation by YARD 0.8.7.6
10
+
11
+ </title>
12
+
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
14
+
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
16
+
17
+ <script type="text/javascript" charset="utf-8">
18
+ hasFrames = window.top.frames.main ? true : false;
19
+ relpath = '../';
20
+ framesUrl = "../frames.html#!EZMQ/Client.html";
21
+ </script>
22
+
23
+
24
+ <script type="text/javascript" charset="utf-8" src="../js/jquery.js"></script>
25
+
26
+ <script type="text/javascript" charset="utf-8" src="../js/app.js"></script>
27
+
28
+
29
+ </head>
30
+ <body>
31
+ <div id="header">
32
+ <div id="menu">
33
+
34
+ <a href="../_index.html">Index (C)</a> &raquo;
35
+ <span class='title'><span class='object_link'><a href="../EZMQ.html" title="EZMQ (module)">EZMQ</a></span></span>
36
+ &raquo;
37
+ <span class="title">Client</span>
38
+
39
+
40
+ <div class="noframes"><span class="title">(</span><a href="." target="_top">no frames</a><span class="title">)</span></div>
41
+ </div>
42
+
43
+ <div id="search">
44
+
45
+ <a class="full_list_link" id="class_list_link"
46
+ href="../class_list.html">
47
+ Class List
48
+ </a>
49
+
50
+ <a class="full_list_link" id="method_list_link"
51
+ href="../method_list.html">
52
+ Method List
53
+ </a>
54
+
55
+ <a class="full_list_link" id="file_list_link"
56
+ href="../file_list.html">
57
+ File List
58
+ </a>
59
+
60
+ </div>
61
+ <div class="clear"></div>
62
+ </div>
63
+
64
+ <iframe id="search_frame"></iframe>
65
+
66
+ <div id="content"><h1>Class: EZMQ::Client
67
+
68
+
69
+
70
+ </h1>
71
+
72
+ <dl class="box">
73
+
74
+ <dt class="r1">Inherits:</dt>
75
+ <dd class="r1">
76
+ <span class="inheritName"><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></span>
77
+
78
+ <ul class="fullTree">
79
+ <li>Object</li>
80
+
81
+ <li class="next"><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></li>
82
+
83
+ <li class="next">EZMQ::Client</li>
84
+
85
+ </ul>
86
+ <a href="#" class="inheritanceTree">show all</a>
87
+
88
+ </dd>
89
+
90
+
91
+
92
+
93
+
94
+
95
+
96
+
97
+
98
+ <dt class="r2 last">Defined in:</dt>
99
+ <dd class="r2 last">lib/ezmq.rb</dd>
100
+
101
+ </dl>
102
+ <div class="clear"></div>
103
+
104
+ <h2>Overview</h2><div class="docstring">
105
+ <div class="discussion">
106
+
107
+ <p>Request socket that sends messages and receives replies.</p>
108
+
109
+
110
+ </div>
111
+ </div>
112
+ <div class="tags">
113
+
114
+
115
+ </div>
116
+
117
+
118
+
119
+
120
+
121
+ <h2>Instance Attribute Summary</h2>
122
+
123
+ <h3 class="inherited">Attributes inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
124
+ <p class="inherited"><span class='object_link'><a href="Socket.html#context-instance_method" title="EZMQ::Socket#context (method)">#context</a></span>, <span class='object_link'><a href="Socket.html#decode-instance_method" title="EZMQ::Socket#decode (method)">#decode</a></span>, <span class='object_link'><a href="Socket.html#encode-instance_method" title="EZMQ::Socket#encode (method)">#encode</a></span>, <span class='object_link'><a href="Socket.html#socket-instance_method" title="EZMQ::Socket#socket (method)">#socket</a></span></p>
125
+
126
+
127
+
128
+ <h2>
129
+ Instance Method Summary
130
+ <small>(<a href="#" class="summary_toggle">collapse</a>)</small>
131
+ </h2>
132
+
133
+ <ul class="summary">
134
+
135
+ <li class="public ">
136
+ <span class="summary_signature">
137
+
138
+ <a href="#initialize-instance_method" title="#initialize (instance method)">- (Client) <strong>initialize</strong>(**options) </a>
139
+
140
+
141
+
142
+ </span>
143
+
144
+
145
+ <span class="note title constructor">constructor</span>
146
+
147
+
148
+
149
+
150
+
151
+
152
+
153
+
154
+ <span class="summary_desc"><div class='inline'>
155
+ <p>Creates a new Client socket.</p>
156
+ </div></span>
157
+
158
+ </li>
159
+
160
+
161
+ <li class="public ">
162
+ <span class="summary_signature">
163
+
164
+ <a href="#request-instance_method" title="#request (instance method)">- (void) <strong>request</strong>(message = &#39;&#39;, encode: @encode, decode: @decode) </a>
165
+
166
+
167
+
168
+ </span>
169
+
170
+
171
+
172
+
173
+
174
+
175
+
176
+
177
+
178
+ <span class="summary_desc"><div class='inline'>
179
+ <p>Sends a message and waits to receive a response.</p>
180
+ </div></span>
181
+
182
+ </li>
183
+
184
+
185
+ </ul>
186
+
187
+
188
+
189
+
190
+
191
+
192
+
193
+
194
+
195
+
196
+
197
+ <h3 class="inherited">Methods inherited from <span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">Socket</a></span></h3>
198
+ <p class="inherited"><span class='object_link'><a href="Socket.html#bind-instance_method" title="EZMQ::Socket#bind (method)">#bind</a></span>, <span class='object_link'><a href="Socket.html#connect-instance_method" title="EZMQ::Socket#connect (method)">#connect</a></span>, <span class='object_link'><a href="Socket.html#receive-instance_method" title="EZMQ::Socket#receive (method)">#receive</a></span>, <span class='object_link'><a href="Socket.html#send-instance_method" title="EZMQ::Socket#send (method)">#send</a></span></p>
199
+ <div id="constructor_details" class="method_details_list">
200
+ <h2>Constructor Details</h2>
201
+
202
+ <div class="method_details first">
203
+ <h3 class="signature first" id="initialize-instance_method">
204
+
205
+ - (<tt><span class='object_link'><a href="" title="EZMQ::Client (class)">Client</a></span></tt>) <strong>initialize</strong>(**options)
206
+
207
+
208
+
209
+
210
+
211
+ </h3><div class="docstring">
212
+ <div class="discussion">
213
+
214
+ <p>Creates a new Client socket.</p>
215
+
216
+
217
+ </div>
218
+ </div>
219
+ <div class="tags">
220
+ <p class="tag_title">Parameters:</p>
221
+ <ul class="param">
222
+
223
+ <li>
224
+
225
+ <span class='name'>options</span>
226
+
227
+
228
+ <span class='type'>(<tt>Hash</tt>)</span>
229
+
230
+
231
+
232
+ &mdash;
233
+ <div class='inline'>
234
+ <p>optional parameters</p>
235
+ </div>
236
+
237
+ </li>
238
+
239
+ </ul>
240
+
241
+
242
+ <p class="tag_title">See Also:</p>
243
+ <ul class="see">
244
+
245
+ <li><span class='object_link'><a href="Socket.html" title="EZMQ::Socket (class)">EZMQ::Socket for a list of optional parameters.</a></span></li>
246
+
247
+ </ul>
248
+
249
+ </div><table class="source_code">
250
+ <tr>
251
+ <td>
252
+ <pre class="lines">
253
+
254
+
255
+ 125
256
+ 126
257
+ 127</pre>
258
+ </td>
259
+ <td>
260
+ <pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 125</span>
261
+
262
+ <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span><span class='lparen'>(</span><span class='op'>**</span><span class='id identifier rubyid_options'>options</span><span class='rparen'>)</span>
263
+ <span class='kw'>super</span> <span class='symbol'>:connect</span><span class='comma'>,</span> <span class='const'>ZMQ</span><span class='op'>::</span><span class='const'>REQ</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span>
264
+ <span class='kw'>end</span></pre>
265
+ </td>
266
+ </tr>
267
+ </table>
268
+ </div>
269
+
270
+ </div>
271
+
272
+
273
+ <div id="instance_method_details" class="method_details_list">
274
+ <h2>Instance Method Details</h2>
275
+
276
+
277
+ <div class="method_details first">
278
+ <h3 class="signature first" id="request-instance_method">
279
+
280
+ - (<tt>void</tt>) <strong>request</strong>(message = &#39;&#39;, encode: @encode, decode: @decode)
281
+
282
+
283
+
284
+
285
+
286
+ </h3><div class="docstring">
287
+ <div class="discussion">
288
+ <p class="note returns_void">This method returns an undefined value.</p>
289
+ <p>Sends a message and waits to receive a response.</p>
290
+
291
+
292
+ </div>
293
+ </div>
294
+ <div class="tags">
295
+ <p class="tag_title">Parameters:</p>
296
+ <ul class="param">
297
+
298
+ <li>
299
+
300
+ <span class='name'>message</span>
301
+
302
+
303
+ <span class='type'>(<tt>String</tt>)</span>
304
+
305
+
306
+ <em class="default">(defaults to: <tt>&#39;&#39;</tt>)</em>
307
+
308
+
309
+ &mdash;
310
+ <div class='inline'>
311
+ <p>the message to send.</p>
312
+ </div>
313
+
314
+ </li>
315
+
316
+ <li>
317
+
318
+ <span class='name'>encode</span>
319
+
320
+
321
+ <span class='type'>(<tt>lambda</tt>)</span>
322
+
323
+
324
+
325
+ &mdash;
326
+ <div class='inline'>
327
+ <p>how to encode the message.</p>
328
+ </div>
329
+
330
+ </li>
331
+
332
+ <li>
333
+
334
+ <span class='name'>decode</span>
335
+
336
+
337
+ <span class='type'>(<tt>lambda</tt>)</span>
338
+
339
+
340
+
341
+ &mdash;
342
+ <div class='inline'>
343
+ <p>how to decode the message.</p>
344
+ </div>
345
+
346
+ </li>
347
+
348
+ </ul>
349
+
350
+
351
+ </div><table class="source_code">
352
+ <tr>
353
+ <td>
354
+ <pre class="lines">
355
+
356
+
357
+ 137
358
+ 138
359
+ 139
360
+ 140</pre>
361
+ </td>
362
+ <td>
363
+ <pre class="code"><span class="info file"># File 'lib/ezmq.rb', line 137</span>
364
+
365
+ <span class='kw'>def</span> <span class='id identifier rubyid_request'>request</span><span class='lparen'>(</span><span class='id identifier rubyid_message'>message</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_end'>&#39;</span></span><span class='comma'>,</span> <span class='label'>encode:</span> <span class='ivar'>@encode</span><span class='comma'>,</span> <span class='label'>decode:</span> <span class='ivar'>@decode</span><span class='rparen'>)</span>
366
+ <span class='id identifier rubyid_send'>send</span> <span class='id identifier rubyid_message'>message</span><span class='comma'>,</span> <span class='label'>encode:</span> <span class='id identifier rubyid_encode'>encode</span>
367
+ <span class='id identifier rubyid_receive'>receive</span> <span class='label'>decode:</span> <span class='id identifier rubyid_decode'>decode</span>
368
+ <span class='kw'>end</span></pre>
369
+ </td>
370
+ </tr>
371
+ </table>
372
+ </div>
373
+
374
+ </div>
375
+
376
+ </div>
377
+
378
+ <div id="footer">
379
+ Generated on Tue Jan 6 11:26:34 2015 by
380
+ <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
381
+ 0.8.7.6 (ruby-2.0.0).
382
+ </div>
383
+
384
+ </body>
385
+ </html>