journeta 0.1.7 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +8 -0
- data/Gemfile.lock +20 -0
- data/{History.txt → HISTORY} +13 -1
- data/LICENSE +51 -0
- data/License.txt +2 -2
- data/{README.txt → README.rdoc} +12 -17
- data/Rakefile +46 -112
- data/VERSION +1 -0
- data/{examples/instant_messenger.rb → bin/journeta_instant_messenger.rb} +13 -0
- data/bin/journeta_mock_peers.rb +32 -0
- data/{examples/network_status.rb → bin/journeta_network_status.rb} +0 -0
- data/bin/journeta_peer_fuzzer.rb +54 -0
- data/{examples/queue_client.rb → bin/journeta_queue_client.rb} +0 -0
- data/{examples/queue_server.rb → bin/journeta_queue_server.rb} +0 -0
- data/bin/journeta_thread_leak_check.rb +16 -0
- data/bin/journeta_top.rb +73 -0
- data/{examples/instant_messenger_gui.rb → broken/journeta_instant_messenger_gui.rb} +0 -2
- data/broken/journeta_instant_messenger_shoes.rb +52 -0
- data/lib/diff.rb +280 -0
- data/lib/journeta.rb +1 -0
- data/lib/journeta/asynchronous.rb +2 -2
- data/lib/journeta/exception.rb +8 -0
- data/lib/journeta/journeta_engine.rb +4 -5
- data/lib/journeta/logger.rb +1 -1
- data/lib/journeta/peer_connection.rb +2 -2
- data/lib/journeta/peer_listener.rb +2 -2
- data/lib/journeta/presence_broadcaster.rb +19 -5
- data/lib/journeta/presence_listener.rb +8 -4
- data/lib/journeta/version.rb +6 -4
- data/rdoc/Array.html +199 -0
- data/rdoc/Diff.html +714 -0
- data/rdoc/Diffable.html +409 -0
- data/rdoc/Journeta.html +288 -0
- data/rdoc/Journeta/Asynchronous.html +429 -0
- data/rdoc/Journeta/Common.html +205 -0
- data/rdoc/Journeta/Common/BasicMessage.html +228 -0
- data/rdoc/Journeta/Common/DummyPeerHandler.html +237 -0
- data/rdoc/Journeta/Common/Job.html +279 -0
- data/rdoc/Journeta/Common/Shutdown.html +236 -0
- data/rdoc/Journeta/DefaultPeerHandler.html +248 -0
- data/rdoc/Journeta/DefaultPeerRegisteredHandler.html +249 -0
- data/rdoc/Journeta/DefaultPeerUnregisteredHandler.html +249 -0
- data/rdoc/Journeta/DefaultPeerUpdatedHandler.html +249 -0
- data/rdoc/Journeta/Engine.html +953 -0
- data/rdoc/Journeta/Logger.html +237 -0
- data/rdoc/Journeta/NotImplementedException.html +188 -0
- data/rdoc/Journeta/PeerConnection.html +549 -0
- data/rdoc/Journeta/PeerListener.html +276 -0
- data/rdoc/Journeta/PeerRegistry.html +804 -0
- data/rdoc/Journeta/PresenceBroadcaster.html +306 -0
- data/rdoc/Journeta/PresenceListener.html +300 -0
- data/rdoc/Journeta/PresenceMessage.html +321 -0
- data/rdoc/Journeta/VERSION.html +181 -0
- data/rdoc/README_rdoc.html +196 -0
- data/rdoc/String.html +199 -0
- data/rdoc/created.rid +20 -0
- data/rdoc/index.html +212 -0
- data/rdoc/lib/diff_rb.html +52 -0
- data/rdoc/lib/journeta/asynchronous_rb.html +60 -0
- data/rdoc/lib/journeta/common/basic_message_rb.html +52 -0
- data/rdoc/lib/journeta/common/dummy_peer_handler_rb.html +52 -0
- data/rdoc/lib/journeta/common/job_rb.html +52 -0
- data/rdoc/lib/journeta/common/shutdown_rb.html +52 -0
- data/rdoc/lib/journeta/exception_rb.html +55 -0
- data/rdoc/lib/journeta/journeta_engine_rb.html +62 -0
- data/rdoc/lib/journeta/logger_rb.html +55 -0
- data/rdoc/lib/journeta/peer_connection_rb.html +58 -0
- data/rdoc/lib/journeta/peer_handler_rb.html +52 -0
- data/rdoc/lib/journeta/peer_listener_rb.html +60 -0
- data/rdoc/lib/journeta/peer_registry_rb.html +54 -0
- data/rdoc/lib/journeta/presence_broadcaster_rb.html +57 -0
- data/rdoc/lib/journeta/presence_listener_rb.html +62 -0
- data/rdoc/lib/journeta/presence_message_rb.html +52 -0
- data/rdoc/lib/journeta/version_rb.html +52 -0
- data/rdoc/lib/journeta_rb.html +91 -0
- data/rdoc/rdoc.css +706 -0
- data/test/helper.rb +19 -0
- data/test/test_lifecycle.rb +49 -9
- data/website/images/arrow.png +0 -0
- data/website/images/banner.jpg +0 -0
- data/website/images/content_shadow.png +0 -0
- data/website/images/content_side.png +0 -0
- data/website/images/header.jpg +0 -0
- data/website/images/header_side.jpg +0 -0
- data/website/index.html +1 -1
- data/website/index.txt +1 -1
- data/website/stylesheets/reset.css +30 -0
- data/website/stylesheets/screen.css +1 -1
- metadata +152 -46
- data/test/test_event_broadcaster.rb +0 -15
- data/test/test_helper.rb +0 -4
- data/test/test_journeta.rb +0 -11
data/rdoc/Diffable.html
ADDED
@@ -0,0 +1,409 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: Diffable</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="module">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./lib/diff_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/diff.rb">lib/diff.rb</a></li>
|
43
|
+
|
44
|
+
</ul>
|
45
|
+
</div>
|
46
|
+
</div>
|
47
|
+
|
48
|
+
|
49
|
+
</div>
|
50
|
+
|
51
|
+
<div id="class-metadata">
|
52
|
+
|
53
|
+
<!-- Parent Class -->
|
54
|
+
|
55
|
+
|
56
|
+
<!-- Namespace Contents -->
|
57
|
+
|
58
|
+
|
59
|
+
<!-- Method Quickref -->
|
60
|
+
|
61
|
+
<div id="method-list-section" class="section">
|
62
|
+
<h3 class="section-header">Methods</h3>
|
63
|
+
<ul class="link-list">
|
64
|
+
|
65
|
+
<li><a href="#method-i-diff">#diff</a></li>
|
66
|
+
|
67
|
+
<li><a href="#method-i-patch">#patch</a></li>
|
68
|
+
|
69
|
+
<li><a href="#method-i-replacenextlarger">#replacenextlarger</a></li>
|
70
|
+
|
71
|
+
<li><a href="#method-i-reverse_hash">#reverse_hash</a></li>
|
72
|
+
|
73
|
+
</ul>
|
74
|
+
</div>
|
75
|
+
|
76
|
+
|
77
|
+
<!-- Included Modules -->
|
78
|
+
|
79
|
+
</div>
|
80
|
+
|
81
|
+
<div id="project-metadata">
|
82
|
+
|
83
|
+
|
84
|
+
<div id="fileindex-section" class="section project-section">
|
85
|
+
<h3 class="section-header">Files</h3>
|
86
|
+
<ul>
|
87
|
+
|
88
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
89
|
+
|
90
|
+
</ul>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
<div id="classindex-section" class="section project-section">
|
95
|
+
<h3 class="section-header">Class Index
|
96
|
+
<span class="search-toggle"><img src="./images/find.png"
|
97
|
+
height="16" width="16" alt="[+]"
|
98
|
+
title="show/hide quicksearch" /></span></h3>
|
99
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
100
|
+
<fieldset>
|
101
|
+
<legend>Quicksearch</legend>
|
102
|
+
<input type="text" name="quicksearch" value=""
|
103
|
+
class="quicksearch-field" />
|
104
|
+
</fieldset>
|
105
|
+
</form>
|
106
|
+
|
107
|
+
<ul class="link-list">
|
108
|
+
|
109
|
+
<li><a href="./Journeta/Asynchronous.html">Journeta::Asynchronous</a></li>
|
110
|
+
|
111
|
+
<li><a href="./Journeta/Common.html">Journeta::Common</a></li>
|
112
|
+
|
113
|
+
<li><a href="./Journeta/Common/BasicMessage.html">Journeta::Common::BasicMessage</a></li>
|
114
|
+
|
115
|
+
<li><a href="./Journeta/Common/DummyPeerHandler.html">Journeta::Common::DummyPeerHandler</a></li>
|
116
|
+
|
117
|
+
<li><a href="./Journeta/Common/Job.html">Journeta::Common::Job</a></li>
|
118
|
+
|
119
|
+
<li><a href="./Journeta/Common/Shutdown.html">Journeta::Common::Shutdown</a></li>
|
120
|
+
|
121
|
+
<li><a href="./Journeta/DefaultPeerHandler.html">Journeta::DefaultPeerHandler</a></li>
|
122
|
+
|
123
|
+
<li><a href="./Journeta/DefaultPeerRegisteredHandler.html">Journeta::DefaultPeerRegisteredHandler</a></li>
|
124
|
+
|
125
|
+
<li><a href="./Journeta/DefaultPeerUnregisteredHandler.html">Journeta::DefaultPeerUnregisteredHandler</a></li>
|
126
|
+
|
127
|
+
<li><a href="./Journeta/DefaultPeerUpdatedHandler.html">Journeta::DefaultPeerUpdatedHandler</a></li>
|
128
|
+
|
129
|
+
<li><a href="./Journeta/Engine.html">Journeta::Engine</a></li>
|
130
|
+
|
131
|
+
<li><a href="./Journeta/Logger.html">Journeta::Logger</a></li>
|
132
|
+
|
133
|
+
<li><a href="./Journeta/NotImplementedException.html">Journeta::NotImplementedException</a></li>
|
134
|
+
|
135
|
+
<li><a href="./Journeta/PeerConnection.html">Journeta::PeerConnection</a></li>
|
136
|
+
|
137
|
+
<li><a href="./Journeta/PeerListener.html">Journeta::PeerListener</a></li>
|
138
|
+
|
139
|
+
<li><a href="./Journeta/PeerRegistry.html">Journeta::PeerRegistry</a></li>
|
140
|
+
|
141
|
+
<li><a href="./Journeta/PresenceBroadcaster.html">Journeta::PresenceBroadcaster</a></li>
|
142
|
+
|
143
|
+
<li><a href="./Journeta/PresenceListener.html">Journeta::PresenceListener</a></li>
|
144
|
+
|
145
|
+
<li><a href="./Journeta/PresenceMessage.html">Journeta::PresenceMessage</a></li>
|
146
|
+
|
147
|
+
<li><a href="./Array.html">Array</a></li>
|
148
|
+
|
149
|
+
<li><a href="./Diff.html">Diff</a></li>
|
150
|
+
|
151
|
+
<li><a href="./Diffable.html">Diffable</a></li>
|
152
|
+
|
153
|
+
<li><a href="./String.html">String</a></li>
|
154
|
+
|
155
|
+
</ul>
|
156
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
157
|
+
</div>
|
158
|
+
|
159
|
+
|
160
|
+
</div>
|
161
|
+
</div>
|
162
|
+
|
163
|
+
<div id="documentation">
|
164
|
+
<h1 class="module">Diffable</h1>
|
165
|
+
|
166
|
+
<div id="description">
|
167
|
+
|
168
|
+
</div>
|
169
|
+
|
170
|
+
<!-- Constants -->
|
171
|
+
|
172
|
+
|
173
|
+
<!-- Attributes -->
|
174
|
+
|
175
|
+
|
176
|
+
<!-- Methods -->
|
177
|
+
|
178
|
+
<div id="public-instance-method-details" class="method-section section">
|
179
|
+
<h3 class="section-header">Public Instance Methods</h3>
|
180
|
+
|
181
|
+
|
182
|
+
<div id="diff-method" class="method-detail ">
|
183
|
+
<a name="method-i-diff"></a>
|
184
|
+
|
185
|
+
<div class="method-heading">
|
186
|
+
|
187
|
+
<span class="method-name">diff</span><span
|
188
|
+
class="method-args">(b)</span>
|
189
|
+
<span class="method-click-advice">click to toggle source</span>
|
190
|
+
|
191
|
+
</div>
|
192
|
+
|
193
|
+
<div class="method-description">
|
194
|
+
|
195
|
+
|
196
|
+
|
197
|
+
|
198
|
+
|
199
|
+
<div class="method-source-code"
|
200
|
+
id="diff-source">
|
201
|
+
<pre>
|
202
|
+
<span class="ruby-comment cmt"># File lib/diff.rb, line 149</span>
|
203
|
+
149: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">diff</span>(<span class="ruby-identifier">b</span>)
|
204
|
+
150: <span class="ruby-constant">Diff</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">b</span>)
|
205
|
+
151: <span class="ruby-keyword kw">end</span></pre>
|
206
|
+
</div>
|
207
|
+
|
208
|
+
</div>
|
209
|
+
|
210
|
+
|
211
|
+
|
212
|
+
|
213
|
+
</div>
|
214
|
+
|
215
|
+
|
216
|
+
<div id="patch-method" class="method-detail ">
|
217
|
+
<a name="method-i-patch"></a>
|
218
|
+
|
219
|
+
<div class="method-heading">
|
220
|
+
|
221
|
+
<span class="method-name">patch</span><span
|
222
|
+
class="method-args">(diff)</span>
|
223
|
+
<span class="method-click-advice">click to toggle source</span>
|
224
|
+
|
225
|
+
</div>
|
226
|
+
|
227
|
+
<div class="method-description">
|
228
|
+
|
229
|
+
|
230
|
+
|
231
|
+
|
232
|
+
|
233
|
+
<div class="method-source-code"
|
234
|
+
id="patch-source">
|
235
|
+
<pre>
|
236
|
+
<span class="ruby-comment cmt"># File lib/diff.rb, line 196</span>
|
237
|
+
196: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">patch</span>(<span class="ruby-identifier">diff</span>)
|
238
|
+
197: <span class="ruby-identifier">newary</span> = <span class="ruby-keyword kw">nil</span>
|
239
|
+
198: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">difftype</span> <span class="ruby-operator">==</span> <span class="ruby-constant">String</span>
|
240
|
+
199: <span class="ruby-identifier">newary</span> = <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">difftype</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value str">''</span>)
|
241
|
+
200: <span class="ruby-keyword kw">else</span>
|
242
|
+
201: <span class="ruby-identifier">newary</span> = <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">difftype</span>.<span class="ruby-identifier">new</span>
|
243
|
+
202: <span class="ruby-keyword kw">end</span>
|
244
|
+
203: <span class="ruby-identifier">ai</span> = <span class="ruby-value">0</span>
|
245
|
+
204: <span class="ruby-identifier">bi</span> = <span class="ruby-value">0</span>
|
246
|
+
205: <span class="ruby-identifier">diff</span>.<span class="ruby-identifier">diffs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">d</span><span class="ruby-operator">|</span>
|
247
|
+
206: <span class="ruby-identifier">d</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">mod</span><span class="ruby-operator">|</span>
|
248
|
+
207: <span class="ruby-keyword kw">case</span> <span class="ruby-identifier">mod</span>[<span class="ruby-value">0</span>]
|
249
|
+
208: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'-'</span>
|
250
|
+
209: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">mod</span>[<span class="ruby-value">1</span>]
|
251
|
+
210: <span class="ruby-identifier">newary</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">ai</span>]
|
252
|
+
211: <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
253
|
+
212: <span class="ruby-identifier">bi</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
254
|
+
213: <span class="ruby-keyword kw">end</span>
|
255
|
+
214: <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
256
|
+
215: <span class="ruby-keyword kw">when</span> <span class="ruby-value str">'+'</span>
|
257
|
+
216: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">bi</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">mod</span>[<span class="ruby-value">1</span>]
|
258
|
+
217: <span class="ruby-identifier">newary</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">ai</span>]
|
259
|
+
218: <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
260
|
+
219: <span class="ruby-identifier">bi</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
261
|
+
220: <span class="ruby-keyword kw">end</span>
|
262
|
+
221: <span class="ruby-identifier">newary</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">mod</span>[<span class="ruby-value">2</span>]
|
263
|
+
222: <span class="ruby-identifier">bi</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
264
|
+
223: <span class="ruby-keyword kw">else</span>
|
265
|
+
224: <span class="ruby-identifier">raise</span> <span class="ruby-value str">"Unknown diff action"</span>
|
266
|
+
225: <span class="ruby-keyword kw">end</span>
|
267
|
+
226: }
|
268
|
+
227: }
|
269
|
+
228: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">ai</span> <span class="ruby-operator"><</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>
|
270
|
+
229: <span class="ruby-identifier">newary</span> <span class="ruby-operator"><<</span> <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">ai</span>]
|
271
|
+
230: <span class="ruby-identifier">ai</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
272
|
+
231: <span class="ruby-identifier">bi</span> <span class="ruby-operator">+=</span> <span class="ruby-value">1</span>
|
273
|
+
232: <span class="ruby-keyword kw">end</span>
|
274
|
+
233: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">newary</span>
|
275
|
+
234: <span class="ruby-keyword kw">end</span></pre>
|
276
|
+
</div>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
|
281
|
+
|
282
|
+
|
283
|
+
</div>
|
284
|
+
|
285
|
+
|
286
|
+
<div id="replacenextlarger-method" class="method-detail ">
|
287
|
+
<a name="method-i-replacenextlarger"></a>
|
288
|
+
|
289
|
+
<div class="method-heading">
|
290
|
+
|
291
|
+
<span class="method-name">replacenextlarger</span><span
|
292
|
+
class="method-args">(value, high = nil)</span>
|
293
|
+
<span class="method-click-advice">click to toggle source</span>
|
294
|
+
|
295
|
+
</div>
|
296
|
+
|
297
|
+
<div class="method-description">
|
298
|
+
|
299
|
+
|
300
|
+
|
301
|
+
|
302
|
+
|
303
|
+
<div class="method-source-code"
|
304
|
+
id="replacenextlarger-source">
|
305
|
+
<pre>
|
306
|
+
<span class="ruby-comment cmt"># File lib/diff.rb, line 169</span>
|
307
|
+
169: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replacenextlarger</span>(<span class="ruby-identifier">value</span>, <span class="ruby-identifier">high</span> = <span class="ruby-keyword kw">nil</span>)
|
308
|
+
170: <span class="ruby-identifier">high</span> <span class="ruby-operator">||=</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>
|
309
|
+
171: <span class="ruby-keyword kw">if</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">empty?</span> <span class="ruby-operator">||</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">></span> <span class="ruby-keyword kw">self</span>[<span class="ruby-value">1</span>]
|
310
|
+
172: <span class="ruby-identifier">push</span> <span class="ruby-identifier">value</span>
|
311
|
+
173: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">high</span>
|
312
|
+
174: <span class="ruby-keyword kw">end</span>
|
313
|
+
175: <span class="ruby-comment cmt"># binary search for replacement point</span>
|
314
|
+
176: <span class="ruby-identifier">low</span> = <span class="ruby-value">0</span>
|
315
|
+
177: <span class="ruby-keyword kw">while</span> <span class="ruby-identifier">low</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">high</span>
|
316
|
+
178: <span class="ruby-identifier">index</span> = (<span class="ruby-identifier">high</span><span class="ruby-operator">+</span><span class="ruby-identifier">low</span>)<span class="ruby-operator">/</span><span class="ruby-value">2</span>
|
317
|
+
179: <span class="ruby-identifier">found</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">index</span>]
|
318
|
+
180: <span class="ruby-keyword kw">return</span> <span class="ruby-keyword kw">nil</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">found</span>
|
319
|
+
181: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span> <span class="ruby-operator">></span> <span class="ruby-identifier">found</span>
|
320
|
+
182: <span class="ruby-identifier">low</span> = <span class="ruby-identifier">index</span> <span class="ruby-operator">+</span> <span class="ruby-value">1</span>
|
321
|
+
183: <span class="ruby-keyword kw">else</span>
|
322
|
+
184: <span class="ruby-identifier">high</span> = <span class="ruby-identifier">index</span>
|
323
|
+
185: <span class="ruby-keyword kw">end</span>
|
324
|
+
186: <span class="ruby-keyword kw">end</span>
|
325
|
+
187:
|
326
|
+
188: <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">low</span>] = <span class="ruby-identifier">value</span>
|
327
|
+
189: <span class="ruby-comment cmt"># $stderr << "replace #{value} : 0/#{low}/#{init_high} (#{steps} steps) (#{init_high-low} off )\n"</span>
|
328
|
+
190: <span class="ruby-comment cmt"># $stderr.puts self.inspect</span>
|
329
|
+
191: <span class="ruby-comment cmt">#gets</span>
|
330
|
+
192: <span class="ruby-comment cmt">#p length - low</span>
|
331
|
+
193: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">low</span>
|
332
|
+
194: <span class="ruby-keyword kw">end</span></pre>
|
333
|
+
</div>
|
334
|
+
|
335
|
+
</div>
|
336
|
+
|
337
|
+
|
338
|
+
|
339
|
+
|
340
|
+
</div>
|
341
|
+
|
342
|
+
|
343
|
+
<div id="reverse-hash-method" class="method-detail ">
|
344
|
+
<a name="method-i-reverse_hash"></a>
|
345
|
+
|
346
|
+
<div class="method-heading">
|
347
|
+
|
348
|
+
<span class="method-name">reverse_hash</span><span
|
349
|
+
class="method-args">(range = (0...self.length))</span>
|
350
|
+
<span class="method-click-advice">click to toggle source</span>
|
351
|
+
|
352
|
+
</div>
|
353
|
+
|
354
|
+
<div class="method-description">
|
355
|
+
|
356
|
+
<p>
|
357
|
+
Create a hash that maps elements of the array to arrays of indices where
|
358
|
+
the elements are found.
|
359
|
+
</p>
|
360
|
+
|
361
|
+
|
362
|
+
|
363
|
+
<div class="method-source-code"
|
364
|
+
id="reverse-hash-source">
|
365
|
+
<pre>
|
366
|
+
<span class="ruby-comment cmt"># File lib/diff.rb, line 156</span>
|
367
|
+
156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reverse_hash</span>(<span class="ruby-identifier">range</span> = (<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">length</span>))
|
368
|
+
157: <span class="ruby-identifier">revmap</span> = {}
|
369
|
+
158: <span class="ruby-identifier">range</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span>
|
370
|
+
159: <span class="ruby-identifier">elem</span> = <span class="ruby-keyword kw">self</span>[<span class="ruby-identifier">i</span>]
|
371
|
+
160: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">revmap</span>.<span class="ruby-identifier">has_key?</span> <span class="ruby-identifier">elem</span>
|
372
|
+
161: <span class="ruby-identifier">revmap</span>[<span class="ruby-identifier">elem</span>].<span class="ruby-identifier">push</span> <span class="ruby-identifier">i</span>
|
373
|
+
162: <span class="ruby-keyword kw">else</span>
|
374
|
+
163: <span class="ruby-identifier">revmap</span>[<span class="ruby-identifier">elem</span>] = [<span class="ruby-identifier">i</span>]
|
375
|
+
164: <span class="ruby-keyword kw">end</span>
|
376
|
+
165: }
|
377
|
+
166: <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">revmap</span>
|
378
|
+
167: <span class="ruby-keyword kw">end</span></pre>
|
379
|
+
</div>
|
380
|
+
|
381
|
+
</div>
|
382
|
+
|
383
|
+
|
384
|
+
|
385
|
+
|
386
|
+
</div>
|
387
|
+
|
388
|
+
|
389
|
+
</div>
|
390
|
+
|
391
|
+
|
392
|
+
</div>
|
393
|
+
|
394
|
+
|
395
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
396
|
+
|
397
|
+
<p>Disabled; run with --debug to generate this.</p>
|
398
|
+
|
399
|
+
</div>
|
400
|
+
|
401
|
+
<div id="validator-badges">
|
402
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
403
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
404
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
405
|
+
</div>
|
406
|
+
|
407
|
+
</body>
|
408
|
+
</html>
|
409
|
+
|
data/rdoc/Journeta.html
ADDED
@@ -0,0 +1,288 @@
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
2
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
|
3
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
4
|
+
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
5
|
+
<head>
|
6
|
+
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
|
7
|
+
|
8
|
+
<title>Module: Journeta</title>
|
9
|
+
|
10
|
+
<link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
|
11
|
+
|
12
|
+
<script src="./js/jquery.js" type="text/javascript"
|
13
|
+
charset="utf-8"></script>
|
14
|
+
<script src="./js/thickbox-compressed.js" type="text/javascript"
|
15
|
+
charset="utf-8"></script>
|
16
|
+
<script src="./js/quicksearch.js" type="text/javascript"
|
17
|
+
charset="utf-8"></script>
|
18
|
+
<script src="./js/darkfish.js" type="text/javascript"
|
19
|
+
charset="utf-8"></script>
|
20
|
+
|
21
|
+
</head>
|
22
|
+
<body class="module">
|
23
|
+
|
24
|
+
<div id="metadata">
|
25
|
+
<div id="home-metadata">
|
26
|
+
<div id="home-section" class="section">
|
27
|
+
<h3 class="section-header">
|
28
|
+
<a href="./index.html">Home</a>
|
29
|
+
<a href="./index.html#classes">Classes</a>
|
30
|
+
<a href="./index.html#methods">Methods</a>
|
31
|
+
</h3>
|
32
|
+
</div>
|
33
|
+
</div>
|
34
|
+
|
35
|
+
<div id="file-metadata">
|
36
|
+
<div id="file-list-section" class="section">
|
37
|
+
<h3 class="section-header">In Files</h3>
|
38
|
+
<div class="section-body">
|
39
|
+
<ul>
|
40
|
+
|
41
|
+
<li><a href="./lib/journeta/asynchronous_rb.html?TB_iframe=true&height=550&width=785"
|
42
|
+
class="thickbox" title="lib/journeta/asynchronous.rb">lib/journeta/asynchronous.rb</a></li>
|
43
|
+
|
44
|
+
<li><a href="./lib/journeta/common/basic_message_rb.html?TB_iframe=true&height=550&width=785"
|
45
|
+
class="thickbox" title="lib/journeta/common/basic_message.rb">lib/journeta/common/basic_message.rb</a></li>
|
46
|
+
|
47
|
+
<li><a href="./lib/journeta/common/dummy_peer_handler_rb.html?TB_iframe=true&height=550&width=785"
|
48
|
+
class="thickbox" title="lib/journeta/common/dummy_peer_handler.rb">lib/journeta/common/dummy_peer_handler.rb</a></li>
|
49
|
+
|
50
|
+
<li><a href="./lib/journeta/common/job_rb.html?TB_iframe=true&height=550&width=785"
|
51
|
+
class="thickbox" title="lib/journeta/common/job.rb">lib/journeta/common/job.rb</a></li>
|
52
|
+
|
53
|
+
<li><a href="./lib/journeta/common/shutdown_rb.html?TB_iframe=true&height=550&width=785"
|
54
|
+
class="thickbox" title="lib/journeta/common/shutdown.rb">lib/journeta/common/shutdown.rb</a></li>
|
55
|
+
|
56
|
+
<li><a href="./lib/journeta/exception_rb.html?TB_iframe=true&height=550&width=785"
|
57
|
+
class="thickbox" title="lib/journeta/exception.rb">lib/journeta/exception.rb</a></li>
|
58
|
+
|
59
|
+
<li><a href="./lib/journeta/journeta_engine_rb.html?TB_iframe=true&height=550&width=785"
|
60
|
+
class="thickbox" title="lib/journeta/journeta_engine.rb">lib/journeta/journeta_engine.rb</a></li>
|
61
|
+
|
62
|
+
<li><a href="./lib/journeta/logger_rb.html?TB_iframe=true&height=550&width=785"
|
63
|
+
class="thickbox" title="lib/journeta/logger.rb">lib/journeta/logger.rb</a></li>
|
64
|
+
|
65
|
+
<li><a href="./lib/journeta/peer_connection_rb.html?TB_iframe=true&height=550&width=785"
|
66
|
+
class="thickbox" title="lib/journeta/peer_connection.rb">lib/journeta/peer_connection.rb</a></li>
|
67
|
+
|
68
|
+
<li><a href="./lib/journeta/peer_handler_rb.html?TB_iframe=true&height=550&width=785"
|
69
|
+
class="thickbox" title="lib/journeta/peer_handler.rb">lib/journeta/peer_handler.rb</a></li>
|
70
|
+
|
71
|
+
<li><a href="./lib/journeta/peer_listener_rb.html?TB_iframe=true&height=550&width=785"
|
72
|
+
class="thickbox" title="lib/journeta/peer_listener.rb">lib/journeta/peer_listener.rb</a></li>
|
73
|
+
|
74
|
+
<li><a href="./lib/journeta/peer_registry_rb.html?TB_iframe=true&height=550&width=785"
|
75
|
+
class="thickbox" title="lib/journeta/peer_registry.rb">lib/journeta/peer_registry.rb</a></li>
|
76
|
+
|
77
|
+
<li><a href="./lib/journeta/presence_broadcaster_rb.html?TB_iframe=true&height=550&width=785"
|
78
|
+
class="thickbox" title="lib/journeta/presence_broadcaster.rb">lib/journeta/presence_broadcaster.rb</a></li>
|
79
|
+
|
80
|
+
<li><a href="./lib/journeta/presence_listener_rb.html?TB_iframe=true&height=550&width=785"
|
81
|
+
class="thickbox" title="lib/journeta/presence_listener.rb">lib/journeta/presence_listener.rb</a></li>
|
82
|
+
|
83
|
+
<li><a href="./lib/journeta/presence_message_rb.html?TB_iframe=true&height=550&width=785"
|
84
|
+
class="thickbox" title="lib/journeta/presence_message.rb">lib/journeta/presence_message.rb</a></li>
|
85
|
+
|
86
|
+
<li><a href="./lib/journeta/version_rb.html?TB_iframe=true&height=550&width=785"
|
87
|
+
class="thickbox" title="lib/journeta/version.rb">lib/journeta/version.rb</a></li>
|
88
|
+
|
89
|
+
</ul>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
|
93
|
+
|
94
|
+
</div>
|
95
|
+
|
96
|
+
<div id="class-metadata">
|
97
|
+
|
98
|
+
<!-- Parent Class -->
|
99
|
+
|
100
|
+
|
101
|
+
<!-- Namespace Contents -->
|
102
|
+
|
103
|
+
<div id="namespace-list-section" class="section">
|
104
|
+
<h3 class="section-header">Namespace</h3>
|
105
|
+
<ul class="link-list">
|
106
|
+
|
107
|
+
<li><span class="type">MODULE</span> <a href="Journeta/Common.html">Journeta::Common</a></li>
|
108
|
+
|
109
|
+
<li><span class="type">MODULE</span> <a href="Journeta/Logger.html">Journeta::Logger</a></li>
|
110
|
+
|
111
|
+
<li><span class="type">MODULE</span> <a href="Journeta/VERSION.html">Journeta::VERSION</a></li>
|
112
|
+
|
113
|
+
<li><span class="type">CLASS</span> <a href="Journeta/Asynchronous.html">Journeta::Asynchronous</a></li>
|
114
|
+
|
115
|
+
<li><span class="type">CLASS</span> <a href="Journeta/DefaultPeerHandler.html">Journeta::DefaultPeerHandler</a></li>
|
116
|
+
|
117
|
+
<li><span class="type">CLASS</span> <a href="Journeta/DefaultPeerRegisteredHandler.html">Journeta::DefaultPeerRegisteredHandler</a></li>
|
118
|
+
|
119
|
+
<li><span class="type">CLASS</span> <a href="Journeta/DefaultPeerUnregisteredHandler.html">Journeta::DefaultPeerUnregisteredHandler</a></li>
|
120
|
+
|
121
|
+
<li><span class="type">CLASS</span> <a href="Journeta/DefaultPeerUpdatedHandler.html">Journeta::DefaultPeerUpdatedHandler</a></li>
|
122
|
+
|
123
|
+
<li><span class="type">CLASS</span> <a href="Journeta/Engine.html">Journeta::Engine</a></li>
|
124
|
+
|
125
|
+
<li><span class="type">CLASS</span> <a href="Journeta/NotImplementedException.html">Journeta::NotImplementedException</a></li>
|
126
|
+
|
127
|
+
<li><span class="type">CLASS</span> <a href="Journeta/PeerConnection.html">Journeta::PeerConnection</a></li>
|
128
|
+
|
129
|
+
<li><span class="type">CLASS</span> <a href="Journeta/PeerListener.html">Journeta::PeerListener</a></li>
|
130
|
+
|
131
|
+
<li><span class="type">CLASS</span> <a href="Journeta/PeerRegistry.html">Journeta::PeerRegistry</a></li>
|
132
|
+
|
133
|
+
<li><span class="type">CLASS</span> <a href="Journeta/PresenceBroadcaster.html">Journeta::PresenceBroadcaster</a></li>
|
134
|
+
|
135
|
+
<li><span class="type">CLASS</span> <a href="Journeta/PresenceListener.html">Journeta::PresenceListener</a></li>
|
136
|
+
|
137
|
+
<li><span class="type">CLASS</span> <a href="Journeta/PresenceMessage.html">Journeta::PresenceMessage</a></li>
|
138
|
+
|
139
|
+
</ul>
|
140
|
+
</div>
|
141
|
+
|
142
|
+
|
143
|
+
<!-- Method Quickref -->
|
144
|
+
|
145
|
+
|
146
|
+
<!-- Included Modules -->
|
147
|
+
|
148
|
+
</div>
|
149
|
+
|
150
|
+
<div id="project-metadata">
|
151
|
+
|
152
|
+
|
153
|
+
<div id="fileindex-section" class="section project-section">
|
154
|
+
<h3 class="section-header">Files</h3>
|
155
|
+
<ul>
|
156
|
+
|
157
|
+
<li class="file"><a href="./README_rdoc.html">README.rdoc</a></li>
|
158
|
+
|
159
|
+
</ul>
|
160
|
+
</div>
|
161
|
+
|
162
|
+
|
163
|
+
<div id="classindex-section" class="section project-section">
|
164
|
+
<h3 class="section-header">Class Index
|
165
|
+
<span class="search-toggle"><img src="./images/find.png"
|
166
|
+
height="16" width="16" alt="[+]"
|
167
|
+
title="show/hide quicksearch" /></span></h3>
|
168
|
+
<form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
|
169
|
+
<fieldset>
|
170
|
+
<legend>Quicksearch</legend>
|
171
|
+
<input type="text" name="quicksearch" value=""
|
172
|
+
class="quicksearch-field" />
|
173
|
+
</fieldset>
|
174
|
+
</form>
|
175
|
+
|
176
|
+
<ul class="link-list">
|
177
|
+
|
178
|
+
<li><a href="./Journeta/Asynchronous.html">Journeta::Asynchronous</a></li>
|
179
|
+
|
180
|
+
<li><a href="./Journeta/Common.html">Journeta::Common</a></li>
|
181
|
+
|
182
|
+
<li><a href="./Journeta/Common/BasicMessage.html">Journeta::Common::BasicMessage</a></li>
|
183
|
+
|
184
|
+
<li><a href="./Journeta/Common/DummyPeerHandler.html">Journeta::Common::DummyPeerHandler</a></li>
|
185
|
+
|
186
|
+
<li><a href="./Journeta/Common/Job.html">Journeta::Common::Job</a></li>
|
187
|
+
|
188
|
+
<li><a href="./Journeta/Common/Shutdown.html">Journeta::Common::Shutdown</a></li>
|
189
|
+
|
190
|
+
<li><a href="./Journeta/DefaultPeerHandler.html">Journeta::DefaultPeerHandler</a></li>
|
191
|
+
|
192
|
+
<li><a href="./Journeta/DefaultPeerRegisteredHandler.html">Journeta::DefaultPeerRegisteredHandler</a></li>
|
193
|
+
|
194
|
+
<li><a href="./Journeta/DefaultPeerUnregisteredHandler.html">Journeta::DefaultPeerUnregisteredHandler</a></li>
|
195
|
+
|
196
|
+
<li><a href="./Journeta/DefaultPeerUpdatedHandler.html">Journeta::DefaultPeerUpdatedHandler</a></li>
|
197
|
+
|
198
|
+
<li><a href="./Journeta/Engine.html">Journeta::Engine</a></li>
|
199
|
+
|
200
|
+
<li><a href="./Journeta/Logger.html">Journeta::Logger</a></li>
|
201
|
+
|
202
|
+
<li><a href="./Journeta/NotImplementedException.html">Journeta::NotImplementedException</a></li>
|
203
|
+
|
204
|
+
<li><a href="./Journeta/PeerConnection.html">Journeta::PeerConnection</a></li>
|
205
|
+
|
206
|
+
<li><a href="./Journeta/PeerListener.html">Journeta::PeerListener</a></li>
|
207
|
+
|
208
|
+
<li><a href="./Journeta/PeerRegistry.html">Journeta::PeerRegistry</a></li>
|
209
|
+
|
210
|
+
<li><a href="./Journeta/PresenceBroadcaster.html">Journeta::PresenceBroadcaster</a></li>
|
211
|
+
|
212
|
+
<li><a href="./Journeta/PresenceListener.html">Journeta::PresenceListener</a></li>
|
213
|
+
|
214
|
+
<li><a href="./Journeta/PresenceMessage.html">Journeta::PresenceMessage</a></li>
|
215
|
+
|
216
|
+
<li><a href="./Array.html">Array</a></li>
|
217
|
+
|
218
|
+
<li><a href="./Diff.html">Diff</a></li>
|
219
|
+
|
220
|
+
<li><a href="./Diffable.html">Diffable</a></li>
|
221
|
+
|
222
|
+
<li><a href="./String.html">String</a></li>
|
223
|
+
|
224
|
+
</ul>
|
225
|
+
<div id="no-class-search-results" style="display: none;">No matching classes.</div>
|
226
|
+
</div>
|
227
|
+
|
228
|
+
|
229
|
+
</div>
|
230
|
+
</div>
|
231
|
+
|
232
|
+
<div id="documentation">
|
233
|
+
<h1 class="module">Journeta</h1>
|
234
|
+
|
235
|
+
<div id="description">
|
236
|
+
<p>
|
237
|
+
Copyright 2011, Preston Lee Ventures, LLC. All rights reserved.
|
238
|
+
</p>
|
239
|
+
<hr style="height: 1px"></hr><p>
|
240
|
+
Copyright © 2011 Preston Lee Ventures, LLC. All rights reserved.
|
241
|
+
</p>
|
242
|
+
<p>
|
243
|
+
The root namespace for the entire #Journeta library. See..
|
244
|
+
</p>
|
245
|
+
<pre>
|
246
|
+
* +Journeta::Engine+
|
247
|
+
* https://github.com/preston/journeta
|
248
|
+
* http://journeta.rubyforge.org
|
249
|
+
</pre>
|
250
|
+
<hr style="height: 1px"></hr><p>
|
251
|
+
Copyright 2011, Preston Lee Ventures, LLC. All rights reserved.
|
252
|
+
</p>
|
253
|
+
<hr style="height: 1px"></hr><p>
|
254
|
+
Copyright © 2011 Preston Lee Ventures, LLC. All rights reserved.
|
255
|
+
</p>
|
256
|
+
<p>
|
257
|
+
Preston Lee <preston.lee@prestonlee.com>
|
258
|
+
</p>
|
259
|
+
|
260
|
+
</div>
|
261
|
+
|
262
|
+
<!-- Constants -->
|
263
|
+
|
264
|
+
|
265
|
+
<!-- Attributes -->
|
266
|
+
|
267
|
+
|
268
|
+
<!-- Methods -->
|
269
|
+
|
270
|
+
|
271
|
+
</div>
|
272
|
+
|
273
|
+
|
274
|
+
<div id="rdoc-debugging-section-dump" class="debugging-section">
|
275
|
+
|
276
|
+
<p>Disabled; run with --debug to generate this.</p>
|
277
|
+
|
278
|
+
</div>
|
279
|
+
|
280
|
+
<div id="validator-badges">
|
281
|
+
<p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
|
282
|
+
<p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
|
283
|
+
Rdoc Generator</a> 1.1.6</small>.</p>
|
284
|
+
</div>
|
285
|
+
|
286
|
+
</body>
|
287
|
+
</html>
|
288
|
+
|