rumai 3.2.0 → 3.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (181) hide show
  1. data/CREDITS +4 -3
  2. data/HISTORY +327 -0
  3. data/INSTALL +31 -0
  4. data/README +92 -0
  5. data/USAGE +297 -0
  6. data/bin/rumai +9 -22
  7. data/doc/api/IO.html +119 -0
  8. data/doc/api/Integer.html +171 -0
  9. data/doc/api/Rumai.html +1270 -0
  10. data/doc/api/Rumai/Area.html +1485 -0
  11. data/doc/api/Rumai/Chain.html +301 -0
  12. data/doc/api/Rumai/Client.html +2451 -0
  13. data/doc/api/Rumai/ClientContainer.html +301 -0
  14. data/doc/api/Rumai/ExportInstanceMethods.html +103 -0
  15. data/doc/api/Rumai/IXP.html +94 -0
  16. data/doc/api/Rumai/IXP/Agent.html +1625 -0
  17. data/doc/api/Rumai/IXP/Agent/FidStream.html +959 -0
  18. data/doc/api/Rumai/IXP/Agent/RangedPool.html +381 -0
  19. data/doc/api/Rumai/IXP/Error.html +110 -0
  20. data/doc/api/Rumai/IXP/Fcall.html +503 -0
  21. data/doc/api/Rumai/IXP/Qid.html +207 -0
  22. data/doc/api/Rumai/IXP/Rattach.html +148 -0
  23. data/doc/api/Rumai/IXP/Rauth.html +148 -0
  24. data/doc/api/Rumai/IXP/Rclunk.html +148 -0
  25. data/doc/api/Rumai/IXP/Rcreate.html +148 -0
  26. data/doc/api/Rumai/IXP/Rerror.html +148 -0
  27. data/doc/api/Rumai/IXP/Rflush.html +148 -0
  28. data/doc/api/Rumai/IXP/Ropen.html +148 -0
  29. data/doc/api/Rumai/IXP/Rread.html +148 -0
  30. data/doc/api/Rumai/IXP/Rremove.html +148 -0
  31. data/doc/api/Rumai/IXP/Rstat.html +148 -0
  32. data/doc/api/Rumai/IXP/Rversion.html +148 -0
  33. data/doc/api/Rumai/IXP/Rwalk.html +148 -0
  34. data/doc/api/Rumai/IXP/Rwrite.html +148 -0
  35. data/doc/api/Rumai/IXP/Rwstat.html +148 -0
  36. data/doc/api/Rumai/IXP/Stat.html +335 -0
  37. data/doc/api/Rumai/IXP/Stream.html +194 -0
  38. data/doc/api/Rumai/IXP/Struct.html +586 -0
  39. data/doc/api/Rumai/IXP/Struct/ClassField.html +242 -0
  40. data/doc/api/Rumai/IXP/Struct/Field.html +782 -0
  41. data/doc/api/Rumai/IXP/Struct/Field/CounteeField.html +227 -0
  42. data/doc/api/Rumai/IXP/Struct/Field/CounterField.html +153 -0
  43. data/doc/api/Rumai/IXP/Struct/Integer8Field.html +242 -0
  44. data/doc/api/Rumai/IXP/Struct/StringField.html +206 -0
  45. data/doc/api/Rumai/IXP/Tattach.html +148 -0
  46. data/doc/api/Rumai/IXP/Tauth.html +148 -0
  47. data/doc/api/Rumai/IXP/Tclunk.html +148 -0
  48. data/doc/api/Rumai/IXP/Tcreate.html +148 -0
  49. data/doc/api/Rumai/IXP/Terror.html +231 -0
  50. data/doc/api/Rumai/IXP/Tflush.html +148 -0
  51. data/doc/api/Rumai/IXP/Topen.html +240 -0
  52. data/doc/api/Rumai/IXP/Tread.html +148 -0
  53. data/doc/api/Rumai/IXP/Tremove.html +148 -0
  54. data/doc/api/Rumai/IXP/Tstat.html +148 -0
  55. data/doc/api/Rumai/IXP/Tversion.html +162 -0
  56. data/doc/api/Rumai/IXP/Twalk.html +148 -0
  57. data/doc/api/Rumai/IXP/Twrite.html +148 -0
  58. data/doc/api/Rumai/IXP/Twstat.html +148 -0
  59. data/doc/api/Rumai/Node.html +1406 -0
  60. data/doc/api/Rumai/View.html +1587 -0
  61. data/doc/api/Rumai/WidgetImpl.html +333 -0
  62. data/doc/api/Rumai/WidgetNode.html +246 -0
  63. data/doc/api/String.html +258 -0
  64. data/doc/api/StringIO.html +119 -0
  65. data/doc/api/Time.html +247 -0
  66. data/doc/api/_index.html +581 -0
  67. data/doc/api/class_list.html +36 -0
  68. data/doc/api/css/common.css +1 -0
  69. data/doc/api/css/full_list.css +50 -0
  70. data/doc/api/css/style.css +273 -0
  71. data/doc/api/file.LICENSE.html +73 -0
  72. data/doc/api/file_list.html +38 -0
  73. data/doc/api/frames.html +13 -0
  74. data/doc/api/index.html +72 -13
  75. data/doc/api/js/app.js +111 -0
  76. data/doc/api/js/full_list.js +117 -0
  77. data/doc/api/js/{jquery-1.3.2.min.js → jquery.js} +0 -0
  78. data/doc/api/method_list.html +1483 -0
  79. data/doc/api/top-level-namespace.html +89 -0
  80. data/doc/index.erb +18 -13
  81. data/doc/index.html +331 -386
  82. data/lib/rumai.rb +1 -18
  83. data/lib/rumai/fs.rb +11 -11
  84. data/lib/rumai/inochi.rb +48 -0
  85. data/lib/rumai/inochi.yaml +94 -0
  86. data/lib/rumai/ixp.rb +0 -4
  87. data/lib/rumai/ixp/message.rb +6 -17
  88. data/lib/rumai/ixp/transport.rb +39 -30
  89. data/lib/rumai/wm.rb +35 -37
  90. data/test/rumai/inochi_test.rb +17 -0
  91. data/test/rumai/ixp/message_test.rb +245 -0
  92. data/test/runner +25 -0
  93. data/test/test_helper.rb +1 -0
  94. metadata +107 -125
  95. data/doc/api/apple-touch-icon.png +0 -0
  96. data/doc/api/classes/IO.html +0 -72
  97. data/doc/api/classes/Integer.html +0 -110
  98. data/doc/api/classes/Object.html +0 -60
  99. data/doc/api/classes/Rumai.html +0 -837
  100. data/doc/api/classes/Rumai/Area.html +0 -909
  101. data/doc/api/classes/Rumai/Chain.html +0 -197
  102. data/doc/api/classes/Rumai/Client.html +0 -1526
  103. data/doc/api/classes/Rumai/ClientContainer.html +0 -191
  104. data/doc/api/classes/Rumai/ExportInstanceMethods.html +0 -69
  105. data/doc/api/classes/Rumai/IXP.html +0 -131
  106. data/doc/api/classes/Rumai/IXP/Agent.html +0 -941
  107. data/doc/api/classes/Rumai/IXP/Agent/FidStream.html +0 -456
  108. data/doc/api/classes/Rumai/IXP/Agent/MODES.html +0 -108
  109. data/doc/api/classes/Rumai/IXP/Agent/RangedPool.html +0 -241
  110. data/doc/api/classes/Rumai/IXP/Error.html +0 -67
  111. data/doc/api/classes/Rumai/IXP/Fcall.html +0 -323
  112. data/doc/api/classes/Rumai/IXP/Qid.html +0 -153
  113. data/doc/api/classes/Rumai/IXP/Rattach.html +0 -67
  114. data/doc/api/classes/Rumai/IXP/Rauth.html +0 -67
  115. data/doc/api/classes/Rumai/IXP/Rclunk.html +0 -67
  116. data/doc/api/classes/Rumai/IXP/Rcreate.html +0 -67
  117. data/doc/api/classes/Rumai/IXP/Rerror.html +0 -67
  118. data/doc/api/classes/Rumai/IXP/Rflush.html +0 -67
  119. data/doc/api/classes/Rumai/IXP/Ropen.html +0 -67
  120. data/doc/api/classes/Rumai/IXP/Rread.html +0 -67
  121. data/doc/api/classes/Rumai/IXP/Rremove.html +0 -67
  122. data/doc/api/classes/Rumai/IXP/Rstat.html +0 -67
  123. data/doc/api/classes/Rumai/IXP/Rversion.html +0 -67
  124. data/doc/api/classes/Rumai/IXP/Rwalk.html +0 -67
  125. data/doc/api/classes/Rumai/IXP/Rwrite.html +0 -67
  126. data/doc/api/classes/Rumai/IXP/Rwstat.html +0 -67
  127. data/doc/api/classes/Rumai/IXP/Stat.html +0 -252
  128. data/doc/api/classes/Rumai/IXP/Stream.html +0 -131
  129. data/doc/api/classes/Rumai/IXP/Struct.html +0 -311
  130. data/doc/api/classes/Rumai/IXP/Struct/Field.html +0 -415
  131. data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.html +0 -153
  132. data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.html +0 -104
  133. data/doc/api/classes/Rumai/IXP/Tattach.html +0 -68
  134. data/doc/api/classes/Rumai/IXP/Tauth.html +0 -67
  135. data/doc/api/classes/Rumai/IXP/Tclunk.html +0 -67
  136. data/doc/api/classes/Rumai/IXP/Tcreate.html +0 -68
  137. data/doc/api/classes/Rumai/IXP/Terror.html +0 -110
  138. data/doc/api/classes/Rumai/IXP/Tflush.html +0 -67
  139. data/doc/api/classes/Rumai/IXP/Topen.html +0 -165
  140. data/doc/api/classes/Rumai/IXP/Tread.html +0 -67
  141. data/doc/api/classes/Rumai/IXP/Tremove.html +0 -67
  142. data/doc/api/classes/Rumai/IXP/Tstat.html +0 -67
  143. data/doc/api/classes/Rumai/IXP/Tversion.html +0 -86
  144. data/doc/api/classes/Rumai/IXP/Twalk.html +0 -68
  145. data/doc/api/classes/Rumai/IXP/Twrite.html +0 -68
  146. data/doc/api/classes/Rumai/IXP/Twstat.html +0 -67
  147. data/doc/api/classes/Rumai/Node.html +0 -821
  148. data/doc/api/classes/Rumai/View.html +0 -967
  149. data/doc/api/classes/Rumai/WidgetImpl.html +0 -65
  150. data/doc/api/classes/Rumai/WidgetNode.html +0 -68
  151. data/doc/api/classes/String.html +0 -163
  152. data/doc/api/classes/StringIO.html +0 -72
  153. data/doc/api/classes/Time.html +0 -156
  154. data/doc/api/created.rid +0 -1
  155. data/doc/api/css/main.css +0 -263
  156. data/doc/api/css/panel.css +0 -383
  157. data/doc/api/css/reset.css +0 -53
  158. data/doc/api/favicon.ico +0 -0
  159. data/doc/api/files/CREDITS.html +0 -67
  160. data/doc/api/files/LICENSE.html +0 -76
  161. data/doc/api/files/lib/rumai/fs_rb.html +0 -75
  162. data/doc/api/files/lib/rumai/ixp/message_rb.html +0 -91
  163. data/doc/api/files/lib/rumai/ixp/transport_rb.html +0 -75
  164. data/doc/api/files/lib/rumai/ixp_rb.html +0 -69
  165. data/doc/api/files/lib/rumai/wm_rb.html +0 -77
  166. data/doc/api/files/lib/rumai_rb.html +0 -65
  167. data/doc/api/i/arrows.png +0 -0
  168. data/doc/api/i/results_bg.png +0 -0
  169. data/doc/api/i/tree_bg.png +0 -0
  170. data/doc/api/js/jquery-effect.js +0 -593
  171. data/doc/api/js/main.js +0 -22
  172. data/doc/api/js/searchdoc.js +0 -628
  173. data/doc/api/panel/index.html +0 -71
  174. data/doc/api/panel/search_index.js +0 -1
  175. data/doc/api/panel/tree.js +0 -1
  176. data/doc/history.erb +0 -233
  177. data/doc/intro.erb +0 -70
  178. data/doc/setup.erb +0 -144
  179. data/doc/usage.erb +0 -308
  180. data/rakefile +0 -14
  181. data/test/rumai/ixp/message.rb +0 -237
@@ -1,456 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
- <head>
6
- <title>Rumai::IXP::Agent::FidStream</title>
7
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
- <link rel="stylesheet" href="../../../../css/reset.css" type="text/css" media="screen" />
9
- <link rel="stylesheet" href="../../../../css/main.css" type="text/css" media="screen" />
10
- <script src="../../../../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
11
- <script src="../../../../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
12
- <script src="../../../../js/main.js" type="text/javascript" charset="utf-8"></script>
13
- </head>
14
-
15
- <body>
16
- <div class="banner">
17
- <h1>
18
- <span class="type">Class</span>
19
- Rumai::IXP::Agent::FidStream
20
-
21
- <span class="parent">&lt;
22
-
23
- <a href="../../../Object.html">Object</a>
24
-
25
- </span>
26
-
27
- </h1>
28
- <ul class="files">
29
-
30
- <li><a href="../../../../files/lib/rumai/ixp/transport_rb.html">lib/rumai/ixp/transport.rb</a></li>
31
-
32
- </ul>
33
- </div>
34
- <div id="bodyContent">
35
- <div id="content">
36
-
37
- <div class="description">
38
- <p>
39
- Encapsulates I/O access over a file handle (fid).
40
- </p>
41
- <p>
42
- NOTE: this class is NOT thread safe!
43
- </p>
44
-
45
- </div>
46
-
47
-
48
-
49
-
50
-
51
-
52
-
53
-
54
-
55
- <div class="sectiontitle">Methods</div>
56
- <dl class="methods">
57
-
58
- <dt>#</dt>
59
- <dd>
60
- <ul>
61
-
62
- <li><a href="#M000082"><<</a></li>
63
-
64
- </ul>
65
- </dd>
66
-
67
- <dt>C</dt>
68
- <dd>
69
- <ul>
70
-
71
- <li><a href="#M000074">close</a>,</li>
72
-
73
- <li><a href="#M000075">closed?</a></li>
74
-
75
- </ul>
76
- </dd>
77
-
78
- <dt>N</dt>
79
- <dd>
80
- <ul>
81
-
82
- <li><a href="#M000070">new</a></li>
83
-
84
- </ul>
85
- </dd>
86
-
87
- <dt>R</dt>
88
- <dd>
89
- <ul>
90
-
91
- <li><a href="#M000080">read</a>,</li>
92
-
93
- <li><a href="#M000073">rewind</a></li>
94
-
95
- </ul>
96
- </dd>
97
-
98
- <dt>W</dt>
99
- <dd>
100
- <ul>
101
-
102
- <li><a href="#M000081">write</a></li>
103
-
104
- </ul>
105
- </dd>
106
-
107
- </dl>
108
-
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
-
118
-
119
- <div class="sectiontitle">Attributes</div>
120
- <table border='0' cellpadding='5'>
121
-
122
- <tr valign='top'>
123
- <td class='attr-rw'>
124
- [R]
125
- </td>
126
- <td class='attr-name'>fid</td>
127
- <td class='attr-desc'></td>
128
- </tr>
129
-
130
- <tr valign='top'>
131
- <td class='attr-rw'>
132
- [R]
133
- </td>
134
- <td class='attr-name'>stat</td>
135
- <td class='attr-desc'></td>
136
- </tr>
137
-
138
- <tr valign='top'>
139
- <td class='attr-rw'>
140
- [R]
141
- </td>
142
- <td class='attr-name'>eof</td>
143
- <td class='attr-desc'></td>
144
- </tr>
145
-
146
- <tr valign='top'>
147
- <td class='attr-rw'>
148
- [RW]
149
- </td>
150
- <td class='attr-name'>pos</td>
151
- <td class='attr-desc'></td>
152
- </tr>
153
-
154
- </table>
155
-
156
-
157
-
158
- <div class="sectiontitle">Class Public methods</div>
159
-
160
- <div class="method">
161
- <div class="title" id="M000070">
162
-
163
- <a name="M000070"></a><b>new</b>(agent, path_fid, message_size)
164
-
165
- </div>
166
-
167
-
168
-
169
-
170
- <div class="sourcecode">
171
- <p class="source-link">
172
- Source: <a href="javascript:toggleSource('M000070_source')" id="l_M000070_source">show</a>
173
-
174
- | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L238" target="_blank" class="github_url">on GitHub</a>
175
-
176
- </p>
177
- <div id="M000070_source" class="dyn-source">
178
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 238</span>
179
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">agent</span>, <span class="ruby-identifier">path_fid</span>, <span class="ruby-identifier">message_size</span>
180
- <span class="ruby-ivar">@agent</span> = <span class="ruby-identifier">agent</span>
181
- <span class="ruby-ivar">@fid</span> = <span class="ruby-identifier">path_fid</span>
182
- <span class="ruby-ivar">@msize</span> = <span class="ruby-identifier">message_size</span>
183
- <span class="ruby-ivar">@stat</span> = <span class="ruby-ivar">@agent</span>.<span class="ruby-identifier">stat_fid</span>(<span class="ruby-ivar">@fid</span>)
184
- <span class="ruby-ivar">@closed</span> = <span class="ruby-keyword kw">false</span>
185
- <span class="ruby-identifier">rewind</span>
186
- <span class="ruby-keyword kw">end</span></pre>
187
- </div>
188
- </div>
189
-
190
- </div>
191
-
192
- <div class="sectiontitle">Instance Public methods</div>
193
-
194
- <div class="method">
195
- <div class="title" id="M000082">
196
-
197
- <a name="M000082"></a><b>&lt;&lt;</b>(content)
198
-
199
- </div>
200
-
201
- <div class="description">
202
- <p>
203
- Alias for <a href="FidStream.html#M000081">write</a>
204
- </p>
205
-
206
- </div>
207
-
208
-
209
-
210
- </div>
211
-
212
- <div class="method">
213
- <div class="title" id="M000074">
214
-
215
- <a name="M000074"></a><b>close</b>()
216
-
217
- </div>
218
-
219
- <div class="description">
220
- <p>
221
- Closes this stream.
222
- </p>
223
-
224
- </div>
225
-
226
-
227
-
228
-
229
- <div class="sourcecode">
230
- <p class="source-link">
231
- Source: <a href="javascript:toggleSource('M000074_source')" id="l_M000074_source">show</a>
232
-
233
- | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L258" target="_blank" class="github_url">on GitHub</a>
234
-
235
- </p>
236
- <div id="M000074_source" class="dyn-source">
237
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 258</span>
238
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
239
- <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@closed</span>
240
- <span class="ruby-ivar">@agent</span>.<span class="ruby-identifier">clunk</span> <span class="ruby-ivar">@fid</span>
241
- <span class="ruby-ivar">@closed</span> = <span class="ruby-keyword kw">true</span>
242
- <span class="ruby-ivar">@eof</span> = <span class="ruby-keyword kw">true</span>
243
- <span class="ruby-keyword kw">end</span>
244
- <span class="ruby-keyword kw">end</span></pre>
245
- </div>
246
- </div>
247
-
248
- </div>
249
-
250
- <div class="method">
251
- <div class="title" id="M000075">
252
-
253
- <a name="M000075"></a><b>closed?</b>()
254
-
255
- </div>
256
-
257
- <div class="description">
258
- <p>
259
- Returns true if this stream is closed.
260
- </p>
261
-
262
- </div>
263
-
264
-
265
-
266
-
267
- <div class="sourcecode">
268
- <p class="source-link">
269
- Source: <a href="javascript:toggleSource('M000075_source')" id="l_M000075_source">show</a>
270
-
271
- | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L269" target="_blank" class="github_url">on GitHub</a>
272
-
273
- </p>
274
- <div id="M000075_source" class="dyn-source">
275
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 269</span>
276
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">closed?</span>
277
- <span class="ruby-ivar">@closed</span>
278
- <span class="ruby-keyword kw">end</span></pre>
279
- </div>
280
- </div>
281
-
282
- </div>
283
-
284
- <div class="method">
285
- <div class="title" id="M000080">
286
-
287
- <a name="M000080"></a><b>read</b>(partial = false)
288
-
289
- </div>
290
-
291
- <div class="description">
292
- <p>
293
- Reads some data from this stream at the current position.
294
- </p>
295
- <dl>
296
- <dt>partial</dt><dd>When false, the entire content of this stream is read and returned.
297
-
298
- <p>
299
- When true, the maximum amount of content that can fit inside a single
300
- 9P2000 message is read and returned.
301
- </p>
302
- </dd>
303
- </dl>
304
- <p>
305
- If this stream corresponds to a directory, then an Array of <a
306
- href="../Stat.html">Stat</a> (one for each file in the directory) will be
307
- returned.
308
- </p>
309
-
310
- </div>
311
-
312
-
313
-
314
-
315
- <div class="sourcecode">
316
- <p class="source-link">
317
- Source: <a href="javascript:toggleSource('M000080_source')" id="l_M000080_source">show</a>
318
-
319
- | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L286" target="_blank" class="github_url">on GitHub</a>
320
-
321
- </p>
322
- <div id="M000080_source" class="dyn-source">
323
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 286</span>
324
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span> <span class="ruby-identifier">partial</span> = <span class="ruby-keyword kw">false</span>
325
- <span class="ruby-identifier">raise</span> <span class="ruby-value str">'cannot read from a closed stream'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@closed</span>
326
-
327
- <span class="ruby-identifier">content</span> = <span class="ruby-value str">''</span>
328
- <span class="ruby-keyword kw">begin</span>
329
- <span class="ruby-identifier">req</span> = <span class="ruby-constant">Tread</span>.<span class="ruby-identifier">new</span>(
330
- <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@fid</span>,
331
- <span class="ruby-identifier">:offset</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@pos</span>,
332
- <span class="ruby-identifier">:count</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@msize</span>
333
- )
334
- <span class="ruby-identifier">rsp</span> = <span class="ruby-ivar">@agent</span>.<span class="ruby-identifier">talk</span>(<span class="ruby-identifier">req</span>)
335
-
336
- <span class="ruby-identifier">content</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">rsp</span>.<span class="ruby-identifier">data</span>
337
- <span class="ruby-identifier">count</span> = <span class="ruby-identifier">rsp</span>.<span class="ruby-identifier">count</span>
338
- <span class="ruby-ivar">@pos</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">count</span>
339
- <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">until</span> <span class="ruby-ivar">@eof</span> = <span class="ruby-identifier">count</span>.<span class="ruby-identifier">zero?</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">partial</span>
340
-
341
- <span class="ruby-comment cmt"># the content of a directory is a sequence</span>
342
- <span class="ruby-comment cmt"># of Stat for all files in that directory</span>
343
- <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@stat</span>.<span class="ruby-identifier">directory?</span>
344
- <span class="ruby-identifier">buffer</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">content</span>)
345
- <span class="ruby-identifier">content</span> = []
346
-
347
- <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">buffer</span>.<span class="ruby-identifier">eof?</span>
348
- <span class="ruby-identifier">content</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-constant">Stat</span>.<span class="ruby-identifier">from_9p</span>(<span class="ruby-identifier">buffer</span>)
349
- <span class="ruby-keyword kw">end</span>
350
- <span class="ruby-keyword kw">end</span>
351
-
352
- <span class="ruby-identifier">content</span>
353
- <span class="ruby-keyword kw">end</span></pre>
354
- </div>
355
- </div>
356
-
357
- </div>
358
-
359
- <div class="method">
360
- <div class="title" id="M000073">
361
-
362
- <a name="M000073"></a><b>rewind</b>()
363
-
364
- </div>
365
-
366
- <div class="description">
367
- <p>
368
- Rewinds the stream to the beginning.
369
- </p>
370
-
371
- </div>
372
-
373
-
374
-
375
-
376
- <div class="sourcecode">
377
- <p class="source-link">
378
- Source: <a href="javascript:toggleSource('M000073_source')" id="l_M000073_source">show</a>
379
-
380
- | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L250" target="_blank" class="github_url">on GitHub</a>
381
-
382
- </p>
383
- <div id="M000073_source" class="dyn-source">
384
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 250</span>
385
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rewind</span>
386
- <span class="ruby-ivar">@pos</span> = <span class="ruby-value">0</span>
387
- <span class="ruby-ivar">@eof</span> = <span class="ruby-keyword kw">false</span>
388
- <span class="ruby-keyword kw">end</span></pre>
389
- </div>
390
- </div>
391
-
392
- </div>
393
-
394
- <div class="method">
395
- <div class="title" id="M000081">
396
-
397
- <a name="M000081"></a><b>write</b>(content)
398
-
399
- </div>
400
-
401
- <div class="description">
402
- <p>
403
- Writes the given content at the current position in this stream.
404
- </p>
405
-
406
- </div>
407
-
408
-
409
- <div class="aka">
410
- This method is also aliased as
411
-
412
- <a href="FidStream.html#M000082">&lt;&lt;</a>
413
-
414
- </div>
415
-
416
-
417
-
418
- <div class="sourcecode">
419
- <p class="source-link">
420
- Source: <a href="javascript:toggleSource('M000081_source')" id="l_M000081_source">show</a>
421
-
422
- | <a href="http://github.com/sunaku/rumai/blob/947d8ffb1e3c2bd1aebfca5fae4e7ebb7913607f/lib/rumai/ixp/transport.rb#L320" target="_blank" class="github_url">on GitHub</a>
423
-
424
- </p>
425
- <div id="M000081_source" class="dyn-source">
426
- <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 320</span>
427
- <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">content</span>
428
- <span class="ruby-identifier">raise</span> <span class="ruby-value str">'cannot write to a closed stream'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@closed</span>
429
- <span class="ruby-identifier">raise</span> <span class="ruby-value str">'cannot write to a directory'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@stat</span>.<span class="ruby-identifier">directory?</span>
430
-
431
- <span class="ruby-identifier">data</span> = <span class="ruby-identifier">content</span>.<span class="ruby-identifier">to_s</span>
432
- <span class="ruby-identifier">limit</span> = <span class="ruby-identifier">data</span>.<span class="ruby-identifier">length</span> <span class="ruby-operator">+</span> <span class="ruby-ivar">@pos</span>
433
-
434
- <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@pos</span> <span class="ruby-operator">&lt;</span> <span class="ruby-identifier">limit</span>
435
- <span class="ruby-identifier">chunk</span> = <span class="ruby-identifier">data</span>[<span class="ruby-ivar">@pos</span>, <span class="ruby-ivar">@msize</span>]
436
-
437
- <span class="ruby-identifier">req</span> = <span class="ruby-constant">Twrite</span>.<span class="ruby-identifier">new</span>(
438
- <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@fid</span>,
439
- <span class="ruby-identifier">:offset</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@pos</span>,
440
- <span class="ruby-identifier">:count</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">chunk</span>.<span class="ruby-identifier">length</span>,
441
- <span class="ruby-identifier">:data</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">chunk</span>
442
- )
443
- <span class="ruby-identifier">rsp</span> = <span class="ruby-ivar">@agent</span>.<span class="ruby-identifier">talk</span>(<span class="ruby-identifier">req</span>)
444
-
445
- <span class="ruby-ivar">@pos</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">rsp</span>.<span class="ruby-identifier">count</span>
446
- <span class="ruby-keyword kw">end</span>
447
- <span class="ruby-keyword kw">end</span></pre>
448
- </div>
449
- </div>
450
-
451
- </div>
452
-
453
- </div>
454
- </div>
455
- </body>
456
- </html>