rumai 2.0.2 → 2.1.0

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.
Files changed (167) hide show
  1. data/CREDITS +2 -0
  2. data/bin/rumai +20 -8
  3. data/doc/api/classes/IO.html +72 -0
  4. data/doc/api/classes/Integer.html +110 -0
  5. data/doc/api/classes/Object.html +60 -0
  6. data/doc/api/classes/Rumai.html +867 -0
  7. data/doc/api/classes/Rumai/Area.html +836 -0
  8. data/doc/api/classes/Rumai/Chain.html +197 -0
  9. data/doc/api/classes/Rumai/Client.html +865 -0
  10. data/doc/api/classes/Rumai/ClientContainer.html +191 -0
  11. data/doc/api/classes/Rumai/ExportInstanceMethods.html +69 -0
  12. data/doc/api/classes/Rumai/IXP.html +131 -0
  13. data/doc/api/classes/Rumai/IXP/Agent.html +836 -0
  14. data/doc/api/classes/Rumai/IXP/Agent/FidStream.html +456 -0
  15. data/doc/api/classes/Rumai/IXP/Agent/MODES.html +108 -0
  16. data/doc/api/classes/Rumai/IXP/Agent/RangedPool.html +241 -0
  17. data/doc/api/classes/Rumai/IXP/Error.html +67 -0
  18. data/doc/api/classes/Rumai/IXP/Fcall.html +323 -0
  19. data/doc/api/classes/Rumai/IXP/Qid.html +153 -0
  20. data/doc/api/classes/Rumai/IXP/Rattach.html +67 -0
  21. data/doc/api/classes/Rumai/IXP/Rauth.html +67 -0
  22. data/doc/api/classes/Rumai/IXP/Rclunk.html +67 -0
  23. data/doc/api/classes/Rumai/IXP/Rcreate.html +67 -0
  24. data/doc/api/classes/Rumai/IXP/Rerror.html +67 -0
  25. data/doc/api/classes/Rumai/IXP/Rflush.html +67 -0
  26. data/doc/api/classes/Rumai/IXP/Ropen.html +67 -0
  27. data/doc/api/classes/Rumai/IXP/Rread.html +67 -0
  28. data/doc/api/classes/Rumai/IXP/Rremove.html +67 -0
  29. data/doc/api/classes/Rumai/IXP/Rstat.html +67 -0
  30. data/doc/api/classes/Rumai/IXP/Rversion.html +67 -0
  31. data/doc/api/classes/Rumai/IXP/Rwalk.html +67 -0
  32. data/doc/api/classes/Rumai/IXP/Rwrite.html +67 -0
  33. data/doc/api/classes/Rumai/IXP/Rwstat.html +67 -0
  34. data/doc/api/classes/Rumai/IXP/Stat.html +252 -0
  35. data/doc/api/classes/Rumai/IXP/Stream.html +131 -0
  36. data/doc/api/classes/Rumai/IXP/Struct.html +315 -0
  37. data/doc/api/classes/Rumai/IXP/Struct/Field.html +415 -0
  38. data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.html +153 -0
  39. data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.html +104 -0
  40. data/doc/api/classes/Rumai/IXP/Tattach.html +68 -0
  41. data/doc/api/classes/Rumai/IXP/Tauth.html +67 -0
  42. data/doc/api/classes/Rumai/IXP/Tclunk.html +67 -0
  43. data/doc/api/classes/Rumai/IXP/Tcreate.html +68 -0
  44. data/doc/api/classes/Rumai/IXP/Terror.html +110 -0
  45. data/doc/api/classes/Rumai/IXP/Tflush.html +67 -0
  46. data/doc/api/classes/Rumai/IXP/Topen.html +165 -0
  47. data/doc/api/classes/Rumai/IXP/Tread.html +67 -0
  48. data/doc/api/classes/Rumai/IXP/Tremove.html +67 -0
  49. data/doc/api/classes/Rumai/IXP/Tstat.html +67 -0
  50. data/doc/api/classes/Rumai/IXP/Tversion.html +86 -0
  51. data/doc/api/classes/Rumai/IXP/Twalk.html +68 -0
  52. data/doc/api/classes/Rumai/IXP/Twrite.html +68 -0
  53. data/doc/api/classes/Rumai/IXP/Twstat.html +67 -0
  54. data/doc/api/classes/Rumai/Node.html +817 -0
  55. data/doc/api/classes/Rumai/View.html +818 -0
  56. data/doc/api/classes/Rumai/WidgetImpl.html +65 -0
  57. data/doc/api/classes/Rumai/WidgetNode.html +68 -0
  58. data/doc/api/classes/String.html +163 -0
  59. data/doc/api/classes/StringIO.html +72 -0
  60. data/doc/api/classes/Time.html +156 -0
  61. data/doc/api/created.rid +1 -0
  62. data/doc/api/css/main.css +263 -0
  63. data/doc/api/css/panel.css +383 -0
  64. data/doc/api/css/reset.css +53 -0
  65. data/doc/api/files/CREDITS.html +64 -0
  66. data/doc/api/files/LICENSE.html +76 -0
  67. data/doc/api/files/lib/rumai/fs_rb.html +75 -0
  68. data/doc/api/files/lib/rumai/ixp/message_rb.html +91 -0
  69. data/doc/api/files/lib/rumai/ixp/transport_rb.html +75 -0
  70. data/doc/api/files/lib/rumai/ixp_rb.html +69 -0
  71. data/doc/api/files/lib/rumai/wm_rb.html +77 -0
  72. data/doc/api/files/lib/rumai_rb.html +65 -0
  73. data/doc/api/i/arrows.png +0 -0
  74. data/doc/api/i/results_bg.png +0 -0
  75. data/doc/api/i/tree_bg.png +0 -0
  76. data/doc/api/index.html +14 -18
  77. data/doc/api/js/jquery-1.3.2.min.js +19 -0
  78. data/doc/api/js/jquery-effect.js +593 -0
  79. data/doc/api/js/main.js +22 -0
  80. data/doc/api/js/searchdoc.js +605 -0
  81. data/doc/api/panel/index.html +63 -0
  82. data/doc/api/panel/search_index.js +1 -0
  83. data/doc/api/panel/tree.js +1 -0
  84. data/doc/history.erb +41 -16
  85. data/doc/index.erb +14 -11
  86. data/doc/index.xhtml +519 -846
  87. data/doc/intro.erb +33 -32
  88. data/doc/setup.erb +14 -13
  89. data/doc/usage.erb +69 -35
  90. data/lib/rumai.rb +13 -5
  91. data/lib/rumai/fs.rb +71 -27
  92. data/lib/rumai/ixp.rb +4 -0
  93. data/lib/rumai/ixp/message.rb +178 -81
  94. data/lib/rumai/ixp/transport.rb +144 -91
  95. data/lib/rumai/wm.rb +717 -593
  96. data/rakefile +14 -0
  97. data/test/rumai/ixp/message.rb +42 -54
  98. metadata +110 -89
  99. data/Rakefile +0 -8
  100. data/doc/api/IO.html +0 -53
  101. data/doc/api/Integer.html +0 -102
  102. data/doc/api/Object.html +0 -23
  103. data/doc/api/Rumai.html +0 -1218
  104. data/doc/api/Rumai/Area.html +0 -1088
  105. data/doc/api/Rumai/Chain.html +0 -230
  106. data/doc/api/Rumai/Client.html +0 -1264
  107. data/doc/api/Rumai/ClientContainer.html +0 -227
  108. data/doc/api/Rumai/ExportInstMethods.html +0 -115
  109. data/doc/api/Rumai/IXP.html +0 -23
  110. data/doc/api/Rumai/IXP/Agent.html +0 -1222
  111. data/doc/api/Rumai/IXP/Agent/FidStream.html +0 -602
  112. data/doc/api/Rumai/IXP/Agent/RangedPool.html +0 -263
  113. data/doc/api/Rumai/IXP/Error.html +0 -32
  114. data/doc/api/Rumai/IXP/Fcall.html +0 -398
  115. data/doc/api/Rumai/IXP/Qid.html +0 -99
  116. data/doc/api/Rumai/IXP/Rattach.html +0 -71
  117. data/doc/api/Rumai/IXP/Rauth.html +0 -71
  118. data/doc/api/Rumai/IXP/Rclunk.html +0 -71
  119. data/doc/api/Rumai/IXP/Rcreate.html +0 -71
  120. data/doc/api/Rumai/IXP/Rerror.html +0 -71
  121. data/doc/api/Rumai/IXP/Rflush.html +0 -71
  122. data/doc/api/Rumai/IXP/Ropen.html +0 -71
  123. data/doc/api/Rumai/IXP/Rread.html +0 -71
  124. data/doc/api/Rumai/IXP/Rremove.html +0 -71
  125. data/doc/api/Rumai/IXP/Rstat.html +0 -71
  126. data/doc/api/Rumai/IXP/Rversion.html +0 -71
  127. data/doc/api/Rumai/IXP/Rwalk.html +0 -71
  128. data/doc/api/Rumai/IXP/Rwrite.html +0 -71
  129. data/doc/api/Rumai/IXP/Rwstat.html +0 -71
  130. data/doc/api/Rumai/IXP/Stat.html +0 -188
  131. data/doc/api/Rumai/IXP/Stream.html +0 -112
  132. data/doc/api/Rumai/IXP/Struct.html +0 -348
  133. data/doc/api/Rumai/IXP/Struct/ClassField.html +0 -177
  134. data/doc/api/Rumai/IXP/Struct/Field.html +0 -549
  135. data/doc/api/Rumai/IXP/Struct/Field/CounteeField.html +0 -175
  136. data/doc/api/Rumai/IXP/Struct/Field/CounterField.html +0 -95
  137. data/doc/api/Rumai/IXP/Struct/Integer8Field.html +0 -181
  138. data/doc/api/Rumai/IXP/Struct/StringField.html +0 -128
  139. data/doc/api/Rumai/IXP/Tattach.html +0 -71
  140. data/doc/api/Rumai/IXP/Tauth.html +0 -71
  141. data/doc/api/Rumai/IXP/Tclunk.html +0 -71
  142. data/doc/api/Rumai/IXP/Tcreate.html +0 -71
  143. data/doc/api/Rumai/IXP/Terror.html +0 -156
  144. data/doc/api/Rumai/IXP/Tflush.html +0 -71
  145. data/doc/api/Rumai/IXP/Topen.html +0 -113
  146. data/doc/api/Rumai/IXP/Tread.html +0 -71
  147. data/doc/api/Rumai/IXP/Tremove.html +0 -71
  148. data/doc/api/Rumai/IXP/Tstat.html +0 -71
  149. data/doc/api/Rumai/IXP/Tversion.html +0 -83
  150. data/doc/api/Rumai/IXP/Twalk.html +0 -71
  151. data/doc/api/Rumai/IXP/Twrite.html +0 -71
  152. data/doc/api/Rumai/IXP/Twstat.html +0 -71
  153. data/doc/api/Rumai/Node.html +0 -1139
  154. data/doc/api/Rumai/View.html +0 -1280
  155. data/doc/api/Rumai/WidgetImpl.html +0 -196
  156. data/doc/api/Rumai/WidgetNode.html +0 -184
  157. data/doc/api/String.html +0 -180
  158. data/doc/api/StringIO.html +0 -53
  159. data/doc/api/Time.html +0 -175
  160. data/doc/api/all-methods.html +0 -1436
  161. data/doc/api/all-namespaces.html +0 -140
  162. data/doc/api/app.js +0 -18
  163. data/doc/api/jquery.js +0 -11
  164. data/doc/api/readme.html +0 -38
  165. data/doc/api/style.css +0 -68
  166. data/doc/api/syntax_highlight.css +0 -21
  167. data/doc/theory.erb +0 -3
@@ -0,0 +1,191 @@
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::ClientContainer</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">Module</span>
19
+ Rumai::ClientContainer
20
+
21
+ </h1>
22
+ <ul class="files">
23
+
24
+ <li><a href="../../files/lib/rumai/wm_rb.html">lib/rumai/wm.rb</a></li>
25
+
26
+ </ul>
27
+ </div>
28
+ <div id="bodyContent">
29
+ <div id="content">
30
+
31
+ <div class="description">
32
+ <p>
33
+ NOTE: Inheritors should override the &#8216;<a
34
+ href="ClientContainer.html#M000053">client_ids</a>&#8217; method.
35
+ </p>
36
+
37
+ </div>
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+ <div class="sectiontitle">Methods</div>
48
+ <dl class="methods">
49
+
50
+ <dt>C</dt>
51
+ <dd>
52
+ <ul>
53
+
54
+ <li><a href="#M000053">client_ids</a>,</li>
55
+
56
+ <li><a href="#M000054">clients</a></li>
57
+
58
+ </ul>
59
+ </dd>
60
+
61
+ <dt>G</dt>
62
+ <dd>
63
+ <ul>
64
+
65
+ <li><a href="#M000056">grouping</a></li>
66
+
67
+ </ul>
68
+ </dd>
69
+
70
+ </dl>
71
+
72
+
73
+
74
+
75
+
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+ <div class="sectiontitle">Instance Public methods</div>
85
+
86
+ <div class="method">
87
+ <div class="title" id="M000053">
88
+
89
+ <a name="M000053"></a><b>client_ids</b>()
90
+
91
+ </div>
92
+
93
+ <div class="description">
94
+ <p>
95
+ Returns the IDs of the clients in this container.
96
+ </p>
97
+
98
+ </div>
99
+
100
+
101
+
102
+
103
+ <div class="sourcecode">
104
+ <p class="source-link">
105
+ Source: <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show</a>
106
+
107
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/wm.rb#L356" target="_blank" class="github_url">on GitHub</a>
108
+
109
+ </p>
110
+ <div id="M000053_source" class="dyn-source">
111
+ <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 356</span>
112
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">client_ids</span>
113
+ []
114
+ <span class="ruby-keyword kw">end</span></pre>
115
+ </div>
116
+ </div>
117
+
118
+ </div>
119
+
120
+ <div class="method">
121
+ <div class="title" id="M000054">
122
+
123
+ <a name="M000054"></a><b>clients</b>()
124
+
125
+ </div>
126
+
127
+ <div class="description">
128
+ <p>
129
+ Returns the clients contained in this container.
130
+ </p>
131
+
132
+ </div>
133
+
134
+
135
+
136
+
137
+ <div class="sourcecode">
138
+ <p class="source-link">
139
+ Source: <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show</a>
140
+
141
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/wm.rb#L363" target="_blank" class="github_url">on GitHub</a>
142
+
143
+ </p>
144
+ <div id="M000054_source" class="dyn-source">
145
+ <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 363</span>
146
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clients</span>
147
+ <span class="ruby-identifier">client_ids</span>.<span class="ruby-identifier">map!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">i</span><span class="ruby-operator">|</span> <span class="ruby-constant">Client</span>.<span class="ruby-identifier">new</span> <span class="ruby-identifier">i</span> }
148
+ <span class="ruby-keyword kw">end</span></pre>
149
+ </div>
150
+ </div>
151
+
152
+ </div>
153
+
154
+ <div class="method">
155
+ <div class="title" id="M000056">
156
+
157
+ <a name="M000056"></a><b>grouping</b>()
158
+
159
+ </div>
160
+
161
+ <div class="description">
162
+ <p>
163
+ Returns all grouped clients in this container.
164
+ </p>
165
+
166
+ </div>
167
+
168
+
169
+
170
+
171
+ <div class="sourcecode">
172
+ <p class="source-link">
173
+ Source: <a href="javascript:toggleSource('M000056_source')" id="l_M000056_source">show</a>
174
+
175
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/wm.rb#L379" target="_blank" class="github_url">on GitHub</a>
176
+
177
+ </p>
178
+ <div id="M000056_source" class="dyn-source">
179
+ <pre><span class="ruby-comment cmt"># File lib/rumai/wm.rb, line 379</span>
180
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">grouping</span>
181
+ <span class="ruby-identifier">clients</span>.<span class="ruby-identifier">select</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">c</span><span class="ruby-operator">|</span> <span class="ruby-identifier">c</span>.<span class="ruby-identifier">group?</span> }
182
+ <span class="ruby-keyword kw">end</span></pre>
183
+ </div>
184
+ </div>
185
+
186
+ </div>
187
+
188
+ </div>
189
+ </div>
190
+ </body>
191
+ </html>
@@ -0,0 +1,69 @@
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::ExportInstanceMethods</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">Module</span>
19
+ Rumai::ExportInstanceMethods
20
+
21
+ </h1>
22
+ <ul class="files">
23
+
24
+ <li><a href="../../files/lib/rumai/fs_rb.html">lib/rumai/fs.rb</a></li>
25
+
26
+ </ul>
27
+ </div>
28
+ <div id="bodyContent">
29
+ <div id="content">
30
+
31
+ <div class="description">
32
+ <p>
33
+ Makes instance methods accessible through class methods. This is done to
34
+ emulate the File class:
35
+ </p>
36
+ <pre>
37
+ File.exist? &quot;foo&quot;
38
+ File.new(&quot;foo&quot;).exist?
39
+ </pre>
40
+ <p>
41
+ Both of the above expressions are equivalent.
42
+ </p>
43
+
44
+ </div>
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+
66
+ </div>
67
+ </div>
68
+ </body>
69
+ </html>
@@ -0,0 +1,131 @@
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</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">Module</span>
19
+ Rumai::IXP
20
+
21
+ </h1>
22
+ <ul class="files">
23
+
24
+ <li><a href="../../files/lib/rumai/ixp/transport_rb.html">lib/rumai/ixp/transport.rb</a></li>
25
+
26
+ <li><a href="../../files/lib/rumai/ixp/message_rb.html">lib/rumai/ixp/message.rb</a></li>
27
+
28
+ </ul>
29
+ </div>
30
+ <div id="bodyContent">
31
+ <div id="content">
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
42
+
43
+
44
+
45
+
46
+
47
+ <div class="sectiontitle">Classes and Modules</div>
48
+ <ul>
49
+
50
+ <li><span class="type">MODULE</span> <a href="IXP/Stream.html">Rumai::IXP::Stream</a></li>
51
+
52
+ <li><span class="type">MODULE</span> <a href="IXP/Struct.html">Rumai::IXP::Struct</a></li>
53
+
54
+ <li><span class="type">CLASS</span> <a href="IXP/Agent.html">Rumai::IXP::Agent</a></li>
55
+
56
+ <li><span class="type">CLASS</span> <a href="IXP/Error.html">Rumai::IXP::Error</a></li>
57
+
58
+ <li><span class="type">CLASS</span> <a href="IXP/Fcall.html">Rumai::IXP::Fcall</a></li>
59
+
60
+ <li><span class="type">CLASS</span> <a href="IXP/Qid.html">Rumai::IXP::Qid</a></li>
61
+
62
+ <li><span class="type">CLASS</span> <a href="IXP/Rattach.html">Rumai::IXP::Rattach</a></li>
63
+
64
+ <li><span class="type">CLASS</span> <a href="IXP/Rauth.html">Rumai::IXP::Rauth</a></li>
65
+
66
+ <li><span class="type">CLASS</span> <a href="IXP/Rclunk.html">Rumai::IXP::Rclunk</a></li>
67
+
68
+ <li><span class="type">CLASS</span> <a href="IXP/Rcreate.html">Rumai::IXP::Rcreate</a></li>
69
+
70
+ <li><span class="type">CLASS</span> <a href="IXP/Rerror.html">Rumai::IXP::Rerror</a></li>
71
+
72
+ <li><span class="type">CLASS</span> <a href="IXP/Rflush.html">Rumai::IXP::Rflush</a></li>
73
+
74
+ <li><span class="type">CLASS</span> <a href="IXP/Ropen.html">Rumai::IXP::Ropen</a></li>
75
+
76
+ <li><span class="type">CLASS</span> <a href="IXP/Rread.html">Rumai::IXP::Rread</a></li>
77
+
78
+ <li><span class="type">CLASS</span> <a href="IXP/Rremove.html">Rumai::IXP::Rremove</a></li>
79
+
80
+ <li><span class="type">CLASS</span> <a href="IXP/Rstat.html">Rumai::IXP::Rstat</a></li>
81
+
82
+ <li><span class="type">CLASS</span> <a href="IXP/Rversion.html">Rumai::IXP::Rversion</a></li>
83
+
84
+ <li><span class="type">CLASS</span> <a href="IXP/Rwalk.html">Rumai::IXP::Rwalk</a></li>
85
+
86
+ <li><span class="type">CLASS</span> <a href="IXP/Rwrite.html">Rumai::IXP::Rwrite</a></li>
87
+
88
+ <li><span class="type">CLASS</span> <a href="IXP/Rwstat.html">Rumai::IXP::Rwstat</a></li>
89
+
90
+ <li><span class="type">CLASS</span> <a href="IXP/Stat.html">Rumai::IXP::Stat</a></li>
91
+
92
+ <li><span class="type">CLASS</span> <a href="IXP/Tattach.html">Rumai::IXP::Tattach</a></li>
93
+
94
+ <li><span class="type">CLASS</span> <a href="IXP/Tauth.html">Rumai::IXP::Tauth</a></li>
95
+
96
+ <li><span class="type">CLASS</span> <a href="IXP/Tclunk.html">Rumai::IXP::Tclunk</a></li>
97
+
98
+ <li><span class="type">CLASS</span> <a href="IXP/Tcreate.html">Rumai::IXP::Tcreate</a></li>
99
+
100
+ <li><span class="type">CLASS</span> <a href="IXP/Terror.html">Rumai::IXP::Terror</a></li>
101
+
102
+ <li><span class="type">CLASS</span> <a href="IXP/Tflush.html">Rumai::IXP::Tflush</a></li>
103
+
104
+ <li><span class="type">CLASS</span> <a href="IXP/Topen.html">Rumai::IXP::Topen</a></li>
105
+
106
+ <li><span class="type">CLASS</span> <a href="IXP/Tread.html">Rumai::IXP::Tread</a></li>
107
+
108
+ <li><span class="type">CLASS</span> <a href="IXP/Tremove.html">Rumai::IXP::Tremove</a></li>
109
+
110
+ <li><span class="type">CLASS</span> <a href="IXP/Tstat.html">Rumai::IXP::Tstat</a></li>
111
+
112
+ <li><span class="type">CLASS</span> <a href="IXP/Tversion.html">Rumai::IXP::Tversion</a></li>
113
+
114
+ <li><span class="type">CLASS</span> <a href="IXP/Twalk.html">Rumai::IXP::Twalk</a></li>
115
+
116
+ <li><span class="type">CLASS</span> <a href="IXP/Twrite.html">Rumai::IXP::Twrite</a></li>
117
+
118
+ <li><span class="type">CLASS</span> <a href="IXP/Twstat.html">Rumai::IXP::Twstat</a></li>
119
+
120
+ </ul>
121
+
122
+
123
+
124
+
125
+
126
+
127
+
128
+ </div>
129
+ </div>
130
+ </body>
131
+ </html>
@@ -0,0 +1,836 @@
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</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
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
+ A thread-safe proxy that multiplexes many threads onto a single 9P2000
40
+ connection.
41
+ </p>
42
+
43
+ </div>
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+
53
+ <div class="sectiontitle">Methods</div>
54
+ <dl class="methods">
55
+
56
+ <dt>A</dt>
57
+ <dd>
58
+ <ul>
59
+
60
+ <li><a href="#M000108">attach</a></li>
61
+
62
+ </ul>
63
+ </dd>
64
+
65
+ <dt>C</dt>
66
+ <dd>
67
+ <ul>
68
+
69
+ <li><a href="#M000110">clunk</a>,</li>
70
+
71
+ <li><a href="#M000091">create</a></li>
72
+
73
+ </ul>
74
+ </dd>
75
+
76
+ <dt>E</dt>
77
+ <dd>
78
+ <ul>
79
+
80
+ <li><a href="#M000086">entries</a></li>
81
+
82
+ </ul>
83
+ </dd>
84
+
85
+ <dt>N</dt>
86
+ <dd>
87
+ <ul>
88
+
89
+ <li><a href="#M000038">new</a></li>
90
+
91
+ </ul>
92
+ </dd>
93
+
94
+ <dt>O</dt>
95
+ <dd>
96
+ <ul>
97
+
98
+ <li><a href="#M000062">open</a></li>
99
+
100
+ </ul>
101
+ </dd>
102
+
103
+ <dt>R</dt>
104
+ <dd>
105
+ <ul>
106
+
107
+ <li><a href="#M000085">read</a>,</li>
108
+
109
+ <li><a href="#M000097">remove</a>,</li>
110
+
111
+ <li><a href="#M000098">remove_fid</a></li>
112
+
113
+ </ul>
114
+ </dd>
115
+
116
+ <dt>S</dt>
117
+ <dd>
118
+ <ul>
119
+
120
+ <li><a href="#M000100">stat</a>,</li>
121
+
122
+ <li><a href="#M000103">stat_fid</a></li>
123
+
124
+ </ul>
125
+ </dd>
126
+
127
+ <dt>T</dt>
128
+ <dd>
129
+ <ul>
130
+
131
+ <li><a href="#M000055">talk</a></li>
132
+
133
+ </ul>
134
+ </dd>
135
+
136
+ <dt>W</dt>
137
+ <dd>
138
+ <ul>
139
+
140
+ <li><a href="#M000104">walk</a>,</li>
141
+
142
+ <li><a href="#M000107">walk_fid</a>,</li>
143
+
144
+ <li><a href="#M000089">write</a></li>
145
+
146
+ </ul>
147
+ </dd>
148
+
149
+ </dl>
150
+
151
+
152
+
153
+
154
+
155
+
156
+
157
+ <div class="sectiontitle">Classes and Modules</div>
158
+ <ul>
159
+
160
+ <li><span class="type">MODULE</span> <a href="Agent/MODES.html">Rumai::IXP::Agent::MODES</a></li>
161
+
162
+ <li><span class="type">CLASS</span> <a href="Agent/FidStream.html">Rumai::IXP::Agent::FidStream</a></li>
163
+
164
+ <li><span class="type">CLASS</span> <a href="Agent/RangedPool.html">Rumai::IXP::Agent::RangedPool</a></li>
165
+
166
+ </ul>
167
+
168
+
169
+
170
+ <div class="sectiontitle">Constants</div>
171
+ <table border='0' cellpadding='5'>
172
+
173
+ <tr valign='top'>
174
+ <td class="attr-name">MODES</td>
175
+ <td>=</td>
176
+ <td class="attr-value">{ 'r' =&gt; Topen::OREAD, 'w' =&gt; Topen::OWRITE, 't' =&gt; Topen::ORCLOSE, '+' =&gt; Topen::ORDWR, }</td>
177
+ </tr>
178
+
179
+
180
+ </table>
181
+
182
+
183
+
184
+ <div class="sectiontitle">Attributes</div>
185
+ <table border='0' cellpadding='5'>
186
+
187
+ <tr valign='top'>
188
+ <td class='attr-rw'>
189
+ [R]
190
+ </td>
191
+ <td class='attr-name'>msize</td>
192
+ <td class='attr-desc'></td>
193
+ </tr>
194
+
195
+ </table>
196
+
197
+
198
+
199
+ <div class="sectiontitle">Class Public methods</div>
200
+
201
+ <div class="method">
202
+ <div class="title" id="M000038">
203
+
204
+ <a name="M000038"></a><b>new</b>(stream)
205
+
206
+ </div>
207
+
208
+
209
+
210
+
211
+ <div class="sourcecode">
212
+ <p class="source-link">
213
+ Source: <a href="javascript:toggleSource('M000038_source')" id="l_M000038_source">show</a>
214
+
215
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L19" target="_blank" class="github_url">on GitHub</a>
216
+
217
+ </p>
218
+ <div id="M000038_source" class="dyn-source">
219
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 19</span>
220
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span> <span class="ruby-identifier">stream</span>
221
+ <span class="ruby-ivar">@stream</span> = <span class="ruby-identifier">stream</span>
222
+ <span class="ruby-ivar">@send_lock</span> = <span class="ruby-constant">Mutex</span>.<span class="ruby-identifier">new</span>
223
+ <span class="ruby-ivar">@recv_bays</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">h</span>,<span class="ruby-identifier">k</span><span class="ruby-operator">|</span> <span class="ruby-identifier">h</span>[<span class="ruby-identifier">k</span>] = <span class="ruby-constant">Queue</span>.<span class="ruby-identifier">new</span> } <span class="ruby-comment cmt"># tag =&gt; Queue(message)</span>
224
+
225
+ <span class="ruby-comment cmt"># background thread which continuously receives</span>
226
+ <span class="ruby-comment cmt"># and dispatches messages from the 9P2000 server</span>
227
+ <span class="ruby-constant">Thread</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span>
228
+ <span class="ruby-keyword kw">while</span> <span class="ruby-keyword kw">true</span>
229
+ <span class="ruby-identifier">msg</span> = <span class="ruby-constant">Fcall</span>.<span class="ruby-identifier">from_9p</span> <span class="ruby-ivar">@stream</span>
230
+ <span class="ruby-ivar">@recv_bays</span>[<span class="ruby-identifier">msg</span>.<span class="ruby-identifier">tag</span>] <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">msg</span>
231
+ <span class="ruby-keyword kw">end</span>
232
+ <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">priority</span> = <span class="ruby-value">-1</span>
233
+
234
+ <span class="ruby-ivar">@tag_pool</span> = <span class="ruby-constant">RangedPool</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-constant">BYTE2_MASK</span>)
235
+ <span class="ruby-ivar">@fid_pool</span> = <span class="ruby-constant">RangedPool</span>.<span class="ruby-identifier">new</span>(<span class="ruby-value">0</span><span class="ruby-operator">...</span><span class="ruby-constant">BYTE4_MASK</span>)
236
+
237
+ <span class="ruby-comment cmt"># establish connection with 9P2000 server</span>
238
+ <span class="ruby-identifier">req</span> = <span class="ruby-constant">Tversion</span>.<span class="ruby-identifier">new</span>(
239
+ <span class="ruby-identifier">:tag</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Fcall</span><span class="ruby-operator">::</span><span class="ruby-constant">NOTAG</span>,
240
+ <span class="ruby-identifier">:msize</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Tversion</span><span class="ruby-operator">::</span><span class="ruby-constant">MSIZE</span>,
241
+ <span class="ruby-identifier">:version</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">Tversion</span><span class="ruby-operator">::</span><span class="ruby-constant">VERSION</span>
242
+ )
243
+ <span class="ruby-identifier">rsp</span> = <span class="ruby-identifier">talk</span>(<span class="ruby-identifier">req</span>)
244
+
245
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">req</span>.<span class="ruby-identifier">version</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">rsp</span>.<span class="ruby-identifier">version</span>
246
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;protocol mismatch: self=#{req.version.inspect} server=#{rsp.version.inspect}&quot;</span>
247
+ <span class="ruby-keyword kw">end</span>
248
+
249
+ <span class="ruby-ivar">@msize</span> = <span class="ruby-identifier">rsp</span>.<span class="ruby-identifier">msize</span>
250
+
251
+ <span class="ruby-comment cmt"># authenticate the connection (not necessary for wmii)</span>
252
+ <span class="ruby-ivar">@auth_fid</span> = <span class="ruby-constant">Fcall</span><span class="ruby-operator">::</span><span class="ruby-constant">NOFID</span>
253
+
254
+ <span class="ruby-comment cmt"># attach to filesystem root</span>
255
+ <span class="ruby-ivar">@root_fid</span> = <span class="ruby-ivar">@fid_pool</span>.<span class="ruby-identifier">obtain</span>
256
+ <span class="ruby-identifier">attach</span> <span class="ruby-ivar">@root_fid</span>, <span class="ruby-ivar">@auth_fid</span>
257
+ <span class="ruby-keyword kw">end</span></pre>
258
+ </div>
259
+ </div>
260
+
261
+ </div>
262
+
263
+ <div class="sectiontitle">Instance Public methods</div>
264
+
265
+ <div class="method">
266
+ <div class="title" id="M000108">
267
+
268
+ <a name="M000108"></a><b>attach</b>(root_fid, auth_fid = Fcall::NOFID, auth_name = ENV['USER'])
269
+
270
+ </div>
271
+
272
+ <div class="description">
273
+ <p>
274
+ Associates the given FID with the FS root.
275
+ </p>
276
+
277
+ </div>
278
+
279
+
280
+
281
+
282
+ <div class="sourcecode">
283
+ <p class="source-link">
284
+ Source: <a href="javascript:toggleSource('M000108_source')" id="l_M000108_source">show</a>
285
+
286
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L413" target="_blank" class="github_url">on GitHub</a>
287
+
288
+ </p>
289
+ <div id="M000108_source" class="dyn-source">
290
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 413</span>
291
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">attach</span> <span class="ruby-identifier">root_fid</span>, <span class="ruby-identifier">auth_fid</span> = <span class="ruby-constant">Fcall</span><span class="ruby-operator">::</span><span class="ruby-constant">NOFID</span>, <span class="ruby-identifier">auth_name</span> = <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'USER'</span>]
292
+ <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tattach</span>.<span class="ruby-identifier">new</span>(
293
+ <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">root_fid</span>,
294
+ <span class="ruby-identifier">:afid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">auth_fid</span>,
295
+ <span class="ruby-identifier">:uname</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-constant">ENV</span>[<span class="ruby-value str">'USER'</span>],
296
+ <span class="ruby-identifier">:aname</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">auth_name</span>
297
+ )
298
+ <span class="ruby-keyword kw">end</span></pre>
299
+ </div>
300
+ </div>
301
+
302
+ </div>
303
+
304
+ <div class="method">
305
+ <div class="title" id="M000110">
306
+
307
+ <a name="M000110"></a><b>clunk</b>(fid)
308
+
309
+ </div>
310
+
311
+ <div class="description">
312
+ <p>
313
+ Retires the given FID from use.
314
+ </p>
315
+
316
+ </div>
317
+
318
+
319
+
320
+
321
+ <div class="sourcecode">
322
+ <p class="source-link">
323
+ Source: <a href="javascript:toggleSource('M000110_source')" id="l_M000110_source">show</a>
324
+
325
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L425" target="_blank" class="github_url">on GitHub</a>
326
+
327
+ </p>
328
+ <div id="M000110_source" class="dyn-source">
329
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 425</span>
330
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">clunk</span> <span class="ruby-identifier">fid</span>
331
+ <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tclunk</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">fid</span>)
332
+ <span class="ruby-ivar">@fid_pool</span>.<span class="ruby-identifier">release</span> <span class="ruby-identifier">fid</span>
333
+ <span class="ruby-keyword kw">end</span></pre>
334
+ </div>
335
+ </div>
336
+
337
+ </div>
338
+
339
+ <div class="method">
340
+ <div class="title" id="M000091">
341
+
342
+ <a name="M000091"></a><b>create</b>(path, mode = 'rw', perm = 0644)
343
+
344
+ </div>
345
+
346
+ <div class="description">
347
+ <p>
348
+ Creates a new file at the given path that is accessible using the given
349
+ modes for a user having the given permission bits.
350
+ </p>
351
+
352
+ </div>
353
+
354
+
355
+
356
+
357
+ <div class="sourcecode">
358
+ <p class="source-link">
359
+ Source: <a href="javascript:toggleSource('M000091_source')" id="l_M000091_source">show</a>
360
+
361
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L336" target="_blank" class="github_url">on GitHub</a>
362
+
363
+ </p>
364
+ <div id="M000091_source" class="dyn-source">
365
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 336</span>
366
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">create</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-value str">'rw'</span>, <span class="ruby-identifier">perm</span> = <span class="ruby-value">0644</span>
367
+ <span class="ruby-identifier">prefix</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">dirname</span>(<span class="ruby-identifier">path</span>)
368
+ <span class="ruby-identifier">target</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">path</span>)
369
+
370
+ <span class="ruby-identifier">mode</span> = <span class="ruby-constant">MODES</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">mode</span>)
371
+
372
+ <span class="ruby-identifier">with_fid</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">prefix_fid</span><span class="ruby-operator">|</span>
373
+ <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">prefix_fid</span>, <span class="ruby-identifier">prefix</span>
374
+
375
+ <span class="ruby-comment cmt"># create the file</span>
376
+ <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tcreate</span>.<span class="ruby-identifier">new</span>(
377
+ <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">prefix_fid</span>,
378
+ <span class="ruby-identifier">:name</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">target</span>,
379
+ <span class="ruby-identifier">:perm</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">perm</span>,
380
+ <span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mode</span>
381
+ )
382
+ <span class="ruby-keyword kw">end</span>
383
+ <span class="ruby-keyword kw">end</span></pre>
384
+ </div>
385
+ </div>
386
+
387
+ </div>
388
+
389
+ <div class="method">
390
+ <div class="title" id="M000086">
391
+
392
+ <a name="M000086"></a><b>entries</b>(path)
393
+
394
+ </div>
395
+
396
+ <div class="description">
397
+ <p>
398
+ Returns the names of all files inside the directory whose path is given.
399
+ </p>
400
+
401
+ </div>
402
+
403
+
404
+
405
+
406
+ <div class="sourcecode">
407
+ <p class="source-link">
408
+ Source: <a href="javascript:toggleSource('M000086_source')" id="l_M000086_source">show</a>
409
+
410
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L315" target="_blank" class="github_url">on GitHub</a>
411
+
412
+ </p>
413
+ <div id="M000086_source" class="dyn-source">
414
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 315</span>
415
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">entries</span> <span class="ruby-identifier">path</span>
416
+ <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">stat</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">directory?</span>
417
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span>, <span class="ruby-node">&quot;#{path.inspect} is not a directory&quot;</span>
418
+ <span class="ruby-keyword kw">end</span>
419
+
420
+ <span class="ruby-identifier">read</span>(<span class="ruby-identifier">path</span>).<span class="ruby-identifier">map!</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">t</span><span class="ruby-operator">|</span> <span class="ruby-identifier">t</span>.<span class="ruby-identifier">name</span>}
421
+ <span class="ruby-keyword kw">end</span></pre>
422
+ </div>
423
+ </div>
424
+
425
+ </div>
426
+
427
+ <div class="method">
428
+ <div class="title" id="M000062">
429
+
430
+ <a name="M000062"></a><b>open</b>(path, mode = 'r')
431
+
432
+ </div>
433
+
434
+ <div class="description">
435
+ <p>
436
+ Opens the given path for I/O access through a <a
437
+ href="Agent/FidStream.html">FidStream</a> object. If a block is given, it
438
+ is invoked with a <a href="Agent/FidStream.html">FidStream</a> object and
439
+ the stream is closed afterwards.
440
+ </p>
441
+ <p>
442
+ See File::open in the Ruby documentation.
443
+ </p>
444
+
445
+ </div>
446
+
447
+
448
+
449
+
450
+ <div class="sourcecode">
451
+ <p class="source-link">
452
+ Source: <a href="javascript:toggleSource('M000062_source')" id="l_M000062_source">show</a>
453
+
454
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L157" target="_blank" class="github_url">on GitHub</a>
455
+
456
+ </p>
457
+ <div id="M000062_source" class="dyn-source">
458
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 157</span>
459
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">mode</span> = <span class="ruby-value str">'r'</span> <span class="ruby-comment cmt"># :yields: FidStream</span>
460
+ <span class="ruby-identifier">mode</span> = <span class="ruby-constant">MODES</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-identifier">mode</span>)
461
+
462
+ <span class="ruby-comment cmt"># open the file</span>
463
+ <span class="ruby-identifier">path_fid</span> = <span class="ruby-identifier">walk</span>(<span class="ruby-identifier">path</span>)
464
+
465
+ <span class="ruby-identifier">talk</span> <span class="ruby-constant">Topen</span>.<span class="ruby-identifier">new</span>(
466
+ <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_fid</span>,
467
+ <span class="ruby-identifier">:mode</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">mode</span>
468
+ )
469
+
470
+ <span class="ruby-identifier">stream</span> = <span class="ruby-constant">FidStream</span>.<span class="ruby-identifier">new</span>(<span class="ruby-keyword kw">self</span>, <span class="ruby-identifier">path_fid</span>, <span class="ruby-ivar">@msize</span>)
471
+
472
+ <span class="ruby-comment cmt"># return the file stream</span>
473
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">block_given?</span>
474
+ <span class="ruby-keyword kw">begin</span>
475
+ <span class="ruby-keyword kw">yield</span> <span class="ruby-identifier">stream</span>
476
+ <span class="ruby-keyword kw">ensure</span>
477
+ <span class="ruby-identifier">stream</span>.<span class="ruby-identifier">close</span>
478
+ <span class="ruby-keyword kw">end</span>
479
+ <span class="ruby-keyword kw">else</span>
480
+ <span class="ruby-identifier">stream</span>
481
+ <span class="ruby-keyword kw">end</span>
482
+ <span class="ruby-keyword kw">end</span></pre>
483
+ </div>
484
+ </div>
485
+
486
+ </div>
487
+
488
+ <div class="method">
489
+ <div class="title" id="M000085">
490
+
491
+ <a name="M000085"></a><b>read</b>(path, *args)
492
+
493
+ </div>
494
+
495
+ <div class="description">
496
+ <p>
497
+ Returns the content of the file/directory at the given path.
498
+ </p>
499
+
500
+ </div>
501
+
502
+
503
+
504
+
505
+ <div class="sourcecode">
506
+ <p class="source-link">
507
+ Source: <a href="javascript:toggleSource('M000085_source')" id="l_M000085_source">show</a>
508
+
509
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L306" target="_blank" class="github_url">on GitHub</a>
510
+
511
+ </p>
512
+ <div id="M000085_source" class="dyn-source">
513
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 306</span>
514
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span> <span class="ruby-identifier">path</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>
515
+ <span class="ruby-identifier">open</span> <span class="ruby-identifier">path</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
516
+ <span class="ruby-identifier">f</span>.<span class="ruby-identifier">read</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)
517
+ <span class="ruby-keyword kw">end</span>
518
+ <span class="ruby-keyword kw">end</span></pre>
519
+ </div>
520
+ </div>
521
+
522
+ </div>
523
+
524
+ <div class="method">
525
+ <div class="title" id="M000097">
526
+
527
+ <a name="M000097"></a><b>remove</b>(path)
528
+
529
+ </div>
530
+
531
+ <div class="description">
532
+ <p>
533
+ Deletes the file at the given path.
534
+ </p>
535
+
536
+ </div>
537
+
538
+
539
+
540
+
541
+ <div class="sourcecode">
542
+ <p class="source-link">
543
+ Source: <a href="javascript:toggleSource('M000097_source')" id="l_M000097_source">show</a>
544
+
545
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L358" target="_blank" class="github_url">on GitHub</a>
546
+
547
+ </p>
548
+ <div id="M000097_source" class="dyn-source">
549
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 358</span>
550
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span> <span class="ruby-identifier">path</span>
551
+ <span class="ruby-identifier">path_fid</span> = <span class="ruby-identifier">walk</span>(<span class="ruby-identifier">path</span>)
552
+ <span class="ruby-identifier">remove_fid</span> <span class="ruby-identifier">path_fid</span> <span class="ruby-comment cmt"># remove also does clunk</span>
553
+ <span class="ruby-keyword kw">end</span></pre>
554
+ </div>
555
+ </div>
556
+
557
+ </div>
558
+
559
+ <div class="method">
560
+ <div class="title" id="M000098">
561
+
562
+ <a name="M000098"></a><b>remove_fid</b>(path_fid)
563
+
564
+ </div>
565
+
566
+ <div class="description">
567
+ <p>
568
+ Deletes the file corresponding to the given FID and clunks the given FID.
569
+ </p>
570
+
571
+ </div>
572
+
573
+
574
+
575
+
576
+ <div class="sourcecode">
577
+ <p class="source-link">
578
+ Source: <a href="javascript:toggleSource('M000098_source')" id="l_M000098_source">show</a>
579
+
580
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L367" target="_blank" class="github_url">on GitHub</a>
581
+
582
+ </p>
583
+ <div id="M000098_source" class="dyn-source">
584
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 367</span>
585
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove_fid</span> <span class="ruby-identifier">path_fid</span>
586
+ <span class="ruby-identifier">talk</span> <span class="ruby-constant">Tremove</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_fid</span>)
587
+ <span class="ruby-keyword kw">end</span></pre>
588
+ </div>
589
+ </div>
590
+
591
+ </div>
592
+
593
+ <div class="method">
594
+ <div class="title" id="M000100">
595
+
596
+ <a name="M000100"></a><b>stat</b>(path)
597
+
598
+ </div>
599
+
600
+ <div class="description">
601
+ <p>
602
+ Returns information about the file at the given path.
603
+ </p>
604
+
605
+ </div>
606
+
607
+
608
+
609
+
610
+ <div class="sourcecode">
611
+ <p class="source-link">
612
+ Source: <a href="javascript:toggleSource('M000100_source')" id="l_M000100_source">show</a>
613
+
614
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L374" target="_blank" class="github_url">on GitHub</a>
615
+
616
+ </p>
617
+ <div id="M000100_source" class="dyn-source">
618
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 374</span>
619
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stat</span> <span class="ruby-identifier">path</span>
620
+ <span class="ruby-identifier">with_fid</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">path_fid</span><span class="ruby-operator">|</span>
621
+ <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">path_fid</span>, <span class="ruby-identifier">path</span>
622
+ <span class="ruby-identifier">stat_fid</span> <span class="ruby-identifier">path_fid</span>
623
+ <span class="ruby-keyword kw">end</span>
624
+ <span class="ruby-keyword kw">end</span></pre>
625
+ </div>
626
+ </div>
627
+
628
+ </div>
629
+
630
+ <div class="method">
631
+ <div class="title" id="M000103">
632
+
633
+ <a name="M000103"></a><b>stat_fid</b>(path_fid)
634
+
635
+ </div>
636
+
637
+ <div class="description">
638
+ <p>
639
+ Returns information about the file referenced by the given FID.
640
+ </p>
641
+
642
+ </div>
643
+
644
+
645
+
646
+
647
+ <div class="sourcecode">
648
+ <p class="source-link">
649
+ Source: <a href="javascript:toggleSource('M000103_source')" id="l_M000103_source">show</a>
650
+
651
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L384" target="_blank" class="github_url">on GitHub</a>
652
+
653
+ </p>
654
+ <div id="M000103_source" class="dyn-source">
655
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 384</span>
656
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">stat_fid</span> <span class="ruby-identifier">path_fid</span>
657
+ <span class="ruby-identifier">req</span> = <span class="ruby-constant">Tstat</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_fid</span>)
658
+ <span class="ruby-identifier">rsp</span> = <span class="ruby-identifier">talk</span>(<span class="ruby-identifier">req</span>)
659
+ <span class="ruby-identifier">rsp</span>.<span class="ruby-identifier">stat</span>
660
+ <span class="ruby-keyword kw">end</span></pre>
661
+ </div>
662
+ </div>
663
+
664
+ </div>
665
+
666
+ <div class="method">
667
+ <div class="title" id="M000055">
668
+
669
+ <a name="M000055"></a><b>talk</b>(request)
670
+
671
+ </div>
672
+
673
+ <div class="description">
674
+ <p>
675
+ Sends the given message (<a href="Fcall.html">Rumai::IXP::Fcall</a>) and
676
+ returns its response.
677
+ </p>
678
+ <p>
679
+ This method allows you to perform a 9P2000 transaction without worrying
680
+ about the details of tag collisions and thread safety.
681
+ </p>
682
+
683
+ </div>
684
+
685
+
686
+
687
+
688
+ <div class="sourcecode">
689
+ <p class="source-link">
690
+ Source: <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show</a>
691
+
692
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L110" target="_blank" class="github_url">on GitHub</a>
693
+
694
+ </p>
695
+ <div id="M000055_source" class="dyn-source">
696
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 110</span>
697
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">talk</span> <span class="ruby-identifier">request</span>
698
+ <span class="ruby-comment cmt"># send the request</span>
699
+ <span class="ruby-identifier">tag</span> = <span class="ruby-ivar">@tag_pool</span>.<span class="ruby-identifier">obtain</span>
700
+ <span class="ruby-identifier">bay</span> = <span class="ruby-ivar">@recv_bays</span>[<span class="ruby-identifier">tag</span>]
701
+
702
+ <span class="ruby-identifier">request</span>.<span class="ruby-identifier">tag</span> = <span class="ruby-identifier">tag</span>
703
+ <span class="ruby-identifier">output</span> = <span class="ruby-identifier">request</span>.<span class="ruby-identifier">to_9p</span>
704
+ <span class="ruby-ivar">@send_lock</span>.<span class="ruby-identifier">synchronize</span> <span class="ruby-keyword kw">do</span>
705
+ <span class="ruby-ivar">@stream</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">output</span>
706
+ <span class="ruby-keyword kw">end</span>
707
+
708
+ <span class="ruby-comment cmt"># receive the response</span>
709
+ <span class="ruby-identifier">response</span> = <span class="ruby-identifier">bay</span>.<span class="ruby-identifier">shift</span>
710
+ <span class="ruby-ivar">@tag_pool</span>.<span class="ruby-identifier">release</span> <span class="ruby-identifier">tag</span>
711
+
712
+ <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">response</span>.<span class="ruby-identifier">is_a?</span> <span class="ruby-constant">Rerror</span>
713
+ <span class="ruby-identifier">raise</span> <span class="ruby-constant">Error</span>, <span class="ruby-node">&quot;#{response.ename.inspect} in response to #{request.inspect}&quot;</span>
714
+ <span class="ruby-keyword kw">else</span>
715
+ <span class="ruby-keyword kw">return</span> <span class="ruby-identifier">response</span>
716
+ <span class="ruby-keyword kw">end</span>
717
+ <span class="ruby-keyword kw">end</span></pre>
718
+ </div>
719
+ </div>
720
+
721
+ </div>
722
+
723
+ <div class="method">
724
+ <div class="title" id="M000104">
725
+
726
+ <a name="M000104"></a><b>walk</b>(path)
727
+
728
+ </div>
729
+
730
+ <div class="description">
731
+ <p>
732
+ Returns an FID corresponding to the given path.
733
+ </p>
734
+
735
+ </div>
736
+
737
+
738
+
739
+
740
+ <div class="sourcecode">
741
+ <p class="source-link">
742
+ Source: <a href="javascript:toggleSource('M000104_source')" id="l_M000104_source">show</a>
743
+
744
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L393" target="_blank" class="github_url">on GitHub</a>
745
+
746
+ </p>
747
+ <div id="M000104_source" class="dyn-source">
748
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 393</span>
749
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">walk</span> <span class="ruby-identifier">path</span>
750
+ <span class="ruby-identifier">fid</span> = <span class="ruby-ivar">@fid_pool</span>.<span class="ruby-identifier">obtain</span>
751
+ <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">fid</span>, <span class="ruby-identifier">path</span>
752
+ <span class="ruby-identifier">fid</span>
753
+ <span class="ruby-keyword kw">end</span></pre>
754
+ </div>
755
+ </div>
756
+
757
+ </div>
758
+
759
+ <div class="method">
760
+ <div class="title" id="M000107">
761
+
762
+ <a name="M000107"></a><b>walk_fid</b>(path_fid, path)
763
+
764
+ </div>
765
+
766
+ <div class="description">
767
+ <p>
768
+ Associates the given FID to the given path.
769
+ </p>
770
+
771
+ </div>
772
+
773
+
774
+
775
+
776
+ <div class="sourcecode">
777
+ <p class="source-link">
778
+ Source: <a href="javascript:toggleSource('M000107_source')" id="l_M000107_source">show</a>
779
+
780
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L402" target="_blank" class="github_url">on GitHub</a>
781
+
782
+ </p>
783
+ <div id="M000107_source" class="dyn-source">
784
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 402</span>
785
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">walk_fid</span> <span class="ruby-identifier">path_fid</span>, <span class="ruby-identifier">path</span>
786
+ <span class="ruby-identifier">talk</span> <span class="ruby-constant">Twalk</span>.<span class="ruby-identifier">new</span>(
787
+ <span class="ruby-identifier">:fid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-ivar">@root_fid</span>,
788
+ <span class="ruby-identifier">:newfid</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path_fid</span>,
789
+ <span class="ruby-identifier">:wname</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">path</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">split</span>(<span class="ruby-regexp re">%r{/+}</span>).<span class="ruby-identifier">reject</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">s</span><span class="ruby-operator">|</span> <span class="ruby-identifier">s</span>.<span class="ruby-identifier">empty?</span> }
790
+ )
791
+ <span class="ruby-keyword kw">end</span></pre>
792
+ </div>
793
+ </div>
794
+
795
+ </div>
796
+
797
+ <div class="method">
798
+ <div class="title" id="M000089">
799
+
800
+ <a name="M000089"></a><b>write</b>(path, content)
801
+
802
+ </div>
803
+
804
+ <div class="description">
805
+ <p>
806
+ Returns the content of the file/directory at the given path.
807
+ </p>
808
+
809
+ </div>
810
+
811
+
812
+
813
+
814
+ <div class="sourcecode">
815
+ <p class="source-link">
816
+ Source: <a href="javascript:toggleSource('M000089_source')" id="l_M000089_source">show</a>
817
+
818
+ | <a href="http://github.com/sunaku/rumai/blob/5fcf09b89976a53dd9346e335a1803b337e0c447/lib/rumai/ixp/transport.rb#L326" target="_blank" class="github_url">on GitHub</a>
819
+
820
+ </p>
821
+ <div id="M000089_source" class="dyn-source">
822
+ <pre><span class="ruby-comment cmt"># File lib/rumai/ixp/transport.rb, line 326</span>
823
+ <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">write</span> <span class="ruby-identifier">path</span>, <span class="ruby-identifier">content</span>
824
+ <span class="ruby-identifier">open</span> <span class="ruby-identifier">path</span>, <span class="ruby-value str">'w'</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
825
+ <span class="ruby-identifier">f</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">content</span>
826
+ <span class="ruby-keyword kw">end</span>
827
+ <span class="ruby-keyword kw">end</span></pre>
828
+ </div>
829
+ </div>
830
+
831
+ </div>
832
+
833
+ </div>
834
+ </div>
835
+ </body>
836
+ </html>