rio 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +140 -0
- data/Rakefile +1 -1
- data/VERSION +1 -1
- data/doc/ANNOUNCE +87 -0
- data/doc/RELEASE_NOTES +7 -0
- data/doc/rdoc/classes/Kernel.html +9 -9
- data/doc/rdoc/classes/Kernel.src/{M000183.html → M000182.html} +0 -0
- data/doc/rdoc/classes/RIO.html +35 -0
- data/doc/rdoc/classes/RIO.src/M000001.html +4 -4
- data/doc/rdoc/classes/RIO.src/M000002.html +4 -4
- data/doc/rdoc/classes/RIO.src/M000003.html +4 -4
- data/doc/rdoc/classes/RIO/Doc/HOWTO.html +11 -7
- data/doc/rdoc/classes/RIO/Doc/INTRO.html +255 -36
- data/doc/rdoc/classes/RIO/Doc/SYNOPSIS.html +47 -17
- data/doc/rdoc/classes/RIO/Rio.html +1032 -1007
- data/doc/rdoc/classes/RIO/Rio.src/M000011.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000012.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000013.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000014.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000015.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000016.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000017.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000018.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000019.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000020.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000021.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000022.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000023.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000024.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000025.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000026.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000027.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000028.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000029.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000030.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000031.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000032.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000033.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000034.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000035.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000036.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000037.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000038.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000039.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000040.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000041.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000042.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000043.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000044.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000045.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000046.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000047.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000048.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000049.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000050.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000051.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000052.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000053.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000054.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000055.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000056.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000057.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000058.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000059.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000060.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000061.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000062.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000063.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000064.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000065.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000066.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000067.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000068.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000069.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000070.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000071.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000072.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000073.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000074.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000075.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000076.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000077.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000078.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000079.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000080.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000081.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000082.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000083.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000084.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000085.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000086.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000087.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000088.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000089.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000090.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000091.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000092.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000093.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000094.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000095.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000096.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000097.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000098.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000099.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000100.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000101.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000102.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000103.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000104.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000105.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000106.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000107.html +2 -2
- data/doc/rdoc/classes/RIO/Rio.src/M000108.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000109.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000110.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000111.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000112.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000113.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000114.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000115.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000116.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000117.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000118.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000119.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000120.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000121.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000122.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000123.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000124.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000125.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000126.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000127.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000128.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000129.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000130.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000131.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000132.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000133.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000134.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000135.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000136.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000137.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000138.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000139.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000140.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000141.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000142.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000143.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000144.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000145.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000146.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000147.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000148.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000149.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000150.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000151.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000152.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000153.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000154.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000155.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000156.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000157.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000158.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000159.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000160.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000161.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000162.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000163.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000164.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000165.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000166.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000167.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000168.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000169.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000170.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000171.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000172.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000173.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000174.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000175.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000176.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000177.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000178.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000179.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000180.html +3 -3
- data/doc/rdoc/classes/RIO/Rio.src/M000181.html +3 -3
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/lib/rio/constructor_rb.html +1 -1
- data/doc/rdoc/files/lib/rio/doc/HOWTO_rb.html +1 -1
- data/doc/rdoc/files/lib/rio/doc/INTRO_rb.html +1 -1
- data/doc/rdoc/files/lib/rio/doc/SYNOPSIS_rb.html +1 -1
- data/doc/rdoc/files/lib/rio/if/basic_rb.html +1 -1
- data/doc/rdoc/files/lib/rio/if/path_rb.html +1 -1
- data/doc/rdoc/files/lib/rio_rb.html +1 -1
- data/doc/rdoc/fr_method_index.html +154 -155
- data/ex/findinruby +7 -3
- data/ex/findruby +6 -2
- data/lib/rio.rb +1 -1
- data/lib/rio/argv.rb +4 -0
- data/lib/rio/constructor.rb +17 -0
- data/lib/rio/context.rb +1 -1
- data/lib/rio/context/dir.rb +1 -0
- data/lib/rio/context/methods.rb +3 -3
- data/lib/rio/dir.rb +2 -2
- data/lib/rio/doc/HOWTO.rb +11 -6
- data/lib/rio/doc/INTRO.rb +149 -12
- data/lib/rio/doc/SYNOPSIS.rb +26 -13
- data/lib/rio/factory.rb +13 -2
- data/lib/rio/grande.rb +25 -0
- data/lib/rio/if/basic.rb +1 -1
- data/lib/rio/if/path.rb +61 -35
- data/lib/rio/matchrecord.rb +20 -1
- data/lib/rio/ops/dir.rb +2 -3
- data/lib/rio/ops/path.rb +25 -11
- data/lib/rio/ops/stream/input.rb +6 -3
- data/lib/rio/rl/base.rb +3 -2
- data/lib/rio/rl/ioi.rb +2 -1
- data/lib/rio/rl/path.rb +18 -3
- data/lib/rio/rl/uri.rb +8 -4
- data/lib/rio/scheme/cmdio.rb +1 -1
- data/lib/rio/scheme/path.rb +1 -0
- data/lib/rio/scheme/stdio.rb +1 -1
- data/lib/rio/scheme/strio.rb +1 -1
- data/lib/rio/scheme/sysio.rb +1 -1
- data/lib/rio/scheme/tcp.rb +1 -0
- data/lib/rio/scheme/temp.rb +184 -0
- data/lib/rio/state.rb +17 -6
- data/lib/rio/stream.rb +1 -1
- data/lib/rio/stream/open.rb +1 -1
- data/lib/rio/tempdir.rb +132 -0
- data/lib/rio/version.rb +1 -1
- data/test/tc/all.rb +4 -0
- data/test/tc/copylines.rb +38 -32
- data/test/tc/riorl.rb +104 -0
- data/test/tc/temp.rb +155 -0
- data/test/tc/tempdir.rb +63 -0
- data/test/tc/tempfile.rb +38 -0
- metadata +10 -5
- data/doc/rdoc/classes/RIO/Rio.src/M000182.html +0 -16
- 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.
|
7
|
-
date: 2005-08-
|
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/
|
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/
|
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>
|
data/lib/rio/scheme/tempfile.rb
DELETED
@@ -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
|