ionian 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/doc/Ionian/Extension/IO.html +44 -48
- data/doc/Ionian/Extension/Socket.html +462 -170
- data/doc/Ionian/Extension.html +4 -4
- data/doc/Ionian/Server.html +4 -4
- data/doc/Ionian/Socket.html +321 -103
- data/doc/Ionian.html +4 -4
- data/doc/_index.html +5 -5
- data/doc/css/style.css +1 -0
- data/doc/file.README.html +4 -4
- data/doc/file.license.html +4 -4
- data/doc/frames.html +1 -1
- data/doc/index.html +4 -4
- data/doc/method_list.html +81 -39
- data/doc/top-level-namespace.html +4 -4
- data/lib/ionian/extension/io.rb +22 -24
- data/lib/ionian/extension/socket.rb +52 -14
- data/lib/ionian/socket.rb +27 -17
- metadata +2 -2
data/doc/_index.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<head>
|
5
5
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
6
6
|
<title>
|
7
|
-
Documentation by YARD 0.8.7.
|
7
|
+
Documentation by YARD 0.8.7.4
|
8
8
|
|
9
9
|
</title>
|
10
10
|
|
@@ -15,7 +15,7 @@
|
|
15
15
|
<script type="text/javascript" charset="utf-8">
|
16
16
|
hasFrames = window.top.frames.main ? true : false;
|
17
17
|
relpath = '';
|
18
|
-
framesUrl = "frames.html#!"
|
18
|
+
framesUrl = "frames.html#!_index.html";
|
19
19
|
</script>
|
20
20
|
|
21
21
|
|
@@ -56,7 +56,7 @@
|
|
56
56
|
|
57
57
|
<iframe id="search_frame"></iframe>
|
58
58
|
|
59
|
-
<div id="content"><h1 class="noborder title">Documentation by YARD 0.8.7.
|
59
|
+
<div id="content"><h1 class="noborder title">Documentation by YARD 0.8.7.4</h1>
|
60
60
|
<div id="listing">
|
61
61
|
<h1 class="alphaindex">Alphabetic Index</h1>
|
62
62
|
|
@@ -155,9 +155,9 @@
|
|
155
155
|
</div>
|
156
156
|
|
157
157
|
<div id="footer">
|
158
|
-
Generated on
|
158
|
+
Generated on Fri Apr 11 21:18:17 2014 by
|
159
159
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
160
|
-
0.8.7.
|
160
|
+
0.8.7.4 (ruby-2.1.1).
|
161
161
|
</div>
|
162
162
|
|
163
163
|
</body>
|
data/doc/css/style.css
CHANGED
@@ -291,6 +291,7 @@ li.r2 { background: #fafafa; }
|
|
291
291
|
-moz-box-shadow: -2px 2px 6px #bbb;
|
292
292
|
z-index: 5000;
|
293
293
|
position: relative;
|
294
|
+
overflow-x: auto;
|
294
295
|
}
|
295
296
|
#toc.nofloat { float: none; max-width: none; border: none; padding: 0; margin: 20px 0; -webkit-box-shadow: none; -moz-box-shadow: none; }
|
296
297
|
#toc.nofloat.hidden { padding: 0; background: 0; margin-bottom: 5px; }
|
data/doc/file.README.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '';
|
20
|
-
framesUrl = "frames.html#!
|
20
|
+
framesUrl = "frames.html#!file.README.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -124,9 +124,9 @@
|
|
124
124
|
</div></div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Fri Apr 11 21:18:17 2014 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
|
-
0.8.7.
|
129
|
+
0.8.7.4 (ruby-2.1.1).
|
130
130
|
</div>
|
131
131
|
|
132
132
|
</body>
|
data/doc/file.license.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: license
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '';
|
20
|
-
framesUrl = "frames.html#!
|
20
|
+
framesUrl = "frames.html#!file.license.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -64,9 +64,9 @@
|
|
64
64
|
<div id="content"><div id='filecontents'>The MIT License (MIT)<br/><br/>Copyright (c) 2013 Alex McLain<br/><br/>Permission is hereby granted, free of charge, to any person obtaining a copy<br/>of this software and associated documentation files (the "Software"), to deal<br/>in the Software without restriction, including without limitation the rights<br/>to use, copy, modify, merge, publish, distribute, sublicense, and/or sell<br/>copies of the Software, and to permit persons to whom the Software is<br/>furnished to do so, subject to the following conditions:<br/><br/>The above copyright notice and this permission notice shall be included in<br/>all copies or substantial portions of the Software.<br/><br/>THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR<br/>IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,<br/>FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE<br/>AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER<br/>LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,<br/>OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN<br/>THE SOFTWARE.
|
65
65
|
|
66
66
|
<div id="footer">
|
67
|
-
Generated on
|
67
|
+
Generated on Fri Apr 11 21:18:17 2014 by
|
68
68
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
69
|
-
0.8.7.
|
69
|
+
0.8.7.4 (ruby-2.1.1).
|
70
70
|
</div>
|
71
71
|
|
72
72
|
</body>
|
data/doc/frames.html
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
5
|
<head>
|
6
6
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
7
|
-
<title>Documentation by YARD 0.8.7.
|
7
|
+
<title>Documentation by YARD 0.8.7.4</title>
|
8
8
|
</head>
|
9
9
|
<script type="text/javascript" charset="utf-8">
|
10
10
|
window.onload = function() {
|
data/doc/index.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
File: README
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '';
|
20
|
-
framesUrl = "frames.html#!
|
20
|
+
framesUrl = "frames.html#!file.README.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -124,9 +124,9 @@
|
|
124
124
|
</div></div>
|
125
125
|
|
126
126
|
<div id="footer">
|
127
|
-
Generated on
|
127
|
+
Generated on Fri Apr 11 21:18:17 2014 by
|
128
128
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
129
|
-
0.8.7.
|
129
|
+
0.8.7.4 (ruby-2.1.1).
|
130
130
|
</div>
|
131
131
|
|
132
132
|
</body>
|
data/doc/method_list.html
CHANGED
@@ -48,13 +48,25 @@
|
|
48
48
|
|
49
49
|
|
50
50
|
<li class="r1 ">
|
51
|
-
<span class='object_link'><a href="Ionian/
|
52
|
-
<small>Ionian::
|
51
|
+
<span class='object_link'><a href="Ionian/Socket.html#bind_port-instance_method" title="Ionian::Socket#bind_port (method)">#bind_port</a></span>
|
52
|
+
<small>Ionian::Socket</small>
|
53
53
|
</li>
|
54
54
|
|
55
55
|
|
56
56
|
<li class="r2 ">
|
57
|
-
<span class='object_link'><a href="Ionian/
|
57
|
+
<span class='object_link'><a href="Ionian/Extension/Socket.html#broadcast-instance_method" title="Ionian::Extension::Socket#broadcast (method)">#broadcast</a></span>
|
58
|
+
<small>Ionian::Extension::Socket</small>
|
59
|
+
</li>
|
60
|
+
|
61
|
+
|
62
|
+
<li class="r1 ">
|
63
|
+
<span class='object_link'><a href="Ionian/Extension/Socket.html#broadcast%3D-instance_method" title="Ionian::Extension::Socket#broadcast= (method)">#broadcast=</a></span>
|
64
|
+
<small>Ionian::Extension::Socket</small>
|
65
|
+
</li>
|
66
|
+
|
67
|
+
|
68
|
+
<li class="r2 ">
|
69
|
+
<span class='object_link'><a href="Ionian/Server.html#close-instance_method" title="Ionian::Server#close (method)">#close</a></span>
|
58
70
|
<small>Ionian::Server</small>
|
59
71
|
</li>
|
60
72
|
|
@@ -66,65 +78,77 @@
|
|
66
78
|
|
67
79
|
|
68
80
|
<li class="r2 ">
|
81
|
+
<span class='object_link'><a href="Ionian/Server.html#closed%3F-instance_method" title="Ionian::Server#closed? (method)">#closed?</a></span>
|
82
|
+
<small>Ionian::Server</small>
|
83
|
+
</li>
|
84
|
+
|
85
|
+
|
86
|
+
<li class="r1 ">
|
69
87
|
<span class='object_link'><a href="Ionian/Socket.html#cmd-instance_method" title="Ionian::Socket#cmd (method)">#cmd</a></span>
|
70
88
|
<small>Ionian::Socket</small>
|
71
89
|
</li>
|
72
90
|
|
73
91
|
|
74
|
-
<li class="
|
92
|
+
<li class="r2 ">
|
75
93
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#cork-instance_method" title="Ionian::Extension::Socket#cork (method)">#cork</a></span>
|
76
94
|
<small>Ionian::Extension::Socket</small>
|
77
95
|
</li>
|
78
96
|
|
79
97
|
|
80
|
-
<li class="
|
98
|
+
<li class="r1 ">
|
81
99
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#cork%3D-instance_method" title="Ionian::Extension::Socket#cork= (method)">#cork=</a></span>
|
82
100
|
<small>Ionian::Extension::Socket</small>
|
83
101
|
</li>
|
84
102
|
|
85
103
|
|
86
|
-
<li class="
|
104
|
+
<li class="r2 ">
|
87
105
|
<span class='object_link'><a href="Ionian/Socket.html#expression-instance_method" title="Ionian::Socket#expression (method)">#expression</a></span>
|
88
106
|
<small>Ionian::Socket</small>
|
89
107
|
</li>
|
90
108
|
|
91
109
|
|
92
|
-
<li class="
|
110
|
+
<li class="r1 ">
|
93
111
|
<span class='object_link'><a href="Ionian/Extension/IO.html#expression-instance_method" title="Ionian::Extension::IO#expression (method)">#expression</a></span>
|
94
112
|
<small>Ionian::Extension::IO</small>
|
95
113
|
</li>
|
96
114
|
|
97
115
|
|
98
|
-
<li class="
|
116
|
+
<li class="r2 ">
|
99
117
|
<span class='object_link'><a href="Ionian/Extension/IO.html#expression%3D-instance_method" title="Ionian::Extension::IO#expression= (method)">#expression=</a></span>
|
100
118
|
<small>Ionian::Extension::IO</small>
|
101
119
|
</li>
|
102
120
|
|
103
121
|
|
104
|
-
<li class="
|
122
|
+
<li class="r1 ">
|
105
123
|
<span class='object_link'><a href="Ionian/Socket.html#expression%3D-instance_method" title="Ionian::Socket#expression= (method)">#expression=</a></span>
|
106
124
|
<small>Ionian::Socket</small>
|
107
125
|
</li>
|
108
126
|
|
109
127
|
|
110
|
-
<li class="
|
128
|
+
<li class="r2 ">
|
111
129
|
<span class='object_link'><a href="Ionian/Extension/IO.html#extended-class_method" title="Ionian::Extension::IO.extended (method)">extended</a></span>
|
112
130
|
<small>Ionian::Extension::IO</small>
|
113
131
|
</li>
|
114
132
|
|
115
133
|
|
116
|
-
<li class="
|
134
|
+
<li class="r1 ">
|
117
135
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#extended-class_method" title="Ionian::Extension::Socket.extended (method)">extended</a></span>
|
118
136
|
<small>Ionian::Extension::Socket</small>
|
119
137
|
</li>
|
120
138
|
|
121
139
|
|
122
|
-
<li class="
|
140
|
+
<li class="r2 ">
|
123
141
|
<span class='object_link'><a href="Ionian/Socket.html#flush-instance_method" title="Ionian::Socket#flush (method)">#flush</a></span>
|
124
142
|
<small>Ionian::Socket</small>
|
125
143
|
</li>
|
126
144
|
|
127
145
|
|
146
|
+
<li class="r1 ">
|
147
|
+
<span class='object_link'><a href="Ionian/Extension/IO.html#has_data%3F-instance_method" title="Ionian::Extension::IO#has_data? (method)">#has_data?</a></span>
|
148
|
+
<small>Ionian::Extension::IO</small>
|
149
|
+
</li>
|
150
|
+
|
151
|
+
|
128
152
|
<li class="r2 ">
|
129
153
|
<span class='object_link'><a href="Ionian/Socket.html#has_data%3F-instance_method" title="Ionian::Socket#has_data? (method)">#has_data?</a></span>
|
130
154
|
<small>Ionian::Socket</small>
|
@@ -132,8 +156,8 @@
|
|
132
156
|
|
133
157
|
|
134
158
|
<li class="r1 ">
|
135
|
-
<span class='object_link'><a href="Ionian/
|
136
|
-
<small>Ionian::
|
159
|
+
<span class='object_link'><a href="Ionian/Socket.html#host-instance_method" title="Ionian::Socket#host (method)">#host</a></span>
|
160
|
+
<small>Ionian::Socket</small>
|
137
161
|
</li>
|
138
162
|
|
139
163
|
|
@@ -263,6 +287,18 @@
|
|
263
287
|
</li>
|
264
288
|
|
265
289
|
|
290
|
+
<li class="r1 ">
|
291
|
+
<span class='object_link'><a href="Ionian/Extension/Socket.html#linger-instance_method" title="Ionian::Extension::Socket#linger (method)">#linger</a></span>
|
292
|
+
<small>Ionian::Extension::Socket</small>
|
293
|
+
</li>
|
294
|
+
|
295
|
+
|
296
|
+
<li class="r2 ">
|
297
|
+
<span class='object_link'><a href="Ionian/Extension/Socket.html#linger%3D-instance_method" title="Ionian::Extension::Socket#linger= (method)">#linger=</a></span>
|
298
|
+
<small>Ionian::Extension::Socket</small>
|
299
|
+
</li>
|
300
|
+
|
301
|
+
|
266
302
|
<li class="r1 ">
|
267
303
|
<span class='object_link'><a href="Ionian/Server.html#listen-instance_method" title="Ionian::Server#listen (method)">#listen</a></span>
|
268
304
|
<small>Ionian::Server</small>
|
@@ -270,13 +306,13 @@
|
|
270
306
|
|
271
307
|
|
272
308
|
<li class="r2 ">
|
273
|
-
<span class='object_link'><a href="Ionian/Extension/Socket.html#multicast-
|
309
|
+
<span class='object_link'><a href="Ionian/Extension/Socket.html#multicast-class_method" title="Ionian::Extension::Socket.multicast (method)">multicast</a></span>
|
274
310
|
<small>Ionian::Extension::Socket</small>
|
275
311
|
</li>
|
276
312
|
|
277
313
|
|
278
314
|
<li class="r1 ">
|
279
|
-
<span class='object_link'><a href="Ionian/Extension/Socket.html#multicast-
|
315
|
+
<span class='object_link'><a href="Ionian/Extension/Socket.html#multicast-instance_method" title="Ionian::Extension::Socket#multicast (method)">#multicast</a></span>
|
280
316
|
<small>Ionian::Extension::Socket</small>
|
281
317
|
</li>
|
282
318
|
|
@@ -306,53 +342,53 @@
|
|
306
342
|
|
307
343
|
|
308
344
|
<li class="r2 ">
|
309
|
-
<span class='object_link'><a href="Ionian/Socket.html#
|
345
|
+
<span class='object_link'><a href="Ionian/Socket.html#port-instance_method" title="Ionian::Socket#port (method)">#port</a></span>
|
310
346
|
<small>Ionian::Socket</small>
|
311
347
|
</li>
|
312
348
|
|
313
349
|
|
314
350
|
<li class="r1 ">
|
351
|
+
<span class='object_link'><a href="Ionian/Socket.html#protocol-instance_method" title="Ionian::Socket#protocol (method)">#protocol</a></span>
|
352
|
+
<small>Ionian::Socket</small>
|
353
|
+
</li>
|
354
|
+
|
355
|
+
|
356
|
+
<li class="r2 ">
|
315
357
|
<span class='object_link'><a href="Ionian/Extension/IO.html#purge-instance_method" title="Ionian::Extension::IO#purge (method)">#purge</a></span>
|
316
358
|
<small>Ionian::Extension::IO</small>
|
317
359
|
</li>
|
318
360
|
|
319
361
|
|
320
|
-
<li class="
|
362
|
+
<li class="r1 ">
|
321
363
|
<span class='object_link'><a href="Ionian/Socket.html#puts-instance_method" title="Ionian::Socket#puts (method)">#puts</a></span>
|
322
364
|
<small>Ionian::Socket</small>
|
323
365
|
</li>
|
324
366
|
|
325
367
|
|
326
|
-
<li class="
|
368
|
+
<li class="r2 ">
|
327
369
|
<span class='object_link'><a href="Ionian/Extension/IO.html#read_all-instance_method" title="Ionian::Extension::IO#read_all (method)">#read_all</a></span>
|
328
370
|
<small>Ionian::Extension::IO</small>
|
329
371
|
</li>
|
330
372
|
|
331
373
|
|
332
|
-
<li class="
|
374
|
+
<li class="r1 ">
|
333
375
|
<span class='object_link'><a href="Ionian/Extension/IO.html#read_match-instance_method" title="Ionian::Extension::IO#read_match (method)">#read_match</a></span>
|
334
376
|
<small>Ionian::Extension::IO</small>
|
335
377
|
</li>
|
336
378
|
|
337
379
|
|
338
|
-
<li class="
|
380
|
+
<li class="r2 ">
|
339
381
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#recork-instance_method" title="Ionian::Extension::Socket#recork (method)">#recork</a></span>
|
340
382
|
<small>Ionian::Extension::Socket</small>
|
341
383
|
</li>
|
342
384
|
|
343
385
|
|
344
|
-
<li class="
|
386
|
+
<li class="r1 ">
|
345
387
|
<span class='object_link'><a href="Ionian/Server.html#register_accept_listener-instance_method" title="Ionian::Server#register_accept_listener (method)">#register_accept_listener</a></span>
|
346
388
|
<small>Ionian::Server</small>
|
347
389
|
</li>
|
348
390
|
|
349
391
|
|
350
|
-
<li class="r1 ">
|
351
|
-
<span class='object_link'><a href="Ionian/Socket.html#register_observer-instance_method" title="Ionian::Socket#register_observer (method)">#register_observer</a></span>
|
352
|
-
<small>Ionian::Socket</small>
|
353
|
-
</li>
|
354
|
-
|
355
|
-
|
356
392
|
<li class="r2 ">
|
357
393
|
<span class='object_link'><a href="Ionian/Extension/IO.html#register_observer-instance_method" title="Ionian::Extension::IO#register_observer (method)">#register_observer</a></span>
|
358
394
|
<small>Ionian::Extension::IO</small>
|
@@ -360,47 +396,47 @@
|
|
360
396
|
|
361
397
|
|
362
398
|
<li class="r1 ">
|
399
|
+
<span class='object_link'><a href="Ionian/Socket.html#register_observer-instance_method" title="Ionian::Socket#register_observer (method)">#register_observer</a></span>
|
400
|
+
<small>Ionian::Socket</small>
|
401
|
+
</li>
|
402
|
+
|
403
|
+
|
404
|
+
<li class="r2 ">
|
363
405
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#reuse_addr-instance_method" title="Ionian::Extension::Socket#reuse_addr (method)">#reuse_addr</a></span>
|
364
406
|
<small>Ionian::Extension::Socket</small>
|
365
407
|
</li>
|
366
408
|
|
367
409
|
|
368
|
-
<li class="
|
410
|
+
<li class="r1 ">
|
369
411
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#reuse_addr%3D-instance_method" title="Ionian::Extension::Socket#reuse_addr= (method)">#reuse_addr=</a></span>
|
370
412
|
<small>Ionian::Extension::Socket</small>
|
371
413
|
</li>
|
372
414
|
|
373
415
|
|
374
|
-
<li class="
|
416
|
+
<li class="r2 ">
|
375
417
|
<span class='object_link'><a href="Ionian/Extension/IO.html#run_match-instance_method" title="Ionian::Extension::IO#run_match (method)">#run_match</a></span>
|
376
418
|
<small>Ionian::Extension::IO</small>
|
377
419
|
</li>
|
378
420
|
|
379
421
|
|
380
|
-
<li class="
|
422
|
+
<li class="r1 ">
|
381
423
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#ttl-instance_method" title="Ionian::Extension::Socket#ttl (method)">#ttl</a></span>
|
382
424
|
<small>Ionian::Extension::Socket</small>
|
383
425
|
</li>
|
384
426
|
|
385
427
|
|
386
|
-
<li class="
|
428
|
+
<li class="r2 ">
|
387
429
|
<span class='object_link'><a href="Ionian/Extension/Socket.html#ttl%3D-instance_method" title="Ionian::Extension::Socket#ttl= (method)">#ttl=</a></span>
|
388
430
|
<small>Ionian::Extension::Socket</small>
|
389
431
|
</li>
|
390
432
|
|
391
433
|
|
392
|
-
<li class="
|
434
|
+
<li class="r1 ">
|
393
435
|
<span class='object_link'><a href="Ionian/Server.html#unregister_accept_listener-instance_method" title="Ionian::Server#unregister_accept_listener (method)">#unregister_accept_listener</a></span>
|
394
436
|
<small>Ionian::Server</small>
|
395
437
|
</li>
|
396
438
|
|
397
439
|
|
398
|
-
<li class="r1 ">
|
399
|
-
<span class='object_link'><a href="Ionian/Extension/IO.html#unregister_observer-instance_method" title="Ionian::Extension::IO#unregister_observer (method)">#unregister_observer</a></span>
|
400
|
-
<small>Ionian::Extension::IO</small>
|
401
|
-
</li>
|
402
|
-
|
403
|
-
|
404
440
|
<li class="r2 ">
|
405
441
|
<span class='object_link'><a href="Ionian/Socket.html#unregister_observer-instance_method" title="Ionian::Socket#unregister_observer (method)">#unregister_observer</a></span>
|
406
442
|
<small>Ionian::Socket</small>
|
@@ -408,6 +444,12 @@
|
|
408
444
|
|
409
445
|
|
410
446
|
<li class="r1 ">
|
447
|
+
<span class='object_link'><a href="Ionian/Extension/IO.html#unregister_observer-instance_method" title="Ionian::Extension::IO#unregister_observer (method)">#unregister_observer</a></span>
|
448
|
+
<small>Ionian::Extension::IO</small>
|
449
|
+
</li>
|
450
|
+
|
451
|
+
|
452
|
+
<li class="r2 ">
|
411
453
|
<span class='object_link'><a href="Ionian/Socket.html#write-instance_method" title="Ionian::Socket#write (method)">#write</a></span>
|
412
454
|
<small>Ionian::Socket</small>
|
413
455
|
</li>
|
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.4
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -17,7 +17,7 @@
|
|
17
17
|
<script type="text/javascript" charset="utf-8">
|
18
18
|
hasFrames = window.top.frames.main ? true : false;
|
19
19
|
relpath = '';
|
20
|
-
framesUrl = "frames.html#!"
|
20
|
+
framesUrl = "frames.html#!top-level-namespace.html";
|
21
21
|
</script>
|
22
22
|
|
23
23
|
|
@@ -103,9 +103,9 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Fri Apr 11 21:18:17 2014 by
|
107
107
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
108
|
-
0.8.7.
|
108
|
+
0.8.7.4 (ruby-2.1.1).
|
109
109
|
</div>
|
110
110
|
|
111
111
|
</body>
|
data/lib/ionian/extension/io.rb
CHANGED
@@ -12,7 +12,7 @@ module Ionian
|
|
12
12
|
attr_accessor :ionian_timeout
|
13
13
|
|
14
14
|
# Called automaticallly when the object is extended with #extend.
|
15
|
-
def self.extended
|
15
|
+
def self.extended obj
|
16
16
|
obj.initialize_ionian
|
17
17
|
end
|
18
18
|
|
@@ -46,7 +46,7 @@ module Ionian
|
|
46
46
|
# sequence. It is possible to use named captures in a
|
47
47
|
# regex, which allows for convienient accessors like
|
48
48
|
# match[:parameter].
|
49
|
-
def expression=
|
49
|
+
def expression= exp
|
50
50
|
@ionian_expression = exp
|
51
51
|
@ionian_expression = Regexp.new "(.*?)#{expression}" if exp.is_a? String
|
52
52
|
end
|
@@ -54,7 +54,9 @@ module Ionian
|
|
54
54
|
# Read all data in the buffer.
|
55
55
|
# An alternative to using #readpartial with a large length.
|
56
56
|
def read_all
|
57
|
-
|
57
|
+
data = ''
|
58
|
+
data += readpartial 0xFFFF while has_data?
|
59
|
+
data
|
58
60
|
end
|
59
61
|
|
60
62
|
# Read matched data from the buffer.
|
@@ -83,7 +85,7 @@ module Ionian
|
|
83
85
|
# are calling IO::select ahead of this method.
|
84
86
|
# build_methods: Build accessor methods from named capture groups.
|
85
87
|
# Enabled by default.
|
86
|
-
def read_match
|
88
|
+
def read_match **kwargs, &block
|
87
89
|
timeout = kwargs.fetch :timeout, @ionian_timeout
|
88
90
|
notify = kwargs.fetch :notify, true
|
89
91
|
skip_select = kwargs.fetch :skip_select, @ionian_skip_select
|
@@ -97,10 +99,7 @@ module Ionian
|
|
97
99
|
end
|
98
100
|
|
99
101
|
# Read data from the IO buffer until it's empty.
|
100
|
-
|
101
|
-
@ionian_buf << readpartial(0xFFFF)
|
102
|
-
break unless ::IO.select [self], nil, nil, 0
|
103
|
-
end
|
102
|
+
@ionian_buf << read_all
|
104
103
|
|
105
104
|
@matches = []
|
106
105
|
|
@@ -113,19 +112,21 @@ module Ionian
|
|
113
112
|
if build_methods
|
114
113
|
@matches.each do |match|
|
115
114
|
match.names
|
116
|
-
.map {|name| name.to_sym}
|
117
|
-
.each {|symbol|
|
118
|
-
.
|
119
|
-
|
115
|
+
.map { |name| name.to_sym }
|
116
|
+
.each { |symbol|
|
117
|
+
match.singleton_class
|
118
|
+
.send(:define_method, symbol) { match[symbol] } \
|
119
|
+
unless match.respond_to? symbol
|
120
120
|
}
|
121
121
|
end
|
122
122
|
end
|
123
123
|
|
124
124
|
# Pass each match to block.
|
125
|
-
@matches.each {|match| yield match} if block_given?
|
125
|
+
@matches.each { |match| yield match } if block_given?
|
126
126
|
|
127
127
|
# Notify on_match listeners unless the #run_match thread is active.
|
128
|
-
@matches.each {|match| notify_listeners match}
|
128
|
+
@matches.each { |match| notify_listeners match } \
|
129
|
+
if notify and not @match_listener
|
129
130
|
|
130
131
|
@matches
|
131
132
|
end
|
@@ -133,12 +134,12 @@ module Ionian
|
|
133
134
|
# Start a thread that checks for data and notifies listeners (do |match, socket|).
|
134
135
|
# Passes kwargs to #read_match.
|
135
136
|
# This method SHOULD NOT be used if #read_match is used.
|
136
|
-
def run_match
|
137
|
+
def run_match **kwargs
|
137
138
|
@match_listener ||= Thread.new do
|
138
139
|
begin
|
139
140
|
while not closed? do
|
140
141
|
matches = read_match **kwargs
|
141
|
-
matches.each {|match| notify_listeners match } if matches
|
142
|
+
matches.each { |match| notify_listeners match } if matches
|
142
143
|
end
|
143
144
|
rescue EOFError
|
144
145
|
rescue IOError
|
@@ -152,10 +153,7 @@ module Ionian
|
|
152
153
|
# This is typically handled automatically.
|
153
154
|
def purge
|
154
155
|
# Erase IO buffer.
|
155
|
-
|
156
|
-
readpartial(0xFFFF)
|
157
|
-
end
|
158
|
-
|
156
|
+
read_all
|
159
157
|
@ionian_buf = ''
|
160
158
|
end
|
161
159
|
|
@@ -163,7 +161,7 @@ module Ionian
|
|
163
161
|
# Method callbacks can be registered with &object.method(:method).
|
164
162
|
# Returns a reference to the given block.
|
165
163
|
# block = ionian_socket.register_observer { ... }
|
166
|
-
def register_observer
|
164
|
+
def register_observer &block
|
167
165
|
@ionian_listeners << block unless @ionian_listeners.include? block
|
168
166
|
block
|
169
167
|
end
|
@@ -171,8 +169,8 @@ module Ionian
|
|
171
169
|
alias_method :on_match, :register_observer
|
172
170
|
|
173
171
|
# Unregister a block from being called when matched data is received.
|
174
|
-
def unregister_observer
|
175
|
-
@ionian_listeners.delete_if {|o| o == block}
|
172
|
+
def unregister_observer &block
|
173
|
+
@ionian_listeners.delete_if { |o| o == block }
|
176
174
|
block
|
177
175
|
end
|
178
176
|
|
@@ -182,7 +180,7 @@ module Ionian
|
|
182
180
|
# Send match to each of the registered observers. Includes self
|
183
181
|
# as the second block parameter.
|
184
182
|
def notify_listeners match
|
185
|
-
@ionian_listeners.each {|listener| listener.call match, self}
|
183
|
+
@ionian_listeners.each { |listener| listener.call match, self }
|
186
184
|
end
|
187
185
|
|
188
186
|
end
|