ionian 0.2.0 → 0.3.0
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 +636 -0
- data/doc/Ionian/Extension/Socket.html +286 -0
- data/doc/Ionian/Extension.html +99 -0
- data/doc/Ionian/IO.html +2 -2
- data/doc/Ionian/Socket.html +286 -0
- data/doc/created.rid +4 -3
- data/doc/index.html +2 -0
- data/doc/js/search_index.js +1 -1
- data/doc/table_of_contents.html +23 -0
- data/lib/ionian/io.rb +2 -2
- data/lib/ionian/socket.rb +38 -0
- data/lib/ionian.rb +1 -0
- metadata +41 -35
@@ -0,0 +1,286 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta charset="UTF-8">
|
6
|
+
|
7
|
+
<title>module Ionian::Socket - RDoc Documentation</title>
|
8
|
+
|
9
|
+
<link href="../fonts.css" rel="stylesheet">
|
10
|
+
<link href="../rdoc.css" rel="stylesheet">
|
11
|
+
|
12
|
+
<script type="text/javascript">
|
13
|
+
var rdoc_rel_prefix = "../";
|
14
|
+
</script>
|
15
|
+
|
16
|
+
<script src="../js/jquery.js"></script>
|
17
|
+
<script src="../js/navigation.js"></script>
|
18
|
+
<script src="../js/search_index.js"></script>
|
19
|
+
<script src="../js/search.js"></script>
|
20
|
+
<script src="../js/searcher.js"></script>
|
21
|
+
<script src="../js/darkfish.js"></script>
|
22
|
+
|
23
|
+
|
24
|
+
<body id="top" role="document" class="module">
|
25
|
+
<nav role="navigation">
|
26
|
+
<div id="project-navigation">
|
27
|
+
<div id="home-section" role="banner" class="nav-section">
|
28
|
+
<h2>
|
29
|
+
<a href="../index.html" rel="home">Home</a>
|
30
|
+
</h2>
|
31
|
+
|
32
|
+
<h3>
|
33
|
+
<a href="../table_of_contents.html#pages">Pages</a>
|
34
|
+
<a href="../table_of_contents.html#classes">Classes</a>
|
35
|
+
<a href="../table_of_contents.html#methods">Methods</a>
|
36
|
+
</h3>
|
37
|
+
</div>
|
38
|
+
|
39
|
+
<div id="search-section" role="search" class="project-section initially-hidden">
|
40
|
+
<form action="#" method="get" accept-charset="utf-8">
|
41
|
+
<div id="search-field-wrapper">
|
42
|
+
<input id="search-field" role="combobox" aria-label="Search"
|
43
|
+
aria-autocomplete="list" aria-controls="search-results"
|
44
|
+
type="text" name="search" placeholder="Search"
|
45
|
+
title="Type to search, Up and Down to navigate, Enter to load">
|
46
|
+
</div>
|
47
|
+
|
48
|
+
<ul id="search-results" aria-label="Search Results"
|
49
|
+
aria-busy="false" aria-expanded="false"
|
50
|
+
aria-atomic="false" aria-live="polite"
|
51
|
+
aria-relevant="all" class="initially-hidden"></ul>
|
52
|
+
</form>
|
53
|
+
</div>
|
54
|
+
|
55
|
+
</div>
|
56
|
+
|
57
|
+
|
58
|
+
|
59
|
+
<div id="class-metadata">
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
<div id="extends-section" class="nav-section">
|
64
|
+
<h3>Extended With Modules</h3>
|
65
|
+
|
66
|
+
<ul class="link-list">
|
67
|
+
|
68
|
+
|
69
|
+
<li><a class="extend" href="IO.html">Ionian::IO</a>
|
70
|
+
|
71
|
+
|
72
|
+
</ul>
|
73
|
+
</div>
|
74
|
+
|
75
|
+
<!-- Method Quickref -->
|
76
|
+
<div id="method-list-section" class="nav-section">
|
77
|
+
<h3>Methods</h3>
|
78
|
+
|
79
|
+
<ul class="link-list" role="directory">
|
80
|
+
|
81
|
+
<li ><a href="#method-c-extended">::extended</a>
|
82
|
+
|
83
|
+
<li ><a href="#method-i-initialize_ionian_socket">#initialize_ionian_socket</a>
|
84
|
+
|
85
|
+
<li ><a href="#method-i-no_delay">#no_delay</a>
|
86
|
+
|
87
|
+
<li ><a href="#method-i-no_delay-3D">#no_delay=</a>
|
88
|
+
|
89
|
+
</ul>
|
90
|
+
</div>
|
91
|
+
|
92
|
+
</div>
|
93
|
+
</nav>
|
94
|
+
|
95
|
+
<main role="main" aria-labelledby="module-Ionian::Socket">
|
96
|
+
<h1 id="module-Ionian::Socket" class="module">
|
97
|
+
module Ionian::Socket
|
98
|
+
</h1>
|
99
|
+
|
100
|
+
<section class="description">
|
101
|
+
|
102
|
+
<p>A mixin for <a href="Socket.html">Socket</a> objects.</p>
|
103
|
+
|
104
|
+
<p>This module was designed to be extended by instantiated objects that
|
105
|
+
implement the standard library <a href="Socket.html">Socket</a> class.
|
106
|
+
my_socket.extend <a href="Socket.html">Ionian::Socket</a></p>
|
107
|
+
|
108
|
+
<p>Extending this module also extends <a href="IO.html">Ionian::IO</a>.</p>
|
109
|
+
|
110
|
+
</section>
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
|
115
|
+
<section id="5Buntitled-5D" class="documentation-section">
|
116
|
+
|
117
|
+
|
118
|
+
|
119
|
+
|
120
|
+
|
121
|
+
|
122
|
+
|
123
|
+
|
124
|
+
|
125
|
+
<section id="public-class-5Buntitled-5D-method-details" class="method-section">
|
126
|
+
<header>
|
127
|
+
<h3>Public Class Methods</h3>
|
128
|
+
</header>
|
129
|
+
|
130
|
+
|
131
|
+
<div id="method-c-extended" class="method-detail ">
|
132
|
+
|
133
|
+
<div class="method-heading">
|
134
|
+
<span class="method-name">extended</span><span
|
135
|
+
class="method-args">(obj)</span>
|
136
|
+
|
137
|
+
<span class="method-click-advice">click to toggle source</span>
|
138
|
+
|
139
|
+
</div>
|
140
|
+
|
141
|
+
|
142
|
+
<div class="method-description">
|
143
|
+
|
144
|
+
<p>Called automaticallly when the object is extended with extend.</p>
|
145
|
+
|
146
|
+
|
147
|
+
|
148
|
+
|
149
|
+
<div class="method-source-code" id="extended-source">
|
150
|
+
<pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 15</span>
|
151
|
+
<span class="ruby-keyword">def</span> <span class="ruby-keyword">self</span>.<span class="ruby-identifier">extended</span>(<span class="ruby-identifier">obj</span>)
|
152
|
+
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">extend</span> <span class="ruby-constant">Ionian</span><span class="ruby-operator">::</span><span class="ruby-constant">IO</span>
|
153
|
+
<span class="ruby-identifier">obj</span>.<span class="ruby-identifier">initialize_ionian_socket</span>
|
154
|
+
<span class="ruby-keyword">end</span></pre>
|
155
|
+
</div>
|
156
|
+
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
|
161
|
+
|
162
|
+
</div>
|
163
|
+
|
164
|
+
|
165
|
+
</section>
|
166
|
+
|
167
|
+
<section id="public-instance-5Buntitled-5D-method-details" class="method-section">
|
168
|
+
<header>
|
169
|
+
<h3>Public Instance Methods</h3>
|
170
|
+
</header>
|
171
|
+
|
172
|
+
|
173
|
+
<div id="method-i-initialize_ionian_socket" class="method-detail ">
|
174
|
+
|
175
|
+
<div class="method-heading">
|
176
|
+
<span class="method-name">initialize_ionian_socket</span><span
|
177
|
+
class="method-args">()</span>
|
178
|
+
|
179
|
+
<span class="method-click-advice">click to toggle source</span>
|
180
|
+
|
181
|
+
</div>
|
182
|
+
|
183
|
+
|
184
|
+
<div class="method-description">
|
185
|
+
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
|
190
|
+
|
191
|
+
<div class="method-source-code" id="initialize_ionian_socket-source">
|
192
|
+
<pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 20</span>
|
193
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize_ionian_socket</span>
|
194
|
+
<span class="ruby-keyword">end</span></pre>
|
195
|
+
</div>
|
196
|
+
|
197
|
+
</div>
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
|
202
|
+
</div>
|
203
|
+
|
204
|
+
|
205
|
+
<div id="method-i-no_delay" class="method-detail ">
|
206
|
+
|
207
|
+
<div class="method-heading">
|
208
|
+
<span class="method-name">no_delay</span><span
|
209
|
+
class="method-args">()</span>
|
210
|
+
|
211
|
+
<span class="method-click-advice">click to toggle source</span>
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
<div class="method-description">
|
217
|
+
|
218
|
+
<p>Returns true if the TCP_NODELAY flag is enabled (Nagle disabled). Otherwise
|
219
|
+
false.</p>
|
220
|
+
|
221
|
+
|
222
|
+
|
223
|
+
|
224
|
+
<div class="method-source-code" id="no_delay-source">
|
225
|
+
<pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 25</span>
|
226
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">no_delay</span>
|
227
|
+
<span class="ruby-identifier">nagle_disabled</span> = <span class="ruby-keyword">self</span>.<span class="ruby-identifier">getsockopt</span>(<span class="ruby-operator">::</span><span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">IPPROTO_TCP</span>, <span class="ruby-operator">::</span><span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">TCP_NODELAY</span>).<span class="ruby-identifier">data</span>.<span class="ruby-identifier">ord</span>
|
228
|
+
<span class="ruby-identifier">nagle_disabled</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span> <span class="ruby-operator">?</span> <span class="ruby-keyword">true</span> <span class="ruby-operator">:</span> <span class="ruby-keyword">false</span>
|
229
|
+
<span class="ruby-keyword">end</span></pre>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
</div>
|
233
|
+
|
234
|
+
|
235
|
+
|
236
|
+
|
237
|
+
</div>
|
238
|
+
|
239
|
+
|
240
|
+
<div id="method-i-no_delay-3D" class="method-detail ">
|
241
|
+
|
242
|
+
<div class="method-heading">
|
243
|
+
<span class="method-name">no_delay=</span><span
|
244
|
+
class="method-args">(value)</span>
|
245
|
+
|
246
|
+
<span class="method-click-advice">click to toggle source</span>
|
247
|
+
|
248
|
+
</div>
|
249
|
+
|
250
|
+
|
251
|
+
<div class="method-description">
|
252
|
+
|
253
|
+
<p>Setting to true enables the TCP_NODELAY flag (disables Nagle). Setting to
|
254
|
+
false disables the flag (enables Nagle).</p>
|
255
|
+
|
256
|
+
|
257
|
+
|
258
|
+
|
259
|
+
<div class="method-source-code" id="no_delay-3D-source">
|
260
|
+
<pre><span class="ruby-comment"># File lib/ionian/socket.rb, line 32</span>
|
261
|
+
<span class="ruby-keyword">def</span> <span class="ruby-identifier">no_delay=</span>(<span class="ruby-identifier">value</span>)
|
262
|
+
<span class="ruby-identifier">disable_nagle</span> = <span class="ruby-identifier">value</span> <span class="ruby-operator">?</span> <span class="ruby-value">1</span> <span class="ruby-operator">:</span> <span class="ruby-value">0</span>
|
263
|
+
<span class="ruby-keyword">self</span>.<span class="ruby-identifier">setsockopt</span> <span class="ruby-operator">::</span><span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">IPPROTO_TCP</span>, <span class="ruby-operator">::</span><span class="ruby-constant">Socket</span><span class="ruby-operator">::</span><span class="ruby-constant">TCP_NODELAY</span>, <span class="ruby-identifier">disable_nagle</span>
|
264
|
+
<span class="ruby-keyword">end</span></pre>
|
265
|
+
</div>
|
266
|
+
|
267
|
+
</div>
|
268
|
+
|
269
|
+
|
270
|
+
|
271
|
+
|
272
|
+
</div>
|
273
|
+
|
274
|
+
|
275
|
+
</section>
|
276
|
+
|
277
|
+
</section>
|
278
|
+
</main>
|
279
|
+
|
280
|
+
|
281
|
+
<footer id="validator-badges" role="contentinfo">
|
282
|
+
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
283
|
+
<p>Generated by <a href="http://rdoc.rubyforge.org">RDoc</a> 4.1.0.preview.1.
|
284
|
+
<p>Based on <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
285
|
+
</footer>
|
286
|
+
|
data/doc/created.rid
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
-
|
2
|
-
lib/ionian.rb
|
3
|
-
lib/ionian/io.rb
|
1
|
+
Sun, 01 Dec 2013 18:46:23 -0800
|
2
|
+
lib/ionian.rb Sun, 01 Dec 2013 18:46:19 -0800
|
3
|
+
lib/ionian/io.rb Sun, 01 Dec 2013 18:46:19 -0800
|
4
|
+
lib/ionian/socket.rb Sun, 01 Dec 2013 18:46:19 -0800
|
data/doc/index.html
CHANGED
data/doc/js/search_index.js
CHANGED
@@ -1 +1 @@
|
|
1
|
-
var search_data = {"index":{"searchIndex":["ionian","io","expression()","expression=()","extended()","initialize_ionian()","on_match()","purge()","read_match()","register_observer()","run_match()","unregister_observer()"],"longSearchIndex":["ionian","ionian::io","ionian::io#expression()","ionian::io#expression=()","ionian::io::extended()","ionian::io#initialize_ionian()","ionian::io#on_match()","ionian::io#purge()","ionian::io#read_match()","ionian::io#register_observer()","ionian::io#run_match()","ionian::io#unregister_observer()"],"info":[["Ionian","","Ionian.html","","<p>A library to simplify interaction with IO streams. This includes network\nsockets, file sockets, and serial …\n"],["Ionian::IO","","Ionian/IO.html","","<p>A mixin for IO objects that allows regular expression matching and\nconvenient notification of received …\n"],["expression","Ionian::IO","Ionian/IO.html#method-i-expression","()","<p>Returns the regular expression used for #read_match.\n"],["expression=","Ionian::IO","Ionian/IO.html#method-i-expression-3D","(exp)","<p>Set the expression to match against the read buffer. Can be a regular\nexpression specifying capture groups, …\n"],["extended","Ionian::IO","Ionian/IO.html#method-c-extended","(obj)","<p>Called automaticallly when the object is extended with #extend.\n"],["initialize_ionian","Ionian::IO","Ionian/IO.html#method-i-initialize_ionian","()","<p>Initialize the Ionian instance variables. This is called automatically if\n#extend is called on an object. …\n"],["on_match","Ionian::IO","Ionian/IO.html#method-i-on_match","(&block)",""],["purge","Ionian::IO","Ionian/IO.html#method-i-purge","()","<p>Erase the data in the IO and Ionian buffers. This is typically handled\nautomatically.\n"],["read_match","Ionian::IO","Ionian/IO.html#method-i-read_match","(**kvargs, &block)","<p>Read matched data from the buffer. This method SHOULD NOT be used if\n#run_match is used.\n<p>Passes matches …\n"],["register_observer","Ionian::IO","Ionian/IO.html#method-i-register_observer","(&block)","<p>Register a block to be called when #run_match receives matched data. Method\ncallbacks can be registered …\n"],["run_match","Ionian::IO","Ionian/IO.html#method-i-run_match","(**kvargs)","<p>Start a thread that checks for data and notifies listeners (do |match,\nsocket|). Passes kvargs to #read_match …\n"],["unregister_observer","Ionian::IO","Ionian/IO.html#method-i-unregister_observer","(&block)","<p>Unregister a block from being called when matched data is received.\n"]]}}
|
1
|
+
var search_data = {"index":{"searchIndex":["ionian","io","socket","expression()","expression=()","extended()","extended()","initialize_ionian()","initialize_ionian_socket()","no_delay()","no_delay=()","on_match()","purge()","read_match()","register_observer()","run_match()","unregister_observer()"],"longSearchIndex":["ionian","ionian::io","ionian::socket","ionian::io#expression()","ionian::io#expression=()","ionian::io::extended()","ionian::socket::extended()","ionian::io#initialize_ionian()","ionian::socket#initialize_ionian_socket()","ionian::socket#no_delay()","ionian::socket#no_delay=()","ionian::io#on_match()","ionian::io#purge()","ionian::io#read_match()","ionian::io#register_observer()","ionian::io#run_match()","ionian::io#unregister_observer()"],"info":[["Ionian","","Ionian.html","","<p>A library to simplify interaction with IO streams. This includes network\nsockets, file sockets, and serial …\n"],["Ionian::IO","","Ionian/IO.html","","<p>A mixin for IO objects that allows regular expression matching and\nconvenient notification of received …\n"],["Ionian::Socket","","Ionian/Socket.html","","<p>A mixin for Socket objects.\n<p>This module was designed to be extended by instantiated objects that\nimplement …\n"],["expression","Ionian::IO","Ionian/IO.html#method-i-expression","()","<p>Returns the regular expression used for #read_match.\n"],["expression=","Ionian::IO","Ionian/IO.html#method-i-expression-3D","(exp)","<p>Set the expression to match against the read buffer. Can be a regular\nexpression specifying capture groups, …\n"],["extended","Ionian::IO","Ionian/IO.html#method-c-extended","(obj)","<p>Called automaticallly when the object is extended with #extend.\n"],["extended","Ionian::Socket","Ionian/Socket.html#method-c-extended","(obj)","<p>Called automaticallly when the object is extended with #extend.\n"],["initialize_ionian","Ionian::IO","Ionian/IO.html#method-i-initialize_ionian","()","<p>Initialize the Ionian instance variables. This is called automatically if\n#extend is called on an object. …\n"],["initialize_ionian_socket","Ionian::Socket","Ionian/Socket.html#method-i-initialize_ionian_socket","()",""],["no_delay","Ionian::Socket","Ionian/Socket.html#method-i-no_delay","()","<p>Returns true if the TCP_NODELAY flag is enabled (Nagle disabled). Otherwise\nfalse.\n"],["no_delay=","Ionian::Socket","Ionian/Socket.html#method-i-no_delay-3D","(value)","<p>Setting to true enables the TCP_NODELAY flag (disables Nagle). Setting to\nfalse disables the flag (enables …\n"],["on_match","Ionian::IO","Ionian/IO.html#method-i-on_match","(&block)",""],["purge","Ionian::IO","Ionian/IO.html#method-i-purge","()","<p>Erase the data in the IO and Ionian buffers. This is typically handled\nautomatically.\n"],["read_match","Ionian::IO","Ionian/IO.html#method-i-read_match","(**kvargs, &block)","<p>Read matched data from the buffer. This method SHOULD NOT be used if\n#run_match is used.\n<p>Passes matches …\n"],["register_observer","Ionian::IO","Ionian/IO.html#method-i-register_observer","(&block)","<p>Register a block to be called when #run_match receives matched data. Method\ncallbacks can be registered …\n"],["run_match","Ionian::IO","Ionian/IO.html#method-i-run_match","(**kvargs)","<p>Start a thread that checks for data and notifies listeners (do |match,\nsocket|). Passes kvargs to #read_match …\n"],["unregister_observer","Ionian::IO","Ionian/IO.html#method-i-unregister_observer","(&block)","<p>Unregister a block from being called when matched data is received.\n"]]}}
|
data/doc/table_of_contents.html
CHANGED
@@ -34,6 +34,9 @@
|
|
34
34
|
<li class="module">
|
35
35
|
<a href="Ionian/IO.html">Ionian::IO</a>
|
36
36
|
</li>
|
37
|
+
<li class="module">
|
38
|
+
<a href="Ionian/Socket.html">Ionian::Socket</a>
|
39
|
+
</li>
|
37
40
|
</ul>
|
38
41
|
|
39
42
|
<h2 id="methods">Methods</h2>
|
@@ -44,6 +47,11 @@
|
|
44
47
|
—
|
45
48
|
<span class="container">Ionian::IO</span>
|
46
49
|
|
50
|
+
<li class="method">
|
51
|
+
<a href="Ionian/Socket.html#method-c-extended">::extended</a>
|
52
|
+
—
|
53
|
+
<span class="container">Ionian::Socket</span>
|
54
|
+
|
47
55
|
<li class="method">
|
48
56
|
<a href="Ionian/IO.html#method-i-expression">#expression</a>
|
49
57
|
—
|
@@ -59,6 +67,21 @@
|
|
59
67
|
—
|
60
68
|
<span class="container">Ionian::IO</span>
|
61
69
|
|
70
|
+
<li class="method">
|
71
|
+
<a href="Ionian/Socket.html#method-i-initialize_ionian_socket">#initialize_ionian_socket</a>
|
72
|
+
—
|
73
|
+
<span class="container">Ionian::Socket</span>
|
74
|
+
|
75
|
+
<li class="method">
|
76
|
+
<a href="Ionian/Socket.html#method-i-no_delay">#no_delay</a>
|
77
|
+
—
|
78
|
+
<span class="container">Ionian::Socket</span>
|
79
|
+
|
80
|
+
<li class="method">
|
81
|
+
<a href="Ionian/Socket.html#method-i-no_delay-3D">#no_delay=</a>
|
82
|
+
—
|
83
|
+
<span class="container">Ionian::Socket</span>
|
84
|
+
|
62
85
|
<li class="method">
|
63
86
|
<a href="Ionian/IO.html#method-i-on_match">#on_match</a>
|
64
87
|
—
|
data/lib/ionian/io.rb
CHANGED
@@ -2,7 +2,7 @@ module Ionian
|
|
2
2
|
# A mixin for IO objects that allows regular expression matching
|
3
3
|
# and convenient notification of received data.
|
4
4
|
#
|
5
|
-
# This module was designed to be
|
5
|
+
# This module was designed to be extended by instantiated objects
|
6
6
|
# that implement the standard library IO class.
|
7
7
|
# my_socket.extend Ionian::IO
|
8
8
|
module IO
|
@@ -88,7 +88,7 @@ module Ionian
|
|
88
88
|
@ionian_buf = $' # Leave post match data in the buffer.
|
89
89
|
end
|
90
90
|
|
91
|
-
# Convert
|
91
|
+
# Convert named captures to methods.
|
92
92
|
if build_methods
|
93
93
|
@matches.each do |match|
|
94
94
|
match.names
|
@@ -0,0 +1,38 @@
|
|
1
|
+
require 'ionian/io'
|
2
|
+
require 'socket'
|
3
|
+
|
4
|
+
module Ionian
|
5
|
+
# A mixin for Socket objects.
|
6
|
+
#
|
7
|
+
# This module was designed to be extended by instantiated objects
|
8
|
+
# that implement the standard library Socket class.
|
9
|
+
# my_socket.extend Ionian::Socket
|
10
|
+
#
|
11
|
+
# Extending this module also extends Ionian::IO.
|
12
|
+
module Socket
|
13
|
+
|
14
|
+
# Called automaticallly when the object is extended with #extend.
|
15
|
+
def self.extended(obj)
|
16
|
+
obj.extend Ionian::IO
|
17
|
+
obj.initialize_ionian_socket
|
18
|
+
end
|
19
|
+
|
20
|
+
def initialize_ionian_socket
|
21
|
+
end
|
22
|
+
|
23
|
+
# Returns true if the TCP_NODELAY flag is enabled (Nagle disabled).
|
24
|
+
# Otherwise false.
|
25
|
+
def no_delay
|
26
|
+
nagle_disabled = self.getsockopt(::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY).data.ord
|
27
|
+
nagle_disabled > 0 ? true : false
|
28
|
+
end
|
29
|
+
|
30
|
+
# Setting to true enables the TCP_NODELAY flag (disables Nagle).
|
31
|
+
# Setting to false disables the flag (enables Nagle).
|
32
|
+
def no_delay=(value)
|
33
|
+
disable_nagle = value ? 1 : 0
|
34
|
+
self.setsockopt ::Socket::IPPROTO_TCP, ::Socket::TCP_NODELAY, disable_nagle
|
35
|
+
end
|
36
|
+
|
37
|
+
end
|
38
|
+
end
|
data/lib/ionian.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ionian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alex McLain
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -75,52 +75,57 @@ extensions: []
|
|
75
75
|
extra_rdoc_files: []
|
76
76
|
files:
|
77
77
|
- license.txt
|
78
|
-
- lib/ionian.rb
|
78
|
+
- lib/ionian/socket.rb
|
79
79
|
- lib/ionian/io.rb
|
80
|
-
-
|
80
|
+
- lib/ionian.rb
|
81
|
+
- doc/fonts/SourceCodePro-Regular.ttf
|
82
|
+
- doc/fonts/SourceCodePro-Bold.ttf
|
83
|
+
- doc/fonts/Lato-Light.ttf
|
84
|
+
- doc/fonts/Lato-Regular.ttf
|
85
|
+
- doc/fonts/Lato-LightItalic.ttf
|
86
|
+
- doc/fonts/Lato-RegularItalic.ttf
|
87
|
+
- doc/created.rid
|
88
|
+
- doc/rdoc.css
|
89
|
+
- doc/images/wrench_orange.png
|
90
|
+
- doc/images/bug.png
|
91
|
+
- doc/images/arrow_up.png
|
92
|
+
- doc/images/bullet_black.png
|
81
93
|
- doc/images/page_green.png
|
82
|
-
- doc/images/
|
94
|
+
- doc/images/page_white_width.png
|
95
|
+
- doc/images/bullet_toggle_minus.png
|
83
96
|
- doc/images/wrench.png
|
84
|
-
- doc/images/find.png
|
85
97
|
- doc/images/bullet_toggle_plus.png
|
86
|
-
- doc/images/
|
87
|
-
- doc/images/bug.png
|
88
|
-
- doc/images/bullet_toggle_minus.png
|
89
|
-
- doc/images/wrench_orange.png
|
90
|
-
- doc/images/tag_blue.png
|
91
|
-
- doc/images/page_white_width.png
|
98
|
+
- doc/images/brick.png
|
92
99
|
- doc/images/page_white_text.png
|
93
|
-
- doc/images/package.png
|
94
|
-
- doc/images/bullet_black.png
|
95
|
-
- doc/images/plugin.png
|
96
|
-
- doc/images/delete.png
|
97
|
-
- doc/images/brick_link.png
|
98
|
-
- doc/images/ruby.png
|
99
|
-
- doc/images/loadingAnimation.gif
|
100
100
|
- doc/images/date.png
|
101
101
|
- doc/images/add.png
|
102
|
+
- doc/images/ruby.png
|
102
103
|
- doc/images/zoom.png
|
103
|
-
- doc/images/tag_green.png
|
104
|
-
- doc/images/macFFBgHack.png
|
105
104
|
- doc/images/transparent.png
|
105
|
+
- doc/images/loadingAnimation.gif
|
106
|
+
- doc/images/brick_link.png
|
107
|
+
- doc/images/find.png
|
108
|
+
- doc/images/plugin.png
|
109
|
+
- doc/images/delete.png
|
110
|
+
- doc/images/tag_blue.png
|
111
|
+
- doc/images/package.png
|
112
|
+
- doc/images/macFFBgHack.png
|
113
|
+
- doc/images/tag_green.png
|
114
|
+
- doc/table_of_contents.html
|
115
|
+
- doc/index.html
|
116
|
+
- doc/Ionian.html
|
117
|
+
- doc/fonts.css
|
118
|
+
- doc/Ionian/Extension.html
|
119
|
+
- doc/Ionian/IO.html
|
120
|
+
- doc/Ionian/Socket.html
|
121
|
+
- doc/Ionian/Extension/IO.html
|
122
|
+
- doc/Ionian/Extension/Socket.html
|
123
|
+
- doc/js/navigation.js
|
106
124
|
- doc/js/searcher.js
|
125
|
+
- doc/js/search_index.js
|
107
126
|
- doc/js/jquery.js
|
108
127
|
- doc/js/search.js
|
109
128
|
- doc/js/darkfish.js
|
110
|
-
- doc/js/search_index.js
|
111
|
-
- doc/js/navigation.js
|
112
|
-
- doc/Ionian.html
|
113
|
-
- doc/Ionian/IO.html
|
114
|
-
- doc/table_of_contents.html
|
115
|
-
- doc/created.rid
|
116
|
-
- doc/index.html
|
117
|
-
- doc/rdoc.css
|
118
|
-
- doc/fonts/Lato-RegularItalic.ttf
|
119
|
-
- doc/fonts/Lato-Light.ttf
|
120
|
-
- doc/fonts/Lato-LightItalic.ttf
|
121
|
-
- doc/fonts/SourceCodePro-Bold.ttf
|
122
|
-
- doc/fonts/Lato-Regular.ttf
|
123
|
-
- doc/fonts/SourceCodePro-Regular.ttf
|
124
129
|
homepage: https://bitbucket.org/amclain/ionian
|
125
130
|
licenses:
|
126
131
|
- MIT
|
@@ -146,3 +151,4 @@ signing_key:
|
|
146
151
|
specification_version: 4
|
147
152
|
summary: Regular expression matching and notification for IO streams.
|
148
153
|
test_files: []
|
154
|
+
has_rdoc:
|