ionian 0.6.8 → 0.6.9
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/doc/Ionian/Extension/IO.html +253 -89
- data/doc/Ionian/Extension/Socket.html +9 -9
- data/doc/Ionian/Extension.html +3 -3
- data/doc/Ionian/Server.html +3 -3
- data/doc/Ionian/Socket.html +464 -149
- data/doc/Ionian.html +3 -3
- data/doc/_index.html +4 -4
- data/doc/class_list.html +5 -1
- data/doc/file.README.html +25 -24
- data/doc/file.license.html +4 -4
- data/doc/file_list.html +5 -1
- data/doc/frames.html +1 -1
- data/doc/index.html +25 -24
- data/doc/js/full_list.js +4 -1
- data/doc/method_list.html +5 -1
- data/doc/top-level-namespace.html +3 -3
- data/lib/ionian/extension/io.rb +44 -29
- data/lib/ionian/extension/socket.rb +6 -6
- data/lib/ionian/socket.rb +79 -27
- data/license.txt +1 -1
- metadata +32 -4
data/doc/Ionian.html
CHANGED
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Module: Ionian
|
8
8
|
|
9
|
-
— Documentation by YARD 0.8.7.
|
9
|
+
— Documentation by YARD 0.8.7.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -123,9 +123,9 @@ Features regular expression matching and notification of received data.</p>
|
|
123
123
|
</div>
|
124
124
|
|
125
125
|
<div id="footer">
|
126
|
-
Generated on
|
126
|
+
Generated on Fri Oct 31 15:50:43 2014 by
|
127
127
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
128
|
-
0.8.7.
|
128
|
+
0.8.7.6 (ruby-2.1.4).
|
129
129
|
</div>
|
130
130
|
|
131
131
|
</body>
|
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.6
|
8
8
|
|
9
9
|
</title>
|
10
10
|
|
@@ -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.6</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 Oct 31 15:50:42 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.6 (ruby-2.1.4).
|
161
161
|
</div>
|
162
162
|
|
163
163
|
</body>
|
data/doc/class_list.html
CHANGED
@@ -20,7 +20,11 @@
|
|
20
20
|
</head>
|
21
21
|
<body>
|
22
22
|
<script type="text/javascript" charset="utf-8">
|
23
|
-
|
23
|
+
var hasFrames = false;
|
24
|
+
try {
|
25
|
+
hasFrames = window.top.frames.main ? true : false;
|
26
|
+
} catch (e) { }
|
27
|
+
if (hasFrames) {
|
24
28
|
document.getElementById('base_target').target = 'main';
|
25
29
|
document.body.className = 'frames';
|
26
30
|
}
|
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.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -61,39 +61,41 @@
|
|
61
61
|
|
62
62
|
<iframe id="search_frame"></iframe>
|
63
63
|
|
64
|
-
<div id="content"><div id='filecontents'
|
64
|
+
<div id="content"><div id='filecontents'>
|
65
|
+
<h1 id="label-Ionian">Ionian</h1>
|
65
66
|
|
66
|
-
<p><a href="http://badge.fury.io/rb/ionian"><img
|
67
|
+
<p><a href="http://badge.fury.io/rb/ionian"><img
|
68
|
+
src="https://badge.fury.io/rb/ionian.png"></a></p>
|
67
69
|
|
68
|
-
<p>A Ruby library to simplify interaction with IO streams. This includes
|
70
|
+
<p>A Ruby library to simplify interaction with IO streams. This includes
|
71
|
+
network sockets, file sockets, and serial streams like the console and
|
72
|
+
RS232. Features regular expression matching and notification of received
|
73
|
+
data.</p>
|
69
74
|
|
70
|
-
<h2>Supported Ruby Versions</h2>
|
75
|
+
<h2 id="label-Supported+Ruby+Versions">Supported Ruby Versions</h2>
|
76
|
+
<ul><li>
|
77
|
+
<p>MRI >= 2.0.0</p>
|
78
|
+
</li></ul>
|
71
79
|
|
72
|
-
<
|
73
|
-
<li>MRI >= 2.0.0</li>
|
74
|
-
</ul>
|
80
|
+
<h2 id="label-Installation">Installation</h2>
|
75
81
|
|
82
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_ionian'>ionian</span></code></pre>
|
76
83
|
|
77
|
-
<h2>
|
84
|
+
<h2 id="label-Code+Examples">Code Examples</h2>
|
78
85
|
|
79
|
-
<
|
80
|
-
</code></pre>
|
81
|
-
|
82
|
-
<h2>Code Examples</h2>
|
83
|
-
|
84
|
-
<h3>Creating A Socket</h3>
|
86
|
+
<h3 id="label-Creating+A+Socket">Creating A Socket</h3>
|
85
87
|
|
86
88
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_socket'>socket</span> <span class='op'>=</span> <span class='const'>Ionian</span><span class='op'>::</span><span class='const'>Socket</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>host:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>127.0.0.1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>port:</span> <span class='int'>23</span>
|
87
89
|
</code></pre>
|
88
90
|
|
89
|
-
<h3>Sending And Receiving Data</h3>
|
91
|
+
<h3 id="label-Sending+And+Receiving+Data">Sending And Receiving Data</h3>
|
90
92
|
|
91
93
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_socket'>socket</span> <span class='op'>=</span> <span class='const'>Ionian</span><span class='op'>::</span><span class='const'>Socket</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>host:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>google.com</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>port:</span> <span class='int'>80</span>
|
92
94
|
<span class='id identifier rubyid_socket'>socket</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>GET / HTTP/1.1\r\n\r\n</span><span class='tstring_end'>"</span></span>
|
93
95
|
<span class='id identifier rubyid_socket'>socket</span><span class='period'>.</span><span class='id identifier rubyid_read_match'>read_match</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_match'>match</span><span class='semicolon'>;</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
94
96
|
</code></pre>
|
95
97
|
|
96
|
-
<h3>Match Expressions And Named Captures</h3>
|
98
|
+
<h3 id="label-Match+Expressions+And+Named+Captures">Match Expressions And Named Captures</h3>
|
97
99
|
|
98
100
|
<pre class="code ruby"><code class="ruby"><span class='comment'># A simple IRC client.
|
99
101
|
</span>
|
@@ -112,16 +114,15 @@
|
|
112
114
|
|
113
115
|
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
114
116
|
<span class='id identifier rubyid_socket'>socket</span><span class='period'>.</span><span class='id identifier rubyid_read_match'>read_match</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span>
|
115
|
-
|
117
|
+
<span class='comment'># Print the body of the server's responses.
|
116
118
|
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_msg'>msg</span>
|
117
|
-
|
119
|
+
|
118
120
|
<span class='comment'># Exit when the server has caught up.
|
119
121
|
</span> <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_msg'>msg</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>End of /NAMES list.</span><span class='tstring_end'>'</span></span>
|
120
122
|
<span class='kw'>end</span>
|
121
|
-
<span class='kw'>end</span>
|
122
|
-
</code></pre>
|
123
|
+
<span class='kw'>end</span></code></pre>
|
123
124
|
|
124
|
-
<h3>Simple Server</h3>
|
125
|
+
<h3 id="label-Simple+Server">Simple Server</h3>
|
125
126
|
|
126
127
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>localhost:5000</span><span class='tstring_end'>'</span></span>
|
127
128
|
|
@@ -137,9 +138,9 @@
|
|
137
138
|
</div></div>
|
138
139
|
|
139
140
|
<div id="footer">
|
140
|
-
Generated on
|
141
|
+
Generated on Fri Oct 31 15:50:43 2014 by
|
141
142
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
142
|
-
0.8.7.
|
143
|
+
0.8.7.6 (ruby-2.1.4).
|
143
144
|
</div>
|
144
145
|
|
145
146
|
</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.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -61,12 +61,12 @@
|
|
61
61
|
|
62
62
|
<iframe id="search_frame"></iframe>
|
63
63
|
|
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.
|
64
|
+
<div id="content"><div id='filecontents'>The MIT License (MIT)<br/><br/>Copyright (c) 2013-2014 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 Oct 31 15:50:43 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.6 (ruby-2.1.4).
|
70
70
|
</div>
|
71
71
|
|
72
72
|
</body>
|
data/doc/file_list.html
CHANGED
@@ -20,7 +20,11 @@
|
|
20
20
|
</head>
|
21
21
|
<body>
|
22
22
|
<script type="text/javascript" charset="utf-8">
|
23
|
-
|
23
|
+
var hasFrames = false;
|
24
|
+
try {
|
25
|
+
hasFrames = window.top.frames.main ? true : false;
|
26
|
+
} catch (e) { }
|
27
|
+
if (hasFrames) {
|
24
28
|
document.getElementById('base_target').target = 'main';
|
25
29
|
document.body.className = 'frames';
|
26
30
|
}
|
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.6</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.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -61,39 +61,41 @@
|
|
61
61
|
|
62
62
|
<iframe id="search_frame"></iframe>
|
63
63
|
|
64
|
-
<div id="content"><div id='filecontents'
|
64
|
+
<div id="content"><div id='filecontents'>
|
65
|
+
<h1 id="label-Ionian">Ionian</h1>
|
65
66
|
|
66
|
-
<p><a href="http://badge.fury.io/rb/ionian"><img
|
67
|
+
<p><a href="http://badge.fury.io/rb/ionian"><img
|
68
|
+
src="https://badge.fury.io/rb/ionian.png"></a></p>
|
67
69
|
|
68
|
-
<p>A Ruby library to simplify interaction with IO streams. This includes
|
70
|
+
<p>A Ruby library to simplify interaction with IO streams. This includes
|
71
|
+
network sockets, file sockets, and serial streams like the console and
|
72
|
+
RS232. Features regular expression matching and notification of received
|
73
|
+
data.</p>
|
69
74
|
|
70
|
-
<h2>Supported Ruby Versions</h2>
|
75
|
+
<h2 id="label-Supported+Ruby+Versions">Supported Ruby Versions</h2>
|
76
|
+
<ul><li>
|
77
|
+
<p>MRI >= 2.0.0</p>
|
78
|
+
</li></ul>
|
71
79
|
|
72
|
-
<
|
73
|
-
<li>MRI >= 2.0.0</li>
|
74
|
-
</ul>
|
80
|
+
<h2 id="label-Installation">Installation</h2>
|
75
81
|
|
82
|
+
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_gem'>gem</span> <span class='id identifier rubyid_install'>install</span> <span class='id identifier rubyid_ionian'>ionian</span></code></pre>
|
76
83
|
|
77
|
-
<h2>
|
84
|
+
<h2 id="label-Code+Examples">Code Examples</h2>
|
78
85
|
|
79
|
-
<
|
80
|
-
</code></pre>
|
81
|
-
|
82
|
-
<h2>Code Examples</h2>
|
83
|
-
|
84
|
-
<h3>Creating A Socket</h3>
|
86
|
+
<h3 id="label-Creating+A+Socket">Creating A Socket</h3>
|
85
87
|
|
86
88
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_socket'>socket</span> <span class='op'>=</span> <span class='const'>Ionian</span><span class='op'>::</span><span class='const'>Socket</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>host:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>127.0.0.1</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>port:</span> <span class='int'>23</span>
|
87
89
|
</code></pre>
|
88
90
|
|
89
|
-
<h3>Sending And Receiving Data</h3>
|
91
|
+
<h3 id="label-Sending+And+Receiving+Data">Sending And Receiving Data</h3>
|
90
92
|
|
91
93
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_socket'>socket</span> <span class='op'>=</span> <span class='const'>Ionian</span><span class='op'>::</span><span class='const'>Socket</span><span class='period'>.</span><span class='id identifier rubyid_new'>new</span> <span class='label'>host:</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>google.com</span><span class='tstring_end'>'</span></span><span class='comma'>,</span> <span class='label'>port:</span> <span class='int'>80</span>
|
92
94
|
<span class='id identifier rubyid_socket'>socket</span><span class='period'>.</span><span class='id identifier rubyid_write'>write</span> <span class='tstring'><span class='tstring_beg'>"</span><span class='tstring_content'>GET / HTTP/1.1\r\n\r\n</span><span class='tstring_end'>"</span></span>
|
93
95
|
<span class='id identifier rubyid_socket'>socket</span><span class='period'>.</span><span class='id identifier rubyid_read_match'>read_match</span> <span class='lbrace'>{</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span> <span class='id identifier rubyid_p'>p</span> <span class='id identifier rubyid_match'>match</span><span class='semicolon'>;</span> <span class='id identifier rubyid_puts'>puts</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_end'>'</span></span> <span class='rbrace'>}</span>
|
94
96
|
</code></pre>
|
95
97
|
|
96
|
-
<h3>Match Expressions And Named Captures</h3>
|
98
|
+
<h3 id="label-Match+Expressions+And+Named+Captures">Match Expressions And Named Captures</h3>
|
97
99
|
|
98
100
|
<pre class="code ruby"><code class="ruby"><span class='comment'># A simple IRC client.
|
99
101
|
</span>
|
@@ -112,16 +114,15 @@
|
|
112
114
|
|
113
115
|
<span class='id identifier rubyid_loop'>loop</span> <span class='kw'>do</span>
|
114
116
|
<span class='id identifier rubyid_socket'>socket</span><span class='period'>.</span><span class='id identifier rubyid_read_match'>read_match</span> <span class='kw'>do</span> <span class='op'>|</span><span class='id identifier rubyid_match'>match</span><span class='op'>|</span>
|
115
|
-
|
117
|
+
<span class='comment'># Print the body of the server's responses.
|
116
118
|
</span> <span class='id identifier rubyid_puts'>puts</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_msg'>msg</span>
|
117
|
-
|
119
|
+
|
118
120
|
<span class='comment'># Exit when the server has caught up.
|
119
121
|
</span> <span class='id identifier rubyid_exit'>exit</span> <span class='kw'>if</span> <span class='id identifier rubyid_match'>match</span><span class='period'>.</span><span class='id identifier rubyid_msg'>msg</span><span class='period'>.</span><span class='id identifier rubyid_include?'>include?</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>End of /NAMES list.</span><span class='tstring_end'>'</span></span>
|
120
122
|
<span class='kw'>end</span>
|
121
|
-
<span class='kw'>end</span>
|
122
|
-
</code></pre>
|
123
|
+
<span class='kw'>end</span></code></pre>
|
123
124
|
|
124
|
-
<h3>Simple Server</h3>
|
125
|
+
<h3 id="label-Simple+Server">Simple Server</h3>
|
125
126
|
|
126
127
|
<pre class="code ruby"><code class="ruby"><span class='id identifier rubyid_host'>host</span> <span class='op'>=</span> <span class='tstring'><span class='tstring_beg'>'</span><span class='tstring_content'>localhost:5000</span><span class='tstring_end'>'</span></span>
|
127
128
|
|
@@ -137,9 +138,9 @@
|
|
137
138
|
</div></div>
|
138
139
|
|
139
140
|
<div id="footer">
|
140
|
-
Generated on
|
141
|
+
Generated on Fri Oct 31 15:50:43 2014 by
|
141
142
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
142
|
-
0.8.7.
|
143
|
+
0.8.7.6 (ruby-2.1.4).
|
143
144
|
</div>
|
144
145
|
|
145
146
|
</body>
|
data/doc/js/full_list.js
CHANGED
@@ -123,7 +123,10 @@ function linkList() {
|
|
123
123
|
}
|
124
124
|
}
|
125
125
|
if (clicked) clicked.removeClass('clicked');
|
126
|
-
var win
|
126
|
+
var win;
|
127
|
+
try {
|
128
|
+
win = window.top.frames.main ? window.top.frames.main : window.parent;
|
129
|
+
} catch (e) { win = window.parent; }
|
127
130
|
if (this.tagName.toLowerCase() == "a") {
|
128
131
|
clicked = $(this).parents('li').addClass('clicked');
|
129
132
|
win.location = this.href;
|
data/doc/method_list.html
CHANGED
@@ -20,7 +20,11 @@
|
|
20
20
|
</head>
|
21
21
|
<body>
|
22
22
|
<script type="text/javascript" charset="utf-8">
|
23
|
-
|
23
|
+
var hasFrames = false;
|
24
|
+
try {
|
25
|
+
hasFrames = window.top.frames.main ? true : false;
|
26
|
+
} catch (e) { }
|
27
|
+
if (hasFrames) {
|
24
28
|
document.getElementById('base_target').target = 'main';
|
25
29
|
document.body.className = 'frames';
|
26
30
|
}
|
@@ -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.6
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -103,9 +103,9 @@
|
|
103
103
|
</div>
|
104
104
|
|
105
105
|
<div id="footer">
|
106
|
-
Generated on
|
106
|
+
Generated on Fri Oct 31 15:50:43 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.6 (ruby-2.1.4).
|
109
109
|
</div>
|
110
110
|
|
111
111
|
</body>
|
data/lib/ionian/extension/io.rb
CHANGED
@@ -29,15 +29,16 @@ module Ionian
|
|
29
29
|
@ionian_build_methods = true
|
30
30
|
end
|
31
31
|
|
32
|
-
#
|
33
|
-
#
|
34
|
-
#
|
35
|
-
#
|
32
|
+
# @return [Boolean] True if there is data in the receive buffer.
|
33
|
+
#
|
34
|
+
# @param timeout [Numeric] Number of seconds to wait for data until
|
35
|
+
# giving up. Set to nil for blocking.
|
36
|
+
#
|
36
37
|
def has_data? timeout: 0
|
37
38
|
::IO.select([self], nil, nil, timeout) ? true : false
|
38
39
|
end
|
39
40
|
|
40
|
-
# Returns the regular expression used for #read_match.
|
41
|
+
# Returns the regular expression used for {#read_match}.
|
41
42
|
def expression
|
42
43
|
@ionian_expression
|
43
44
|
end
|
@@ -68,31 +69,40 @@ module Ionian
|
|
68
69
|
end
|
69
70
|
|
70
71
|
# Read matched data from the buffer.
|
71
|
-
# This method SHOULD NOT be used if #run_match is used.
|
72
|
-
#
|
73
|
-
# Passes matches to the block (do |match|). If there are multiple
|
74
|
-
# matches, the block is called multiple times.
|
75
|
-
#
|
76
|
-
# Returns an array of matches.
|
77
|
-
# Returns nil if no data was received within the timeout period.
|
78
|
-
#
|
72
|
+
# This method SHOULD NOT be used if {#run_match} is used.
|
73
|
+
#
|
79
74
|
# Junk data that could exist before a match in the buffer can
|
80
75
|
# be accessed with match.pre_match.
|
81
|
-
#
|
76
|
+
#
|
82
77
|
# Data at the end of the buffer that is not matched can be accessed
|
83
78
|
# in the last match with match.post_match. This data remains in the
|
84
|
-
# buffer for the next #read_match cycle. This is helpful for protocols
|
79
|
+
# buffer for the next {#read_match} cycle. This is helpful for protocols
|
85
80
|
# like RS232 that do not have packet boundries.
|
86
|
-
#
|
87
|
-
#
|
88
|
-
#
|
89
|
-
#
|
90
|
-
#
|
91
|
-
#
|
92
|
-
#
|
93
|
-
#
|
94
|
-
#
|
95
|
-
#
|
81
|
+
#
|
82
|
+
#
|
83
|
+
# @yieldparam match [MatchData] If there are multiple matches, the block
|
84
|
+
# is called multiple times.
|
85
|
+
#
|
86
|
+
# @return [Array<MatchData>, nil] Returns an array of matches.
|
87
|
+
# Returns nil if no data was received within the timeout period.
|
88
|
+
#
|
89
|
+
#
|
90
|
+
# @option kwargs [Numeric] :timeout (nil) Timeout in seconds IO::select
|
91
|
+
# will block. Blocks indefinitely by default. Set to 0 for nonblocking.
|
92
|
+
#
|
93
|
+
# @option kwargs [Regexp, String] :expression Override the expression
|
94
|
+
# match for this single method call.
|
95
|
+
#
|
96
|
+
# @option kwargs [Boolean] :notify (true) Set to false to skip notifying
|
97
|
+
# match listener procs.
|
98
|
+
#
|
99
|
+
# @option kwargs [Boolean] :skip_select (false) Skip over the
|
100
|
+
# IO::select statement. Use if you are calling IO::select ahead of
|
101
|
+
# this method.
|
102
|
+
#
|
103
|
+
# @option kwargs [Boolean] :build_methods (true) Build accessor methods
|
104
|
+
# from named capture groups.
|
105
|
+
#
|
96
106
|
def read_match **kwargs, &block
|
97
107
|
timeout = kwargs.fetch :timeout, @ionian_timeout
|
98
108
|
notify = kwargs.fetch :notify, true
|
@@ -140,8 +150,8 @@ module Ionian
|
|
140
150
|
end
|
141
151
|
|
142
152
|
# Start a thread that checks for data and notifies listeners (do |match, socket|).
|
143
|
-
# Passes kwargs to #read_match.
|
144
|
-
# This method SHOULD NOT be used if #read_match is used.
|
153
|
+
# Passes kwargs to {#read_match}.
|
154
|
+
# This method SHOULD NOT be used if {#read_match} is used.
|
145
155
|
def run_match **kwargs
|
146
156
|
@match_listener ||= Thread.new do
|
147
157
|
begin
|
@@ -165,10 +175,15 @@ module Ionian
|
|
165
175
|
@ionian_buf = ''
|
166
176
|
end
|
167
177
|
|
168
|
-
# Register a block to be called when #run_match receives matched data.
|
178
|
+
# Register a block to be called when {#run_match} receives matched data.
|
169
179
|
# Method callbacks can be registered with &object.method(:method).
|
170
180
|
# Returns a reference to the given block.
|
171
|
-
#
|
181
|
+
#
|
182
|
+
# @example
|
183
|
+
# registered_block = ionian_socket.register_observer { |match| ... }
|
184
|
+
#
|
185
|
+
# @example
|
186
|
+
# registered_block = ionian_socket.register_observer &my_object.method(:foo)
|
172
187
|
def register_observer &block
|
173
188
|
@ionian_listeners << block unless @ionian_listeners.include? block
|
174
189
|
block
|
@@ -35,7 +35,7 @@ module Ionian
|
|
35
35
|
# Permit sending broadcast datagrams if true.
|
36
36
|
# ( SO_BROADCAST )
|
37
37
|
def broadcast= value
|
38
|
-
param = value ? 1 : 0
|
38
|
+
param = (!!value && value != 0) ? 1 : 0
|
39
39
|
self.setsockopt ::Socket::SOL_SOCKET, ::Socket::SO_BROADCAST, [param].pack('i')
|
40
40
|
end
|
41
41
|
|
@@ -62,7 +62,7 @@ module Ionian
|
|
62
62
|
def linger= enable, time: 60
|
63
63
|
# TODO: Passing a kwarg doesn't work here because of the
|
64
64
|
# assignment operator. Causes parser error.
|
65
|
-
param = enable ? 1 : 0
|
65
|
+
param = (!!enable && enable != 0) ? 1 : 0
|
66
66
|
self.setsockopt ::Socket::SOL_SOCKET, ::Socket::SO_LINGER, [param, time.to_i].pack('ii')
|
67
67
|
end
|
68
68
|
|
@@ -81,7 +81,7 @@ module Ionian
|
|
81
81
|
# Allows local address reuse if true.
|
82
82
|
# ( SO_REUSEADDR )
|
83
83
|
def reuse_addr= value
|
84
|
-
param = value ? 1 : 0
|
84
|
+
param = (!!value && value != 0) ? 1 : 0
|
85
85
|
self.setsockopt ::Socket::SOL_SOCKET, ::Socket::SO_REUSEADDR, [param].pack('i')
|
86
86
|
end
|
87
87
|
|
@@ -113,7 +113,7 @@ module Ionian
|
|
113
113
|
# Disables the Nagle algorithm if true.
|
114
114
|
# ( TCP_NODELAY )
|
115
115
|
def no_delay= value
|
116
|
-
param = value ? 1 : 0
|
116
|
+
param = (!!value && value != 0) ? 1 : 0
|
117
117
|
self.setsockopt ::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, [param].pack('i')
|
118
118
|
end
|
119
119
|
|
@@ -138,7 +138,7 @@ module Ionian
|
|
138
138
|
# Linux only.
|
139
139
|
# ( TCP_CORK )
|
140
140
|
def cork= value
|
141
|
-
param = value ? 1 : 0
|
141
|
+
param = (!!value && value != 0) ? 1 : 0
|
142
142
|
self.setsockopt ::Socket::IPPROTO_TCP, ::Socket::TCP_CORK, [param].pack('i')
|
143
143
|
end
|
144
144
|
|
@@ -225,7 +225,7 @@ module Ionian
|
|
225
225
|
# Enables loopback of outgoing multicasts if true.
|
226
226
|
# ( IP_MULTICAST_LOOP )
|
227
227
|
def ip_multicast_loop= value
|
228
|
-
param = value ? 1 : 0
|
228
|
+
param = (!!value && value != 0) ? 1 : 0
|
229
229
|
self.setsockopt ::Socket::IPPROTO_IP, ::Socket::IP_MULTICAST_LOOP, [param].pack('C')
|
230
230
|
end
|
231
231
|
|