rumai 2.0.0 → 2.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +13 -23
- data/Rakefile +8 -58
- data/bin/rumai +21 -22
- data/doc/api/IO.html +53 -0
- data/doc/api/Integer.html +102 -0
- data/doc/api/Object.html +23 -0
- data/doc/api/Rumai.html +1218 -0
- data/doc/api/Rumai/Area.html +1088 -0
- data/doc/api/Rumai/Chain.html +230 -0
- data/doc/api/Rumai/Client.html +1264 -0
- data/doc/api/Rumai/ClientContainer.html +227 -0
- data/doc/api/Rumai/ExportInstMethods.html +115 -0
- data/doc/api/Rumai/IXP.html +23 -0
- data/doc/api/Rumai/IXP/Agent.html +1222 -0
- data/doc/api/Rumai/IXP/Agent/FidStream.html +602 -0
- data/doc/api/Rumai/IXP/Agent/RangedPool.html +263 -0
- data/doc/api/Rumai/IXP/Error.html +32 -0
- data/doc/api/Rumai/IXP/Fcall.html +398 -0
- data/doc/api/Rumai/IXP/Qid.html +99 -0
- data/doc/api/Rumai/IXP/Rattach.html +71 -0
- data/doc/api/Rumai/IXP/Rauth.html +71 -0
- data/doc/api/Rumai/IXP/Rclunk.html +71 -0
- data/doc/api/Rumai/IXP/Rcreate.html +71 -0
- data/doc/api/Rumai/IXP/Rerror.html +71 -0
- data/doc/api/Rumai/IXP/Rflush.html +71 -0
- data/doc/api/Rumai/IXP/Ropen.html +71 -0
- data/doc/api/Rumai/IXP/Rread.html +71 -0
- data/doc/api/Rumai/IXP/Rremove.html +71 -0
- data/doc/api/Rumai/IXP/Rstat.html +71 -0
- data/doc/api/Rumai/IXP/Rversion.html +71 -0
- data/doc/api/Rumai/IXP/Rwalk.html +71 -0
- data/doc/api/Rumai/IXP/Rwrite.html +71 -0
- data/doc/api/Rumai/IXP/Rwstat.html +71 -0
- data/doc/api/Rumai/IXP/Stat.html +188 -0
- data/doc/api/Rumai/IXP/Stream.html +112 -0
- data/doc/api/Rumai/IXP/Struct.html +348 -0
- data/doc/api/Rumai/IXP/Struct/ClassField.html +177 -0
- data/doc/api/Rumai/IXP/Struct/Field.html +549 -0
- data/doc/api/Rumai/IXP/Struct/Field/CounteeField.html +175 -0
- data/doc/api/Rumai/IXP/Struct/Field/CounterField.html +95 -0
- data/doc/api/Rumai/IXP/Struct/Integer8Field.html +181 -0
- data/doc/api/Rumai/IXP/Struct/StringField.html +128 -0
- data/doc/api/Rumai/IXP/Tattach.html +71 -0
- data/doc/api/Rumai/IXP/Tauth.html +71 -0
- data/doc/api/Rumai/IXP/Tclunk.html +71 -0
- data/doc/api/Rumai/IXP/Tcreate.html +71 -0
- data/doc/api/Rumai/IXP/Terror.html +156 -0
- data/doc/api/Rumai/IXP/Tflush.html +71 -0
- data/doc/api/Rumai/IXP/Topen.html +113 -0
- data/doc/api/Rumai/IXP/Tread.html +71 -0
- data/doc/api/Rumai/IXP/Tremove.html +71 -0
- data/doc/api/Rumai/IXP/Tstat.html +71 -0
- data/doc/api/Rumai/IXP/Tversion.html +83 -0
- data/doc/api/Rumai/IXP/Twalk.html +71 -0
- data/doc/api/Rumai/IXP/Twrite.html +71 -0
- data/doc/api/Rumai/IXP/Twstat.html +71 -0
- data/doc/api/Rumai/Node.html +1139 -0
- data/doc/api/Rumai/View.html +1280 -0
- data/doc/api/Rumai/WidgetImpl.html +196 -0
- data/doc/api/Rumai/WidgetNode.html +184 -0
- data/doc/api/String.html +180 -0
- data/doc/api/StringIO.html +53 -0
- data/doc/api/Time.html +175 -0
- data/doc/api/all-methods.html +1436 -0
- data/doc/api/all-namespaces.html +140 -0
- data/doc/api/app.js +18 -0
- data/doc/api/index.html +16 -22
- data/doc/api/jquery.js +11 -0
- data/doc/api/readme.html +35 -0
- data/doc/api/style.css +68 -0
- data/doc/api/syntax_highlight.css +21 -0
- data/doc/history.erb +17 -0
- data/doc/index.erb +13 -0
- data/doc/index.xhtml +1235 -0
- data/doc/intro.erb +86 -0
- data/doc/setup.erb +55 -0
- data/doc/theory.erb +3 -0
- data/doc/usage.erb +285 -0
- data/lib/rumai.rb +10 -7
- data/lib/rumai/fs.rb +13 -15
- data/lib/rumai/ixp.rb +2 -7
- data/lib/rumai/ixp/message.rb +0 -3
- data/lib/rumai/ixp/transport.rb +1 -4
- data/lib/rumai/wm.rb +6 -6
- data/test/rumai/ixp/message.rb +249 -0
- metadata +104 -263
- data/README +0 -1
- data/doc/api/classes/IO.html +0 -120
- data/doc/api/classes/Integer.html +0 -142
- data/doc/api/classes/Integer.src/M000002.html +0 -18
- data/doc/api/classes/Object.html +0 -113
- data/doc/api/classes/Rumai.html +0 -530
- data/doc/api/classes/Rumai.src/M000007.html +0 -18
- data/doc/api/classes/Rumai.src/M000008.html +0 -18
- data/doc/api/classes/Rumai.src/M000009.html +0 -18
- data/doc/api/classes/Rumai.src/M000010.html +0 -18
- data/doc/api/classes/Rumai.src/M000011.html +0 -18
- data/doc/api/classes/Rumai.src/M000012.html +0 -18
- data/doc/api/classes/Rumai.src/M000013.html +0 -18
- data/doc/api/classes/Rumai.src/M000014.html +0 -20
- data/doc/api/classes/Rumai.src/M000015.html +0 -18
- data/doc/api/classes/Rumai.src/M000016.html +0 -18
- data/doc/api/classes/Rumai.src/M000017.html +0 -18
- data/doc/api/classes/Rumai.src/M000018.html +0 -18
- data/doc/api/classes/Rumai.src/M000019.html +0 -18
- data/doc/api/classes/Rumai.src/M000020.html +0 -18
- data/doc/api/classes/Rumai.src/M000021.html +0 -18
- data/doc/api/classes/Rumai.src/M000022.html +0 -18
- data/doc/api/classes/Rumai.src/M000023.html +0 -18
- data/doc/api/classes/Rumai.src/M000024.html +0 -18
- data/doc/api/classes/Rumai.src/M000025.html +0 -18
- data/doc/api/classes/Rumai.src/M000026.html +0 -18
- data/doc/api/classes/Rumai/Area.html +0 -461
- data/doc/api/classes/Rumai/Area.src/M000079.html +0 -19
- data/doc/api/classes/Rumai/Area.src/M000080.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000081.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000082.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000083.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000084.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000085.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000086.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000087.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000088.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000089.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000090.html +0 -22
- data/doc/api/classes/Rumai/Area.src/M000092.html +0 -23
- data/doc/api/classes/Rumai/Area.src/M000093.html +0 -28
- data/doc/api/classes/Rumai/Area.src/M000094.html +0 -18
- data/doc/api/classes/Rumai/Area.src/M000095.html +0 -31
- data/doc/api/classes/Rumai/Chain.html +0 -179
- data/doc/api/classes/Rumai/Chain.src/M000076.html +0 -18
- data/doc/api/classes/Rumai/Chain.src/M000077.html +0 -18
- data/doc/api/classes/Rumai/Chain.src/M000078.html +0 -18
- data/doc/api/classes/Rumai/Client.html +0 -481
- data/doc/api/classes/Rumai/Client.src/M000113.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000114.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000115.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000116.html +0 -39
- data/doc/api/classes/Rumai/Client.src/M000117.html +0 -19
- data/doc/api/classes/Rumai/Client.src/M000118.html +0 -19
- data/doc/api/classes/Rumai/Client.src/M000119.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000120.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000121.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000122.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000123.html +0 -19
- data/doc/api/classes/Rumai/Client.src/M000124.html +0 -20
- data/doc/api/classes/Rumai/Client.src/M000125.html +0 -20
- data/doc/api/classes/Rumai/Client.src/M000126.html +0 -22
- data/doc/api/classes/Rumai/Client.src/M000127.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000128.html +0 -20
- data/doc/api/classes/Rumai/Client.src/M000129.html +0 -18
- data/doc/api/classes/Rumai/Client.src/M000130.html +0 -22
- data/doc/api/classes/Rumai/ClientContainer.html +0 -180
- data/doc/api/classes/Rumai/ClientContainer.src/M000027.html +0 -18
- data/doc/api/classes/Rumai/ClientContainer.src/M000028.html +0 -18
- data/doc/api/classes/Rumai/ClientContainer.src/M000029.html +0 -18
- data/doc/api/classes/Rumai/ExportInstMethods.html +0 -119
- data/doc/api/classes/Rumai/IXP.html +0 -149
- data/doc/api/classes/Rumai/IXP/Agent.html +0 -447
- data/doc/api/classes/Rumai/IXP/Agent.src/M000044.html +0 -53
- data/doc/api/classes/Rumai/IXP/Agent.src/M000045.html +0 -36
- data/doc/api/classes/Rumai/IXP/Agent.src/M000046.html +0 -39
- data/doc/api/classes/Rumai/IXP/Agent.src/M000047.html +0 -20
- data/doc/api/classes/Rumai/IXP/Agent.src/M000048.html +0 -22
- data/doc/api/classes/Rumai/IXP/Agent.src/M000049.html +0 -20
- data/doc/api/classes/Rumai/IXP/Agent.src/M000050.html +0 -33
- data/doc/api/classes/Rumai/IXP/Agent.src/M000051.html +0 -19
- data/doc/api/classes/Rumai/IXP/Agent.src/M000052.html +0 -18
- data/doc/api/classes/Rumai/IXP/Agent.src/M000053.html +0 -21
- data/doc/api/classes/Rumai/IXP/Agent.src/M000054.html +0 -20
- data/doc/api/classes/Rumai/IXP/Agent.src/M000055.html +0 -20
- data/doc/api/classes/Rumai/IXP/Agent.src/M000056.html +0 -22
- data/doc/api/classes/Rumai/IXP/Agent.src/M000057.html +0 -23
- data/doc/api/classes/Rumai/IXP/Agent.src/M000058.html +0 -19
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.html +0 -312
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.src/M000060.html +0 -23
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.src/M000061.html +0 -19
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.src/M000062.html +0 -22
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.src/M000063.html +0 -18
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.src/M000064.html +0 -45
- data/doc/api/classes/Rumai/IXP/Agent/FidStream.src/M000065.html +0 -36
- data/doc/api/classes/Rumai/IXP/Agent/MODES.html +0 -130
- data/doc/api/classes/Rumai/IXP/Agent/MODES.src/M000059.html +0 -22
- data/doc/api/classes/Rumai/IXP/Agent/RangedPool.html +0 -203
- data/doc/api/classes/Rumai/IXP/Agent/RangedPool.src/M000067.html +0 -22
- data/doc/api/classes/Rumai/IXP/Agent/RangedPool.src/M000068.html +0 -36
- data/doc/api/classes/Rumai/IXP/Agent/RangedPool.src/M000069.html +0 -18
- data/doc/api/classes/Rumai/IXP/Error.html +0 -117
- data/doc/api/classes/Rumai/IXP/Fcall.html +0 -261
- data/doc/api/classes/Rumai/IXP/Fcall.src/M000070.html +0 -20
- data/doc/api/classes/Rumai/IXP/Fcall.src/M000071.html +0 -25
- data/doc/api/classes/Rumai/IXP/Fcall.src/M000072.html +0 -18
- data/doc/api/classes/Rumai/IXP/Fcall.src/M000073.html +0 -18
- data/doc/api/classes/Rumai/IXP/Qid.html +0 -184
- data/doc/api/classes/Rumai/IXP/Rattach.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rauth.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rclunk.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rcreate.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rerror.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rflush.html +0 -119
- data/doc/api/classes/Rumai/IXP/Ropen.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rread.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rremove.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rstat.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rversion.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rwalk.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rwrite.html +0 -119
- data/doc/api/classes/Rumai/IXP/Rwstat.html +0 -119
- data/doc/api/classes/Rumai/IXP/Stat.html +0 -248
- data/doc/api/classes/Rumai/IXP/Stat.src/M000075.html +0 -18
- data/doc/api/classes/Rumai/IXP/Stream.html +0 -158
- data/doc/api/classes/Rumai/IXP/Stream.src/M000043.html +0 -18
- data/doc/api/classes/Rumai/IXP/Struct.html +0 -221
- data/doc/api/classes/Rumai/IXP/Struct.src/M000030.html +0 -19
- data/doc/api/classes/Rumai/IXP/Struct.src/M000031.html +0 -18
- data/doc/api/classes/Rumai/IXP/Struct.src/M000032.html +0 -20
- data/doc/api/classes/Rumai/IXP/Struct.src/M000033.html +0 -57
- data/doc/api/classes/Rumai/IXP/Struct/Field.html +0 -296
- data/doc/api/classes/Rumai/IXP/Struct/Field.src/M000034.html +0 -21
- data/doc/api/classes/Rumai/IXP/Struct/Field.src/M000035.html +0 -21
- data/doc/api/classes/Rumai/IXP/Struct/Field.src/M000036.html +0 -20
- data/doc/api/classes/Rumai/IXP/Struct/Field.src/M000037.html +0 -29
- data/doc/api/classes/Rumai/IXP/Struct/Field.src/M000038.html +0 -18
- data/doc/api/classes/Rumai/IXP/Struct/Field.src/M000039.html +0 -18
- data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.html +0 -152
- data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.src/M000041.html +0 -24
- data/doc/api/classes/Rumai/IXP/Struct/Field/CounteeField.src/M000042.html +0 -25
- data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.html +0 -137
- data/doc/api/classes/Rumai/IXP/Struct/Field/CounterField.src/M000040.html +0 -18
- data/doc/api/classes/Rumai/IXP/Tattach.html +0 -120
- data/doc/api/classes/Rumai/IXP/Tauth.html +0 -119
- data/doc/api/classes/Rumai/IXP/Tclunk.html +0 -119
- data/doc/api/classes/Rumai/IXP/Tcreate.html +0 -120
- data/doc/api/classes/Rumai/IXP/Terror.html +0 -145
- data/doc/api/classes/Rumai/IXP/Terror.src/M000074.html +0 -18
- data/doc/api/classes/Rumai/IXP/Tflush.html +0 -119
- data/doc/api/classes/Rumai/IXP/Topen.html +0 -193
- data/doc/api/classes/Rumai/IXP/Tread.html +0 -119
- data/doc/api/classes/Rumai/IXP/Tremove.html +0 -119
- data/doc/api/classes/Rumai/IXP/Tstat.html +0 -119
- data/doc/api/classes/Rumai/IXP/Tversion.html +0 -137
- data/doc/api/classes/Rumai/IXP/Twalk.html +0 -120
- data/doc/api/classes/Rumai/IXP/Twrite.html +0 -120
- data/doc/api/classes/Rumai/IXP/Twstat.html +0 -119
- data/doc/api/classes/Rumai/Node.html +0 -461
- data/doc/api/classes/Rumai/Node.src/M000096.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000097.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000098.html +0 -22
- data/doc/api/classes/Rumai/Node.src/M000099.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000100.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000101.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000102.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000103.html +0 -22
- data/doc/api/classes/Rumai/Node.src/M000104.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000105.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000106.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000107.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000108.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000109.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000110.html +0 -18
- data/doc/api/classes/Rumai/Node.src/M000111.html +0 -20
- data/doc/api/classes/Rumai/Node.src/M000112.html +0 -27
- data/doc/api/classes/Rumai/View.html +0 -436
- data/doc/api/classes/Rumai/View.src/M000131.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000132.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000133.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000134.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000135.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000136.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000137.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000138.html +0 -28
- data/doc/api/classes/Rumai/View.src/M000139.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000140.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000141.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000142.html +0 -18
- data/doc/api/classes/Rumai/View.src/M000143.html +0 -29
- data/doc/api/classes/Rumai/View.src/M000144.html +0 -20
- data/doc/api/classes/Rumai/View.src/M000145.html +0 -33
- data/doc/api/classes/Rumai/View.src/M000146.html +0 -50
- data/doc/api/classes/String.html +0 -169
- data/doc/api/classes/String.src/M000005.html +0 -18
- data/doc/api/classes/String.src/M000006.html +0 -18
- data/doc/api/classes/StringIO.html +0 -120
- data/doc/api/classes/Time.html +0 -163
- data/doc/api/classes/Time.src/M000003.html +0 -18
- data/doc/api/classes/Time.src/M000004.html +0 -18
- data/doc/api/created.rid +0 -1
- data/doc/api/files/lib/rumai/fs_rb.html +0 -115
- data/doc/api/files/lib/rumai/ixp/message_rb.html +0 -120
- data/doc/api/files/lib/rumai/ixp/message_spec_rb.html +0 -175
- data/doc/api/files/lib/rumai/ixp/message_spec_rb.src/M000001.html +0 -37
- data/doc/api/files/lib/rumai/ixp/transport_rb.html +0 -115
- data/doc/api/files/lib/rumai/ixp_rb.html +0 -116
- data/doc/api/files/lib/rumai/nfo_rb.html +0 -107
- data/doc/api/files/lib/rumai/wm_rb.html +0 -115
- data/doc/api/files/lib/rumai_rb.html +0 -115
- data/doc/api/fr_class_index.html +0 -82
- data/doc/api/fr_file_index.html +0 -34
- data/doc/api/fr_method_index.html +0 -172
- data/doc/api/rdoc-style.css +0 -208
- data/doc/guide.erb +0 -390
- data/doc/guide.html +0 -2043
- data/lib/rumai/ixp/message_spec.rb +0 -247
- data/lib/rumai/nfo.rb +0 -24
@@ -1,247 +0,0 @@
|
|
1
|
-
# Unit test for 9p.rb
|
2
|
-
#--
|
3
|
-
# Copyright 2007 Suraj N. Kurapati
|
4
|
-
# See the file named LICENSE for details.
|
5
|
-
|
6
|
-
$: << File.dirname(__FILE__)
|
7
|
-
require 'message'
|
8
|
-
include Rumai::IXP
|
9
|
-
|
10
|
-
require 'pp' if $DEBUG
|
11
|
-
|
12
|
-
# Transmits the given request and returns the received response.
|
13
|
-
def xmit aRequest
|
14
|
-
# send the request
|
15
|
-
req = aRequest
|
16
|
-
if $DEBUG
|
17
|
-
puts
|
18
|
-
pp req
|
19
|
-
pp req.to_9p
|
20
|
-
end
|
21
|
-
PIPE << req.to_9p
|
22
|
-
|
23
|
-
# recv the response
|
24
|
-
rsp = Fcall.from_9p(PIPE)
|
25
|
-
if $DEBUG
|
26
|
-
puts
|
27
|
-
pp rsp
|
28
|
-
pp rsp.to_9p
|
29
|
-
end
|
30
|
-
|
31
|
-
[Rerror.type, req.type + 1].should include(rsp.type)
|
32
|
-
req.tag.should == rsp.tag
|
33
|
-
rsp
|
34
|
-
end
|
35
|
-
|
36
|
-
# set up the connection to wmii's IXP server
|
37
|
-
ADDR = ENV['WMII_ADDRESS'].sub(/.*!/, '') rescue
|
38
|
-
"/tmp/ns.#{ENV['USER']}.#{ENV['DISPLAY'] || ':0'}/wmii"
|
39
|
-
|
40
|
-
require 'socket'
|
41
|
-
PIPE = UNIXSocket.new(ADDR)
|
42
|
-
|
43
|
-
describe Tversion do
|
44
|
-
it 'should establish a connection' do
|
45
|
-
req = Tversion.new(
|
46
|
-
:tag => Fcall::NOTAG,
|
47
|
-
:msize => Tversion::MSIZE,
|
48
|
-
:version => Tversion::VERSION
|
49
|
-
)
|
50
|
-
rsp = xmit(req)
|
51
|
-
|
52
|
-
rsp.type.should == Rversion.type
|
53
|
-
rsp.version.should == req.version
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# read a directory
|
58
|
-
describe Tattach do
|
59
|
-
it 'should attach to FS root' do
|
60
|
-
req = Tattach.new(
|
61
|
-
:tag => 0,
|
62
|
-
:fid => 0,
|
63
|
-
:afid => Fcall::NOFID,
|
64
|
-
:uname => ENV['USER'],
|
65
|
-
:aname => ''
|
66
|
-
)
|
67
|
-
rsp = xmit(req)
|
68
|
-
|
69
|
-
rsp.type.should == Rattach.type
|
70
|
-
end
|
71
|
-
end
|
72
|
-
|
73
|
-
describe Tstat do
|
74
|
-
it 'should stat FS root' do
|
75
|
-
req = Tstat.new(
|
76
|
-
:tag => 0,
|
77
|
-
:fid => 0
|
78
|
-
)
|
79
|
-
rsp = xmit(req)
|
80
|
-
|
81
|
-
rsp.type.should == Rstat.type
|
82
|
-
end
|
83
|
-
end
|
84
|
-
|
85
|
-
describe Topen do
|
86
|
-
it 'should open the FS root for reading' do
|
87
|
-
req = Topen.new(
|
88
|
-
:tag => 0,
|
89
|
-
:fid => 0,
|
90
|
-
:mode => Topen::OREAD
|
91
|
-
)
|
92
|
-
rsp = xmit(req)
|
93
|
-
|
94
|
-
rsp.type.should == Ropen.type
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
describe Tread do
|
99
|
-
it 'should return a Stat for every file in FS root' do
|
100
|
-
req = Tread.new(
|
101
|
-
:tag => 0,
|
102
|
-
:fid => 0,
|
103
|
-
:offset => 0,
|
104
|
-
:count => Tversion::MSIZE
|
105
|
-
)
|
106
|
-
rsp = xmit(req)
|
107
|
-
|
108
|
-
rsp.type.should == Rread.type
|
109
|
-
|
110
|
-
if $DEBUG
|
111
|
-
s = StringIO.new(rsp.data, 'r')
|
112
|
-
a = []
|
113
|
-
until s.eof?
|
114
|
-
t = Stat.from_9p(s)
|
115
|
-
a << t
|
116
|
-
end
|
117
|
-
pp a
|
118
|
-
end
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
|
-
describe Tclunk do
|
123
|
-
it 'should close the fid for FS root' do
|
124
|
-
req = Tclunk.new(
|
125
|
-
:tag => 0,
|
126
|
-
:fid => 0
|
127
|
-
)
|
128
|
-
rsp = xmit(req)
|
129
|
-
|
130
|
-
rsp.type.should == Rclunk.type
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
describe 'A closed fid' do
|
135
|
-
it 'should not be readable' do
|
136
|
-
req = Tread.new(
|
137
|
-
:tag => 0,
|
138
|
-
:fid => 0,
|
139
|
-
:offset => 0,
|
140
|
-
:count => Tversion::MSIZE
|
141
|
-
)
|
142
|
-
rsp = xmit(req)
|
143
|
-
|
144
|
-
rsp.type.should == Rerror.type
|
145
|
-
end
|
146
|
-
end
|
147
|
-
|
148
|
-
# read & write a file
|
149
|
-
describe Tattach do
|
150
|
-
it 'should attach to /' do
|
151
|
-
req = Tattach.new(
|
152
|
-
:tag => 0,
|
153
|
-
:fid => 0,
|
154
|
-
:afid => Fcall::NOFID,
|
155
|
-
:uname => ENV['USER'],
|
156
|
-
:aname => ''
|
157
|
-
)
|
158
|
-
rsp = xmit(req)
|
159
|
-
|
160
|
-
rsp.type.should == Rattach.type
|
161
|
-
end
|
162
|
-
end
|
163
|
-
|
164
|
-
describe Twalk do
|
165
|
-
it 'should walk to /rbar/status' do
|
166
|
-
req = Twalk.new(
|
167
|
-
:tag => 0,
|
168
|
-
:fid => 0,
|
169
|
-
:newfid => 1,
|
170
|
-
:wname => %w[rbar status]
|
171
|
-
)
|
172
|
-
rsp = xmit(req)
|
173
|
-
|
174
|
-
rsp.type.should == Rwalk.type
|
175
|
-
end
|
176
|
-
end
|
177
|
-
|
178
|
-
describe Tclunk do
|
179
|
-
it 'should close the fid for /' do
|
180
|
-
req = Tclunk.new(
|
181
|
-
:tag => 0,
|
182
|
-
:fid => 0
|
183
|
-
)
|
184
|
-
rsp = xmit(req)
|
185
|
-
|
186
|
-
rsp.type.should == Rclunk.type
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
describe Topen do
|
191
|
-
it 'should open /rbar/status for writing' do
|
192
|
-
req = Topen.new(
|
193
|
-
:tag => 0,
|
194
|
-
:fid => 1,
|
195
|
-
:mode => Topen::ORDWR
|
196
|
-
)
|
197
|
-
rsp = xmit(req)
|
198
|
-
|
199
|
-
rsp.type.should == Ropen.type
|
200
|
-
end
|
201
|
-
end
|
202
|
-
|
203
|
-
describe Twrite do
|
204
|
-
it 'should replace the file content' do
|
205
|
-
writeReq = Twrite.new(
|
206
|
-
:tag => 0,
|
207
|
-
:fid => 1,
|
208
|
-
:offset => 0,
|
209
|
-
:data => "hello world!!!"
|
210
|
-
)
|
211
|
-
writeRsp = xmit(writeReq)
|
212
|
-
|
213
|
-
writeRsp.type.should == Rwrite.type
|
214
|
-
writeRsp.count.should == writeReq.data.length
|
215
|
-
|
216
|
-
|
217
|
-
readReq = Tread.new(
|
218
|
-
:tag => 0,
|
219
|
-
:fid => 1,
|
220
|
-
:offset => 0,
|
221
|
-
:count => writeRsp.count
|
222
|
-
)
|
223
|
-
readRsp = xmit(readReq)
|
224
|
-
|
225
|
-
readRsp.type.should == Rread.type
|
226
|
-
readRsp.data.should == writeReq.data
|
227
|
-
end
|
228
|
-
end
|
229
|
-
|
230
|
-
describe Tclunk do
|
231
|
-
it 'should close the fid for /rbar/status' do
|
232
|
-
req = Tclunk.new(
|
233
|
-
:tag => 0,
|
234
|
-
:fid => 1
|
235
|
-
)
|
236
|
-
rsp = xmit(req)
|
237
|
-
|
238
|
-
rsp.type.should == Rclunk.type
|
239
|
-
end
|
240
|
-
end
|
241
|
-
|
242
|
-
# at_exit do
|
243
|
-
# puts "just making sure there is no more data in the pipe"
|
244
|
-
# while c = PIPE.getc
|
245
|
-
# puts c
|
246
|
-
# end
|
247
|
-
# end
|
data/lib/rumai/nfo.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
# Project information.
|
2
|
-
#--
|
3
|
-
# Copyright 2007 Suraj N. Kurapati
|
4
|
-
# See the file named LICENSE for details.
|
5
|
-
|
6
|
-
module Rumai
|
7
|
-
NFO = {
|
8
|
-
:name => 'Rumai',
|
9
|
-
:version => '2.0.0',
|
10
|
-
:release => '2008-02-04',
|
11
|
-
:website => 'http://rumai.rubyforge.org',
|
12
|
-
:home => File.expand_path(File.join(File.dirname(__FILE__), '..', '..'))
|
13
|
-
}
|
14
|
-
|
15
|
-
class << NFO
|
16
|
-
# Returns the name and version.
|
17
|
-
def to_s
|
18
|
-
self[:name] + ' ' + self[:version]
|
19
|
-
end
|
20
|
-
|
21
|
-
# throw an exception instead of returning nil
|
22
|
-
alias [] fetch
|
23
|
-
end
|
24
|
-
end
|