rio 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (240) hide show
  1. data/ChangeLog +140 -0
  2. data/Rakefile +1 -1
  3. data/VERSION +1 -1
  4. data/doc/ANNOUNCE +87 -0
  5. data/doc/RELEASE_NOTES +7 -0
  6. data/doc/rdoc/classes/Kernel.html +9 -9
  7. data/doc/rdoc/classes/Kernel.src/{M000183.html → M000182.html} +0 -0
  8. data/doc/rdoc/classes/RIO.html +35 -0
  9. data/doc/rdoc/classes/RIO.src/M000001.html +4 -4
  10. data/doc/rdoc/classes/RIO.src/M000002.html +4 -4
  11. data/doc/rdoc/classes/RIO.src/M000003.html +4 -4
  12. data/doc/rdoc/classes/RIO/Doc/HOWTO.html +11 -7
  13. data/doc/rdoc/classes/RIO/Doc/INTRO.html +255 -36
  14. data/doc/rdoc/classes/RIO/Doc/SYNOPSIS.html +47 -17
  15. data/doc/rdoc/classes/RIO/Rio.html +1032 -1007
  16. data/doc/rdoc/classes/RIO/Rio.src/M000011.html +3 -3
  17. data/doc/rdoc/classes/RIO/Rio.src/M000012.html +3 -3
  18. data/doc/rdoc/classes/RIO/Rio.src/M000013.html +3 -3
  19. data/doc/rdoc/classes/RIO/Rio.src/M000014.html +3 -3
  20. data/doc/rdoc/classes/RIO/Rio.src/M000015.html +3 -3
  21. data/doc/rdoc/classes/RIO/Rio.src/M000016.html +3 -3
  22. data/doc/rdoc/classes/RIO/Rio.src/M000017.html +3 -3
  23. data/doc/rdoc/classes/RIO/Rio.src/M000018.html +3 -3
  24. data/doc/rdoc/classes/RIO/Rio.src/M000019.html +3 -3
  25. data/doc/rdoc/classes/RIO/Rio.src/M000020.html +3 -3
  26. data/doc/rdoc/classes/RIO/Rio.src/M000021.html +3 -3
  27. data/doc/rdoc/classes/RIO/Rio.src/M000022.html +3 -3
  28. data/doc/rdoc/classes/RIO/Rio.src/M000023.html +3 -3
  29. data/doc/rdoc/classes/RIO/Rio.src/M000024.html +3 -3
  30. data/doc/rdoc/classes/RIO/Rio.src/M000025.html +3 -3
  31. data/doc/rdoc/classes/RIO/Rio.src/M000026.html +3 -3
  32. data/doc/rdoc/classes/RIO/Rio.src/M000027.html +3 -3
  33. data/doc/rdoc/classes/RIO/Rio.src/M000028.html +3 -3
  34. data/doc/rdoc/classes/RIO/Rio.src/M000029.html +3 -3
  35. data/doc/rdoc/classes/RIO/Rio.src/M000030.html +3 -3
  36. data/doc/rdoc/classes/RIO/Rio.src/M000031.html +3 -3
  37. data/doc/rdoc/classes/RIO/Rio.src/M000032.html +3 -3
  38. data/doc/rdoc/classes/RIO/Rio.src/M000033.html +3 -3
  39. data/doc/rdoc/classes/RIO/Rio.src/M000034.html +3 -3
  40. data/doc/rdoc/classes/RIO/Rio.src/M000035.html +3 -3
  41. data/doc/rdoc/classes/RIO/Rio.src/M000036.html +3 -3
  42. data/doc/rdoc/classes/RIO/Rio.src/M000037.html +3 -3
  43. data/doc/rdoc/classes/RIO/Rio.src/M000038.html +3 -3
  44. data/doc/rdoc/classes/RIO/Rio.src/M000039.html +3 -3
  45. data/doc/rdoc/classes/RIO/Rio.src/M000040.html +3 -3
  46. data/doc/rdoc/classes/RIO/Rio.src/M000041.html +3 -3
  47. data/doc/rdoc/classes/RIO/Rio.src/M000042.html +3 -3
  48. data/doc/rdoc/classes/RIO/Rio.src/M000043.html +3 -3
  49. data/doc/rdoc/classes/RIO/Rio.src/M000044.html +3 -3
  50. data/doc/rdoc/classes/RIO/Rio.src/M000045.html +3 -3
  51. data/doc/rdoc/classes/RIO/Rio.src/M000046.html +3 -3
  52. data/doc/rdoc/classes/RIO/Rio.src/M000047.html +3 -3
  53. data/doc/rdoc/classes/RIO/Rio.src/M000048.html +3 -3
  54. data/doc/rdoc/classes/RIO/Rio.src/M000049.html +3 -3
  55. data/doc/rdoc/classes/RIO/Rio.src/M000050.html +3 -3
  56. data/doc/rdoc/classes/RIO/Rio.src/M000051.html +3 -3
  57. data/doc/rdoc/classes/RIO/Rio.src/M000052.html +3 -3
  58. data/doc/rdoc/classes/RIO/Rio.src/M000053.html +3 -3
  59. data/doc/rdoc/classes/RIO/Rio.src/M000054.html +3 -3
  60. data/doc/rdoc/classes/RIO/Rio.src/M000055.html +3 -3
  61. data/doc/rdoc/classes/RIO/Rio.src/M000056.html +3 -3
  62. data/doc/rdoc/classes/RIO/Rio.src/M000057.html +3 -3
  63. data/doc/rdoc/classes/RIO/Rio.src/M000058.html +3 -3
  64. data/doc/rdoc/classes/RIO/Rio.src/M000059.html +3 -3
  65. data/doc/rdoc/classes/RIO/Rio.src/M000060.html +3 -3
  66. data/doc/rdoc/classes/RIO/Rio.src/M000061.html +3 -3
  67. data/doc/rdoc/classes/RIO/Rio.src/M000062.html +3 -3
  68. data/doc/rdoc/classes/RIO/Rio.src/M000063.html +3 -3
  69. data/doc/rdoc/classes/RIO/Rio.src/M000064.html +3 -3
  70. data/doc/rdoc/classes/RIO/Rio.src/M000065.html +3 -3
  71. data/doc/rdoc/classes/RIO/Rio.src/M000066.html +3 -3
  72. data/doc/rdoc/classes/RIO/Rio.src/M000067.html +3 -3
  73. data/doc/rdoc/classes/RIO/Rio.src/M000068.html +3 -3
  74. data/doc/rdoc/classes/RIO/Rio.src/M000069.html +3 -3
  75. data/doc/rdoc/classes/RIO/Rio.src/M000070.html +3 -3
  76. data/doc/rdoc/classes/RIO/Rio.src/M000071.html +3 -3
  77. data/doc/rdoc/classes/RIO/Rio.src/M000072.html +3 -3
  78. data/doc/rdoc/classes/RIO/Rio.src/M000073.html +3 -3
  79. data/doc/rdoc/classes/RIO/Rio.src/M000074.html +3 -3
  80. data/doc/rdoc/classes/RIO/Rio.src/M000075.html +3 -3
  81. data/doc/rdoc/classes/RIO/Rio.src/M000076.html +3 -3
  82. data/doc/rdoc/classes/RIO/Rio.src/M000077.html +3 -3
  83. data/doc/rdoc/classes/RIO/Rio.src/M000078.html +3 -3
  84. data/doc/rdoc/classes/RIO/Rio.src/M000079.html +3 -3
  85. data/doc/rdoc/classes/RIO/Rio.src/M000080.html +3 -3
  86. data/doc/rdoc/classes/RIO/Rio.src/M000081.html +3 -3
  87. data/doc/rdoc/classes/RIO/Rio.src/M000082.html +3 -3
  88. data/doc/rdoc/classes/RIO/Rio.src/M000083.html +3 -3
  89. data/doc/rdoc/classes/RIO/Rio.src/M000084.html +3 -3
  90. data/doc/rdoc/classes/RIO/Rio.src/M000085.html +3 -3
  91. data/doc/rdoc/classes/RIO/Rio.src/M000086.html +3 -3
  92. data/doc/rdoc/classes/RIO/Rio.src/M000087.html +3 -3
  93. data/doc/rdoc/classes/RIO/Rio.src/M000088.html +3 -3
  94. data/doc/rdoc/classes/RIO/Rio.src/M000089.html +2 -2
  95. data/doc/rdoc/classes/RIO/Rio.src/M000090.html +2 -2
  96. data/doc/rdoc/classes/RIO/Rio.src/M000091.html +2 -2
  97. data/doc/rdoc/classes/RIO/Rio.src/M000092.html +2 -2
  98. data/doc/rdoc/classes/RIO/Rio.src/M000093.html +2 -2
  99. data/doc/rdoc/classes/RIO/Rio.src/M000094.html +2 -2
  100. data/doc/rdoc/classes/RIO/Rio.src/M000095.html +2 -2
  101. data/doc/rdoc/classes/RIO/Rio.src/M000096.html +2 -2
  102. data/doc/rdoc/classes/RIO/Rio.src/M000097.html +2 -2
  103. data/doc/rdoc/classes/RIO/Rio.src/M000098.html +2 -2
  104. data/doc/rdoc/classes/RIO/Rio.src/M000099.html +2 -2
  105. data/doc/rdoc/classes/RIO/Rio.src/M000100.html +2 -2
  106. data/doc/rdoc/classes/RIO/Rio.src/M000101.html +2 -2
  107. data/doc/rdoc/classes/RIO/Rio.src/M000102.html +2 -2
  108. data/doc/rdoc/classes/RIO/Rio.src/M000103.html +2 -2
  109. data/doc/rdoc/classes/RIO/Rio.src/M000104.html +2 -2
  110. data/doc/rdoc/classes/RIO/Rio.src/M000105.html +2 -2
  111. data/doc/rdoc/classes/RIO/Rio.src/M000106.html +2 -2
  112. data/doc/rdoc/classes/RIO/Rio.src/M000107.html +2 -2
  113. data/doc/rdoc/classes/RIO/Rio.src/M000108.html +3 -3
  114. data/doc/rdoc/classes/RIO/Rio.src/M000109.html +3 -3
  115. data/doc/rdoc/classes/RIO/Rio.src/M000110.html +3 -3
  116. data/doc/rdoc/classes/RIO/Rio.src/M000111.html +3 -3
  117. data/doc/rdoc/classes/RIO/Rio.src/M000112.html +3 -3
  118. data/doc/rdoc/classes/RIO/Rio.src/M000113.html +3 -3
  119. data/doc/rdoc/classes/RIO/Rio.src/M000114.html +3 -3
  120. data/doc/rdoc/classes/RIO/Rio.src/M000115.html +3 -3
  121. data/doc/rdoc/classes/RIO/Rio.src/M000116.html +3 -3
  122. data/doc/rdoc/classes/RIO/Rio.src/M000117.html +3 -3
  123. data/doc/rdoc/classes/RIO/Rio.src/M000118.html +3 -3
  124. data/doc/rdoc/classes/RIO/Rio.src/M000119.html +3 -3
  125. data/doc/rdoc/classes/RIO/Rio.src/M000120.html +3 -3
  126. data/doc/rdoc/classes/RIO/Rio.src/M000121.html +3 -3
  127. data/doc/rdoc/classes/RIO/Rio.src/M000122.html +3 -3
  128. data/doc/rdoc/classes/RIO/Rio.src/M000123.html +3 -3
  129. data/doc/rdoc/classes/RIO/Rio.src/M000124.html +3 -3
  130. data/doc/rdoc/classes/RIO/Rio.src/M000125.html +3 -3
  131. data/doc/rdoc/classes/RIO/Rio.src/M000126.html +3 -3
  132. data/doc/rdoc/classes/RIO/Rio.src/M000127.html +3 -3
  133. data/doc/rdoc/classes/RIO/Rio.src/M000128.html +3 -3
  134. data/doc/rdoc/classes/RIO/Rio.src/M000129.html +3 -3
  135. data/doc/rdoc/classes/RIO/Rio.src/M000130.html +3 -3
  136. data/doc/rdoc/classes/RIO/Rio.src/M000131.html +3 -3
  137. data/doc/rdoc/classes/RIO/Rio.src/M000132.html +3 -3
  138. data/doc/rdoc/classes/RIO/Rio.src/M000133.html +3 -3
  139. data/doc/rdoc/classes/RIO/Rio.src/M000134.html +3 -3
  140. data/doc/rdoc/classes/RIO/Rio.src/M000135.html +3 -3
  141. data/doc/rdoc/classes/RIO/Rio.src/M000136.html +3 -3
  142. data/doc/rdoc/classes/RIO/Rio.src/M000137.html +3 -3
  143. data/doc/rdoc/classes/RIO/Rio.src/M000138.html +3 -3
  144. data/doc/rdoc/classes/RIO/Rio.src/M000139.html +3 -3
  145. data/doc/rdoc/classes/RIO/Rio.src/M000140.html +3 -3
  146. data/doc/rdoc/classes/RIO/Rio.src/M000141.html +3 -3
  147. data/doc/rdoc/classes/RIO/Rio.src/M000142.html +3 -3
  148. data/doc/rdoc/classes/RIO/Rio.src/M000143.html +3 -3
  149. data/doc/rdoc/classes/RIO/Rio.src/M000144.html +3 -3
  150. data/doc/rdoc/classes/RIO/Rio.src/M000145.html +3 -3
  151. data/doc/rdoc/classes/RIO/Rio.src/M000146.html +3 -3
  152. data/doc/rdoc/classes/RIO/Rio.src/M000147.html +3 -3
  153. data/doc/rdoc/classes/RIO/Rio.src/M000148.html +3 -3
  154. data/doc/rdoc/classes/RIO/Rio.src/M000149.html +3 -3
  155. data/doc/rdoc/classes/RIO/Rio.src/M000150.html +3 -3
  156. data/doc/rdoc/classes/RIO/Rio.src/M000151.html +3 -3
  157. data/doc/rdoc/classes/RIO/Rio.src/M000152.html +3 -3
  158. data/doc/rdoc/classes/RIO/Rio.src/M000153.html +3 -3
  159. data/doc/rdoc/classes/RIO/Rio.src/M000154.html +3 -3
  160. data/doc/rdoc/classes/RIO/Rio.src/M000155.html +3 -3
  161. data/doc/rdoc/classes/RIO/Rio.src/M000156.html +3 -3
  162. data/doc/rdoc/classes/RIO/Rio.src/M000157.html +3 -3
  163. data/doc/rdoc/classes/RIO/Rio.src/M000158.html +3 -3
  164. data/doc/rdoc/classes/RIO/Rio.src/M000159.html +3 -3
  165. data/doc/rdoc/classes/RIO/Rio.src/M000160.html +3 -3
  166. data/doc/rdoc/classes/RIO/Rio.src/M000161.html +3 -3
  167. data/doc/rdoc/classes/RIO/Rio.src/M000162.html +3 -3
  168. data/doc/rdoc/classes/RIO/Rio.src/M000163.html +3 -3
  169. data/doc/rdoc/classes/RIO/Rio.src/M000164.html +3 -3
  170. data/doc/rdoc/classes/RIO/Rio.src/M000165.html +3 -3
  171. data/doc/rdoc/classes/RIO/Rio.src/M000166.html +3 -3
  172. data/doc/rdoc/classes/RIO/Rio.src/M000167.html +3 -3
  173. data/doc/rdoc/classes/RIO/Rio.src/M000168.html +3 -3
  174. data/doc/rdoc/classes/RIO/Rio.src/M000169.html +3 -3
  175. data/doc/rdoc/classes/RIO/Rio.src/M000170.html +3 -3
  176. data/doc/rdoc/classes/RIO/Rio.src/M000171.html +3 -3
  177. data/doc/rdoc/classes/RIO/Rio.src/M000172.html +3 -3
  178. data/doc/rdoc/classes/RIO/Rio.src/M000173.html +3 -3
  179. data/doc/rdoc/classes/RIO/Rio.src/M000174.html +3 -3
  180. data/doc/rdoc/classes/RIO/Rio.src/M000175.html +3 -3
  181. data/doc/rdoc/classes/RIO/Rio.src/M000176.html +3 -3
  182. data/doc/rdoc/classes/RIO/Rio.src/M000177.html +3 -3
  183. data/doc/rdoc/classes/RIO/Rio.src/M000178.html +3 -3
  184. data/doc/rdoc/classes/RIO/Rio.src/M000179.html +3 -3
  185. data/doc/rdoc/classes/RIO/Rio.src/M000180.html +3 -3
  186. data/doc/rdoc/classes/RIO/Rio.src/M000181.html +3 -3
  187. data/doc/rdoc/created.rid +1 -1
  188. data/doc/rdoc/files/lib/rio/constructor_rb.html +1 -1
  189. data/doc/rdoc/files/lib/rio/doc/HOWTO_rb.html +1 -1
  190. data/doc/rdoc/files/lib/rio/doc/INTRO_rb.html +1 -1
  191. data/doc/rdoc/files/lib/rio/doc/SYNOPSIS_rb.html +1 -1
  192. data/doc/rdoc/files/lib/rio/if/basic_rb.html +1 -1
  193. data/doc/rdoc/files/lib/rio/if/path_rb.html +1 -1
  194. data/doc/rdoc/files/lib/rio_rb.html +1 -1
  195. data/doc/rdoc/fr_method_index.html +154 -155
  196. data/ex/findinruby +7 -3
  197. data/ex/findruby +6 -2
  198. data/lib/rio.rb +1 -1
  199. data/lib/rio/argv.rb +4 -0
  200. data/lib/rio/constructor.rb +17 -0
  201. data/lib/rio/context.rb +1 -1
  202. data/lib/rio/context/dir.rb +1 -0
  203. data/lib/rio/context/methods.rb +3 -3
  204. data/lib/rio/dir.rb +2 -2
  205. data/lib/rio/doc/HOWTO.rb +11 -6
  206. data/lib/rio/doc/INTRO.rb +149 -12
  207. data/lib/rio/doc/SYNOPSIS.rb +26 -13
  208. data/lib/rio/factory.rb +13 -2
  209. data/lib/rio/grande.rb +25 -0
  210. data/lib/rio/if/basic.rb +1 -1
  211. data/lib/rio/if/path.rb +61 -35
  212. data/lib/rio/matchrecord.rb +20 -1
  213. data/lib/rio/ops/dir.rb +2 -3
  214. data/lib/rio/ops/path.rb +25 -11
  215. data/lib/rio/ops/stream/input.rb +6 -3
  216. data/lib/rio/rl/base.rb +3 -2
  217. data/lib/rio/rl/ioi.rb +2 -1
  218. data/lib/rio/rl/path.rb +18 -3
  219. data/lib/rio/rl/uri.rb +8 -4
  220. data/lib/rio/scheme/cmdio.rb +1 -1
  221. data/lib/rio/scheme/path.rb +1 -0
  222. data/lib/rio/scheme/stdio.rb +1 -1
  223. data/lib/rio/scheme/strio.rb +1 -1
  224. data/lib/rio/scheme/sysio.rb +1 -1
  225. data/lib/rio/scheme/tcp.rb +1 -0
  226. data/lib/rio/scheme/temp.rb +184 -0
  227. data/lib/rio/state.rb +17 -6
  228. data/lib/rio/stream.rb +1 -1
  229. data/lib/rio/stream/open.rb +1 -1
  230. data/lib/rio/tempdir.rb +132 -0
  231. data/lib/rio/version.rb +1 -1
  232. data/test/tc/all.rb +4 -0
  233. data/test/tc/copylines.rb +38 -32
  234. data/test/tc/riorl.rb +104 -0
  235. data/test/tc/temp.rb +155 -0
  236. data/test/tc/tempdir.rb +63 -0
  237. data/test/tc/tempfile.rb +38 -0
  238. metadata +10 -5
  239. data/doc/rdoc/classes/RIO/Rio.src/M000182.html +0 -16
  240. data/lib/rio/scheme/tempfile.rb +0 -104
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.11
3
3
  specification_version: 1
4
4
  name: rio
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.3.1
7
- date: 2005-08-06 00:00:00 -07:00
6
+ version: 0.3.2
7
+ date: 2005-08-16 00:00:00 -07:00
8
8
  summary: "Rio - Ruby I/O Comfort Class"
9
9
  require_paths:
10
10
  - lib
@@ -87,11 +87,16 @@ files:
87
87
  - test/tc/records.rb
88
88
  - test/tc/rename.rb
89
89
  - test/tc/rename_assign.rb
90
+ - test/tc/riorl.rb
90
91
  - test/tc/sub.rb
91
92
  - test/tc/symlink.rb
92
93
  - test/tc/symlink0.rb
93
94
  - test/tc/symlink1.rb
95
+ - test/tc/temp.rb
96
+ - test/tc/tempdir.rb
97
+ - test/tc/tempfile.rb
94
98
  - test/tc/testcase.rb
99
+ - doc/ANNOUNCE
95
100
  - doc/generators
96
101
  - doc/rdoc
97
102
  - doc/README_MSWIN32.txt
@@ -114,7 +119,7 @@ files:
114
119
  - doc/rdoc/classes/RIO
115
120
  - doc/rdoc/classes/RIO.html
116
121
  - doc/rdoc/classes/RIO.src
117
- - doc/rdoc/classes/Kernel.src/M000183.html
122
+ - doc/rdoc/classes/Kernel.src/M000182.html
118
123
  - doc/rdoc/classes/RIO/Doc
119
124
  - doc/rdoc/classes/RIO/Doc.html
120
125
  - doc/rdoc/classes/RIO/Rio.html
@@ -301,7 +306,6 @@ files:
301
306
  - doc/rdoc/classes/RIO/Rio.src/M000179.html
302
307
  - doc/rdoc/classes/RIO/Rio.src/M000180.html
303
308
  - doc/rdoc/classes/RIO/Rio.src/M000181.html
304
- - doc/rdoc/classes/RIO/Rio.src/M000182.html
305
309
  - doc/rdoc/classes/RIO.src/M000001.html
306
310
  - doc/rdoc/classes/RIO.src/M000002.html
307
311
  - doc/rdoc/classes/RIO.src/M000003.html
@@ -362,6 +366,7 @@ files:
362
366
  - lib/rio/state.rb
363
367
  - lib/rio/stream.rb
364
368
  - lib/rio/symantics.rb
369
+ - lib/rio/tempdir.rb
365
370
  - lib/rio/to_rio.rb
366
371
  - lib/rio/version.rb
367
372
  - lib/rio/context/chomp.rb
@@ -423,7 +428,7 @@ files:
423
428
  - lib/rio/scheme/strio.rb
424
429
  - lib/rio/scheme/sysio.rb
425
430
  - lib/rio/scheme/tcp.rb
426
- - lib/rio/scheme/tempfile.rb
431
+ - lib/rio/scheme/temp.rb
427
432
  - lib/rio/state/error.rb
428
433
  - lib/rio/stream/base.rb
429
434
  - lib/rio/stream/duplex.rb
@@ -1,16 +0,0 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!DOCTYPE html
3
- PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
-
6
- <html>
7
- <head>
8
- <title>absolute? (RIO::Rio)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/rio/if/test.rb, line 215</span>
14
- 215: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">absolute?</span>() <span class="ruby-identifier">target</span>.<span class="ruby-identifier">absolute?</span>() <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -1,104 +0,0 @@
1
- #--
2
- # ===============================================================================
3
- # Copyright (c) 2005, Christopher Kleckner
4
- # All rights reserved
5
- #
6
- # This file is part of the Rio library for ruby.
7
- #
8
- # Rio is free software; you can redistribute it and/or modify
9
- # it under the terms of the GNU General Public License as published by
10
- # the Free Software Foundation; either version 2 of the License, or
11
- # (at your option) any later version.
12
- #
13
- # Rio is distributed in the hope that it will be useful,
14
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
15
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
- # GNU General Public License for more details.
17
- #
18
- # You should have received a copy of the GNU General Public License
19
- # along with Rio; if not, write to the Free Software
20
- # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21
- # ===============================================================================
22
- #++
23
- #
24
- # To create the documentation for Rio run the command
25
- # rake rdoc
26
- # from the distribution directory. Then point your browser at the 'doc/rdoc' directory.
27
- #
28
- # Suggested Reading
29
- # * RIO::Doc::SYNOPSIS
30
- # * RIO::Doc::INTRO
31
- # * RIO::Doc::HOWTO
32
- # * RIO::Rio
33
- #
34
- # <b>Rio is pre-alpha software.
35
- # The documented interface and behavior is subject to change without notice.</b>
36
-
37
-
38
-
39
- module RIO
40
- module Tempfile #:nodoc: all
41
- require 'rio/rl/ioi'
42
- require 'rio/scheme/path'
43
- RESET_STATE = RL::IOIBase::RESET_STATE
44
-
45
- require 'tmpdir'
46
- class RL < RL::IOIBase
47
- RIOSCHEME = 'tempfile'
48
- RIOPATH = RIO::RL::CHMAP.invert[RIOSCHEME]
49
- DFLT_PREFIX = 'rio'
50
- DFLT_TMPDIR = '/tmp' # ::Dir::tmpdir
51
- attr_reader :prefix,:tmpdir,:tmprl
52
- def initialize(file_prefix=DFLT_PREFIX,temp_dir=DFLT_TMPDIR)
53
- @prefix = file_prefix || DFLT_PREFIX
54
- @tmpdir = RIO::Path::RL.new(temp_dir || DFLT_TMPDIR)
55
- @tmprl = nil
56
- end
57
- def path()
58
- return @tmprl.path unless @tmprl.nil?
59
- RIOPATH
60
- end
61
- def fspath()
62
- return nil if @tmprl.nil?
63
- self.class.path_to_fspath(self.path)
64
- end
65
- def uri()
66
- return @tmprl.uri unless @tmprl.nil?
67
- nil
68
- end
69
- def url()
70
- return @tmprl.url unless @tmprl.nil?
71
- super
72
- end
73
- def opaque()
74
- td = @tmpdir.to_s
75
- td += '/' unless td.nil? or td.empty? or (td.ends_with?('/') and td != '/')
76
- td+@prefix
77
- end
78
- def open(mode='ignored',tf=nil,td=nil)
79
- require 'tempfile'
80
- tf ||= @prefix
81
- td ||= @tmpdir
82
- hnd = ::Tempfile.new( tf.to_s, td.to_s)
83
- @tmprl = RIO::Path::RL.new(RIO::RL::fs2url(hnd.path))
84
- hnd
85
- end
86
- def close()
87
- @tmprl = nil
88
- end
89
- SPLIT_RE = %r|(?:(.*)/)?([^/]*)$|.freeze
90
- def self.splitrl(s)
91
- sub,opq,whole = split_riorl(s)
92
- if opq.nil? or opq.empty?
93
- []
94
- elsif bm = SPLIT_RE.match(opq)
95
- tdir = bm[1] unless bm[1].nil? or bm[1].empty?
96
- tpfx = bm[2] unless bm[2].nil? or bm[2].empty?
97
- [tpfx,tdir]
98
- else
99
- []
100
- end
101
- end
102
- end
103
- end
104
- end