wishdev-rio 0.4.3.1
Sign up to get free protection for your applications and to get access to all the features.
- data/COPYING +341 -0
- data/README +81 -0
- data/Rakefile +281 -0
- data/build_doc.rb +94 -0
- data/doc/ANNOUNCE +159 -0
- data/doc/RELEASE_NOTES +308 -0
- data/doc/RIOIS +215 -0
- data/doc/generators/template/html/rio.css +428 -0
- data/doc/generators/template/html/rio.rb +523 -0
- data/doc/generators/template/html/ugly.rb +132 -0
- data/doc/pkg_def.rb +60 -0
- data/doc/rfc1738.txt +1403 -0
- data/doc/rfc959.txt +3933 -0
- data/ex/catcsv.rb +64 -0
- data/ex/colx.rb +8 -0
- data/ex/findinruby +15 -0
- data/ex/findruby +14 -0
- data/ex/passwd_report.rb +8 -0
- data/ex/prompt.rb +25 -0
- data/ex/rgb.txt.gz +0 -0
- data/ex/riocat +42 -0
- data/ex/riogunzip +31 -0
- data/ex/riogzip +24 -0
- data/ex/rioprompt.rb +10 -0
- data/ex/targz2zip +17 -0
- data/ex/tonl +10 -0
- data/lib/rio/abstract_method.rb +56 -0
- data/lib/rio/argv.rb +56 -0
- data/lib/rio/arycopy.rb +43 -0
- data/lib/rio/assert.rb +114 -0
- data/lib/rio/base.rb +56 -0
- data/lib/rio/callstr.rb +46 -0
- data/lib/rio/const.rb +51 -0
- data/lib/rio/construct.rb +50 -0
- data/lib/rio/constructor.rb +258 -0
- data/lib/rio/context/autoclose.rb +72 -0
- data/lib/rio/context/copying.rb +55 -0
- data/lib/rio/context/cxx.rb +66 -0
- data/lib/rio/context/dir.rb +120 -0
- data/lib/rio/context/gzip.rb +50 -0
- data/lib/rio/context/methods.rb +182 -0
- data/lib/rio/context/skip.rb +66 -0
- data/lib/rio/context/stream.rb +229 -0
- data/lib/rio/context.rb +117 -0
- data/lib/rio/cp.rb +370 -0
- data/lib/rio/def.rb +53 -0
- data/lib/rio/dir.rb +144 -0
- data/lib/rio/doc/EXAMPLES.rb +299 -0
- data/lib/rio/doc/HOWTO.rb +737 -0
- data/lib/rio/doc/INDEX.rb +311 -0
- data/lib/rio/doc/INTRO.rb +1068 -0
- data/lib/rio/doc/OPTIONAL.rb +130 -0
- data/lib/rio/doc/SYNOPSIS.rb +183 -0
- data/lib/rio/doc.rb +45 -0
- data/lib/rio/entrysel.rb +246 -0
- data/lib/rio/exception/copy.rb +97 -0
- data/lib/rio/exception/notimplemented.rb +57 -0
- data/lib/rio/exception/notsupported.rb +46 -0
- data/lib/rio/exception/open.rb +61 -0
- data/lib/rio/exception/state.rb +73 -0
- data/lib/rio/exception.rb +41 -0
- data/lib/rio/ext/csv.rb +351 -0
- data/lib/rio/ext/if.rb +45 -0
- data/lib/rio/ext/mp3info.rb +80 -0
- data/lib/rio/ext/splitlines.rb +253 -0
- data/lib/rio/ext/yaml/doc.rb +133 -0
- data/lib/rio/ext/yaml/tie.rb +149 -0
- data/lib/rio/ext/yaml.rb +164 -0
- data/lib/rio/ext/zipfile/fs.rb +116 -0
- data/lib/rio/ext/zipfile/rl.rb +251 -0
- data/lib/rio/ext/zipfile/rootdir.rb +117 -0
- data/lib/rio/ext/zipfile/state.rb +161 -0
- data/lib/rio/ext/zipfile/wrap.rb +204 -0
- data/lib/rio/ext/zipfile.rb +110 -0
- data/lib/rio/ext.rb +138 -0
- data/lib/rio/factory.rb +436 -0
- data/lib/rio/file.rb +118 -0
- data/lib/rio/filter/closeoneof.rb +103 -0
- data/lib/rio/filter/gzip.rb +70 -0
- data/lib/rio/filter.rb +94 -0
- data/lib/rio/fs/base.rb +41 -0
- data/lib/rio/fs/impl.rb +122 -0
- data/lib/rio/fs/native.rb +75 -0
- data/lib/rio/fs/stream.rb +61 -0
- data/lib/rio/fs/url.rb +63 -0
- data/lib/rio/ftp/conncache.rb +101 -0
- data/lib/rio/ftp/dir.rb +94 -0
- data/lib/rio/ftp/fs.rb +180 -0
- data/lib/rio/ftp/ftpfile.rb +20 -0
- data/lib/rio/grande.rb +97 -0
- data/lib/rio/handle.rb +100 -0
- data/lib/rio/if/basic.rb +64 -0
- data/lib/rio/if/csv.rb +76 -0
- data/lib/rio/if/dir.rb +157 -0
- data/lib/rio/if/file.rb +89 -0
- data/lib/rio/if/fileordir.rb +268 -0
- data/lib/rio/if/grande.rb +729 -0
- data/lib/rio/if/grande_entry.rb +379 -0
- data/lib/rio/if/grande_stream.rb +693 -0
- data/lib/rio/if/internal.rb +125 -0
- data/lib/rio/if/path.rb +462 -0
- data/lib/rio/if/rubyio.rb +681 -0
- data/lib/rio/if/string.rb +83 -0
- data/lib/rio/if/temp.rb +45 -0
- data/lib/rio/if/test.rb +282 -0
- data/lib/rio/if/yaml.rb +206 -0
- data/lib/rio/if.rb +64 -0
- data/lib/rio/ioh.rb +162 -0
- data/lib/rio/iomode.rb +109 -0
- data/lib/rio/ios/fail.rb +106 -0
- data/lib/rio/ios/generic.rb +119 -0
- data/lib/rio/ios/mode.rb +60 -0
- data/lib/rio/ios/null.rb +119 -0
- data/lib/rio/iowrap.rb +128 -0
- data/lib/rio/kernel.rb +54 -0
- data/lib/rio/local.rb +62 -0
- data/lib/rio/match.rb +53 -0
- data/lib/rio/matchrecord.rb +283 -0
- data/lib/rio/no_warn.rb +49 -0
- data/lib/rio/nullio.rb +159 -0
- data/lib/rio/open3.rb +68 -0
- data/lib/rio/ops/construct.rb +61 -0
- data/lib/rio/ops/create.rb +77 -0
- data/lib/rio/ops/dir.rb +346 -0
- data/lib/rio/ops/either.rb +134 -0
- data/lib/rio/ops/file.rb +102 -0
- data/lib/rio/ops/path.rb +296 -0
- data/lib/rio/ops/stream/input.rb +267 -0
- data/lib/rio/ops/stream/output.rb +100 -0
- data/lib/rio/ops/stream/read.rb +86 -0
- data/lib/rio/ops/stream/write.rb +57 -0
- data/lib/rio/ops/stream.rb +87 -0
- data/lib/rio/ops/symlink.rb +80 -0
- data/lib/rio/path/reset.rb +69 -0
- data/lib/rio/path.rb +129 -0
- data/lib/rio/piper/cp.rb +80 -0
- data/lib/rio/piper.rb +122 -0
- data/lib/rio/prompt.rb +66 -0
- data/lib/rio/rectype.rb +88 -0
- data/lib/rio/rl/base.rb +118 -0
- data/lib/rio/rl/builder.rb +117 -0
- data/lib/rio/rl/chmap.rb +66 -0
- data/lib/rio/rl/fs2url.rb +82 -0
- data/lib/rio/rl/ioi.rb +78 -0
- data/lib/rio/rl/path.rb +110 -0
- data/lib/rio/rl/pathmethods.rb +116 -0
- data/lib/rio/rl/uri.rb +200 -0
- data/lib/rio/rl/withpath.rb +296 -0
- data/lib/rio/scheme/aryio.rb +88 -0
- data/lib/rio/scheme/cmdio.rb +80 -0
- data/lib/rio/scheme/cmdpipe.rb +118 -0
- data/lib/rio/scheme/fd.rb +65 -0
- data/lib/rio/scheme/ftp.rb +141 -0
- data/lib/rio/scheme/http.rb +78 -0
- data/lib/rio/scheme/null.rb +55 -0
- data/lib/rio/scheme/path.rb +98 -0
- data/lib/rio/scheme/stderr.rb +55 -0
- data/lib/rio/scheme/stdio.rb +71 -0
- data/lib/rio/scheme/strio.rb +87 -0
- data/lib/rio/scheme/sysio.rb +63 -0
- data/lib/rio/scheme/tcp.rb +75 -0
- data/lib/rio/scheme/temp.rb +200 -0
- data/lib/rio/state/error.rb +72 -0
- data/lib/rio/state.rb +242 -0
- data/lib/rio/stream/base.rb +54 -0
- data/lib/rio/stream/duplex.rb +79 -0
- data/lib/rio/stream/open.rb +202 -0
- data/lib/rio/stream.rb +181 -0
- data/lib/rio/symantics.rb +45 -0
- data/lib/rio/tempdir.rb +132 -0
- data/lib/rio/to_rio/all.rb +39 -0
- data/lib/rio/to_rio/array.rb +39 -0
- data/lib/rio/to_rio/io.rb +40 -0
- data/lib/rio/to_rio/object.rb +42 -0
- data/lib/rio/to_rio/string.rb +40 -0
- data/lib/rio/to_rio.rb +67 -0
- data/lib/rio/uri/file.rb +198 -0
- data/lib/rio/util.rb +48 -0
- data/lib/rio/version.rb +51 -0
- data/lib/rio.rb +162 -0
- data/setup.rb +1360 -0
- data/test/bin/count_lines.rb +11 -0
- data/test/bin/find_lines.rb +13 -0
- data/test/bin/list_dir.rb +14 -0
- data/test/ftp/all.rb +9 -0
- data/test/ftp/anon_copy_data.rb +36 -0
- data/test/ftp/anon_misc.rb +124 -0
- data/test/ftp/anon_read.rb +105 -0
- data/test/ftp/anon_special.rb +68 -0
- data/test/ftp/anon_write.rb +70 -0
- data/test/ftp/ftp2ftp.rb +51 -0
- data/test/ftp/initftpfiles.rb +14 -0
- data/test/ftp/testdef.rb +55 -0
- data/test/gem_runtests.rb +15 -0
- data/test/http/all.rb +4 -0
- data/test/http/copy-from-http.rb +141 -0
- data/test/http/uri-meta.rb +72 -0
- data/test/lib/temp_server.rb +46 -0
- data/test/runalltests.rb +17 -0
- data/test/runftptests.rb +14 -0
- data/test/runhttp.rb +11 -0
- data/test/runhttptests.rb +14 -0
- data/test/runtests.rb +52 -0
- data/test/tc/abs.rb +355 -0
- data/test/tc/all.rb +80 -0
- data/test/tc/base.rb +31 -0
- data/test/tc/base2.rb +87 -0
- data/test/tc/cd1.rb +113 -0
- data/test/tc/clearsel.rb +68 -0
- data/test/tc/clone.rb +208 -0
- data/test/tc/closeoncopy.rb +102 -0
- data/test/tc/closeoneof.rb +194 -0
- data/test/tc/cmdpipe.rb +149 -0
- data/test/tc/copy-dir-samevar.rb +91 -0
- data/test/tc/copy-from.rb +129 -0
- data/test/tc/copy-to.rb +91 -0
- data/test/tc/copy.rb +74 -0
- data/test/tc/copyarray.rb +188 -0
- data/test/tc/copydest.rb +50 -0
- data/test/tc/copydir.rb +166 -0
- data/test/tc/copydirlines.rb +121 -0
- data/test/tc/copylines.rb +46 -0
- data/test/tc/copynonex.rb +118 -0
- data/test/tc/copysymlink.rb +39 -0
- data/test/tc/create.rb +114 -0
- data/test/tc/csv.rb +226 -0
- data/test/tc/csv2.rb +138 -0
- data/test/tc/csv_columns.rb +37 -0
- data/test/tc/csvutil.rb +56 -0
- data/test/tc/dir.rb +76 -0
- data/test/tc/dir_iter.rb +383 -0
- data/test/tc/dirautoclose.rb +67 -0
- data/test/tc/dirent.rb +178 -0
- data/test/tc/dirss.rb +81 -0
- data/test/tc/each.rb +111 -0
- data/test/tc/each_break.rb +243 -0
- data/test/tc/edf.rb +81 -0
- data/test/tc/empty.rb +51 -0
- data/test/tc/emptyriodir.rb +129 -0
- data/test/tc/entary.rb +227 -0
- data/test/tc/entsel.rb +110 -0
- data/test/tc/eq.rb +101 -0
- data/test/tc/expand_path.rb +69 -0
- data/test/tc/ext.rb +136 -0
- data/test/tc/fileno.rb +94 -0
- data/test/tc/files_select.rb +92 -0
- data/test/tc/get.rb +152 -0
- data/test/tc/getrec.rb +137 -0
- data/test/tc/gzip.rb +109 -0
- data/test/tc/io_each_byte.rb +60 -0
- data/test/tc/io_read.rb +80 -0
- data/test/tc/iometh.rb +149 -0
- data/test/tc/likeio.rb +116 -0
- data/test/tc/line_record_row.rb +51 -0
- data/test/tc/lineno.rb +196 -0
- data/test/tc/lines.rb +66 -0
- data/test/tc/misc.rb +432 -0
- data/test/tc/nolines.rb +204 -0
- data/test/tc/noqae.rb +879 -0
- data/test/tc/null.rb +45 -0
- data/test/tc/once.rb +6 -0
- data/test/tc/overload.rb +140 -0
- data/test/tc/pa.rb +158 -0
- data/test/tc/path_parts.rb +175 -0
- data/test/tc/pathop.rb +60 -0
- data/test/tc/paths.rb +145 -0
- data/test/tc/pid.rb +31 -0
- data/test/tc/piper.rb +143 -0
- data/test/tc/programs_util.rb +24 -0
- data/test/tc/qae.rb +493 -0
- data/test/tc/qae_riovar.rb +499 -0
- data/test/tc/readline.rb +30 -0
- data/test/tc/records.rb +68 -0
- data/test/tc/rename.rb +233 -0
- data/test/tc/rename_assign.rb +45 -0
- data/test/tc/riorl.rb +181 -0
- data/test/tc/route.rb +51 -0
- data/test/tc/selnosel.rb +33 -0
- data/test/tc/skip.rb +89 -0
- data/test/tc/skiplines.rb +71 -0
- data/test/tc/split.rb +28 -0
- data/test/tc/splitlines.rb +65 -0
- data/test/tc/splitpath.rb +83 -0
- data/test/tc/sub.rb +46 -0
- data/test/tc/symlink.rb +176 -0
- data/test/tc/symlink0.rb +348 -0
- data/test/tc/symlink1.rb +114 -0
- data/test/tc/synopsis.rb +75 -0
- data/test/tc/temp.rb +152 -0
- data/test/tc/tempdir.rb +60 -0
- data/test/tc/tempfile.rb +66 -0
- data/test/tc/testcase.rb +170 -0
- data/test/tc/tonl.rb +37 -0
- data/test/tc/truncate.rb +39 -0
- data/test/tc/yaml.rb +275 -0
- metadata +387 -0
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/ruby
|
2
|
+
Dir.chdir File.dirname(__FILE__)
|
3
|
+
$devlib=File.expand_path('../lib/')
|
4
|
+
$:.unshift $devlib unless $:[0] == $devlib
|
5
|
+
|
6
|
+
$mswin32 = (RUBY_PLATFORM =~ /mswin32/)
|
7
|
+
|
8
|
+
require 'rio'
|
9
|
+
require 'test/unit'
|
10
|
+
|
11
|
+
require 'http/all'
|
12
|
+
$trace_states = false
|
13
|
+
require 'test/unit/ui/console/testrunner'
|
14
|
+
#require 'test/unit/ui/tk/testrunner'
|
data/test/runtests.rb
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
#!/usr/local/bin/ruby
|
2
|
+
Dir.chdir File.dirname(__FILE__)
|
3
|
+
$devlib=File.expand_path('../lib/')
|
4
|
+
$:.unshift $devlib unless $:[0] == $devlib
|
5
|
+
|
6
|
+
$mswin32 = (RUBY_PLATFORM =~ /mswin32/)
|
7
|
+
|
8
|
+
require 'rio'
|
9
|
+
|
10
|
+
$trace_states = false
|
11
|
+
require 'optparse'
|
12
|
+
|
13
|
+
options = {}
|
14
|
+
OptionParser.new do |opts|
|
15
|
+
opts.banner = "Usage: #{$0} [options]"
|
16
|
+
|
17
|
+
opts.on("-f", "--ftp", "Run FTP Tests") do |v|
|
18
|
+
options[:ftp] = v
|
19
|
+
end
|
20
|
+
opts.on("-h", "--http", "Run HTTP Tests") do |v|
|
21
|
+
options[:http] = v
|
22
|
+
end
|
23
|
+
opts.on("-s", "--std", "Run Standard Tests") do |v|
|
24
|
+
options[:std] = v
|
25
|
+
end
|
26
|
+
opts.on("-a", "--all", "Run All Tests") do |v|
|
27
|
+
options[:std] = v
|
28
|
+
options[:ftp] = v
|
29
|
+
options[:http] = v
|
30
|
+
end
|
31
|
+
end.parse!
|
32
|
+
|
33
|
+
options[:std] = true if options.empty?
|
34
|
+
|
35
|
+
options.keys.each do |opt|
|
36
|
+
case opt
|
37
|
+
when :std
|
38
|
+
require 'tc/all'
|
39
|
+
require 'test/unit/ui/console/testrunner'
|
40
|
+
when :http
|
41
|
+
require 'lib/temp_server.rb'
|
42
|
+
TempServer.new.run('runhttptests.rb')
|
43
|
+
when :ftp
|
44
|
+
require 'test/unit'
|
45
|
+
require 'ftp/all'
|
46
|
+
require 'test/unit/ui/console/testrunner'
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
#require 'test/unit/ui/tk/testrunner'
|
51
|
+
#require 'test/unit/ui/fox/testrunner'
|
52
|
+
#Test::Unit::UI::Tk::TestRunner.run(TC_MyTest)
|
data/test/tc/abs.rb
ADDED
@@ -0,0 +1,355 @@
|
|
1
|
+
#!/usr/local/bin/ruby
|
2
|
+
if $0 == __FILE__
|
3
|
+
Dir.chdir File.dirname(__FILE__)+'/../'
|
4
|
+
$:.unshift File.expand_path('../lib/')
|
5
|
+
end
|
6
|
+
require 'rio'
|
7
|
+
require 'test/unit'
|
8
|
+
require 'test/unit/testsuite'
|
9
|
+
|
10
|
+
class TC_RIO_abs < Test::Unit::TestCase
|
11
|
+
def test_abs
|
12
|
+
rio('qp/test_abs').rmtree.mkpath.chdir {
|
13
|
+
|
14
|
+
|
15
|
+
require 'uri'
|
16
|
+
|
17
|
+
hdurl = 'http://localhost/'
|
18
|
+
hduri = ::URI.parse(hdurl)
|
19
|
+
hd = rio(hduri)
|
20
|
+
assert_equal('/',hd.path)
|
21
|
+
assert_equal('/',hd.fspath)
|
22
|
+
assert_equal('http',hd.scheme)
|
23
|
+
assert_equal('localhost',hd.host)
|
24
|
+
assert_equal(true,hd.abs?)
|
25
|
+
assert_equal(true,hd.absolute?)
|
26
|
+
assert_equal(hdurl,hd.abs.to_url)
|
27
|
+
|
28
|
+
hdurl = 'http://localhost/'
|
29
|
+
hd = rio(hdurl)
|
30
|
+
assert_equal('/',hd.path)
|
31
|
+
assert_equal('/',hd.fspath)
|
32
|
+
assert_equal('http',hd.scheme)
|
33
|
+
assert_equal('localhost',hd.host)
|
34
|
+
assert_equal(true,hd.abs?)
|
35
|
+
assert_equal(true,hd.absolute?)
|
36
|
+
assert_equal(hdurl,hd.abs.to_url)
|
37
|
+
|
38
|
+
hdurl = 'http://localhost'
|
39
|
+
hduri = ::URI.parse(hdurl)
|
40
|
+
hd = rio(hduri)
|
41
|
+
assert_equal('/',hd.path)
|
42
|
+
assert_equal('/',hd.fspath)
|
43
|
+
assert_equal('http',hd.scheme)
|
44
|
+
assert_equal('localhost',hd.host)
|
45
|
+
assert_equal(true,hd.abs?)
|
46
|
+
assert_equal(true,hd.absolute?)
|
47
|
+
assert_equal(hdurl+'/',hd.abs.to_url)
|
48
|
+
|
49
|
+
hdurl = 'http://localhost'
|
50
|
+
hd = rio(hdurl)
|
51
|
+
assert_equal('/',hd.path)
|
52
|
+
assert_equal('/',hd.fspath)
|
53
|
+
assert_equal('http',hd.scheme)
|
54
|
+
assert_equal('localhost',hd.host)
|
55
|
+
assert_equal(true,hd.abs?)
|
56
|
+
assert_equal(true,hd.absolute?)
|
57
|
+
assert_equal(hdurl+'/',hd.abs.to_url)
|
58
|
+
|
59
|
+
hdurl = 'http://localhost/rio/hw.html'
|
60
|
+
hd = rio(hdurl)
|
61
|
+
assert_equal('/rio/hw.html',hd.path)
|
62
|
+
assert_equal('/rio/hw.html',hd.fspath)
|
63
|
+
assert_equal('http',hd.scheme)
|
64
|
+
assert_equal('localhost',hd.host)
|
65
|
+
assert_equal(true,hd.abs?)
|
66
|
+
assert_equal(true,hd.absolute?)
|
67
|
+
assert_equal(hdurl,hd.abs.to_url)
|
68
|
+
|
69
|
+
hdurl = 'file://localhost/'
|
70
|
+
hduri = ::URI.parse(hdurl)
|
71
|
+
hd = rio(hduri)
|
72
|
+
assert_equal('/',hd.path)
|
73
|
+
assert_equal('/',hd.fspath)
|
74
|
+
assert_equal('file',hd.scheme)
|
75
|
+
assert_equal('localhost',hd.host)
|
76
|
+
assert_equal(true,hd.abs?)
|
77
|
+
assert_equal(true,hd.absolute?)
|
78
|
+
assert_equal(hdurl,hd.to_url)
|
79
|
+
assert_equal(hdurl,hd.abs.to_url)
|
80
|
+
|
81
|
+
hdurl = 'file://localhost/'
|
82
|
+
|
83
|
+
hd = rio(hdurl)
|
84
|
+
assert_equal('/',hd.path)
|
85
|
+
assert_equal('/',hd.fspath)
|
86
|
+
assert_equal('file',hd.scheme)
|
87
|
+
assert_equal('localhost',hd.host)
|
88
|
+
assert_equal(true,hd.abs?)
|
89
|
+
assert_equal(true,hd.absolute?)
|
90
|
+
assert_equal(hdurl,hd.to_url)
|
91
|
+
assert_equal(hdurl,hd.abs.to_url)
|
92
|
+
|
93
|
+
hdurl = 'file://localhost'
|
94
|
+
hduri = ::URI.parse(hdurl)
|
95
|
+
hd = rio(hduri)
|
96
|
+
assert_equal('/',hd.path)
|
97
|
+
assert_equal('/',hd.fspath)
|
98
|
+
assert_equal('file',hd.scheme)
|
99
|
+
assert_equal('localhost',hd.host)
|
100
|
+
assert_equal(true,hd.abs?)
|
101
|
+
assert_equal(true,hd.absolute?)
|
102
|
+
assert_equal(hdurl+'/',hd.to_url)
|
103
|
+
assert_equal(hdurl+'/',hd.abs.to_url)
|
104
|
+
|
105
|
+
hdurl = 'file://localhost'
|
106
|
+
hd = rio(hdurl)
|
107
|
+
assert_equal('/',hd.path)
|
108
|
+
assert_equal('/',hd.fspath)
|
109
|
+
assert_equal('file',hd.scheme)
|
110
|
+
assert_equal('localhost',hd.host)
|
111
|
+
assert_equal(true,hd.abs?)
|
112
|
+
assert_equal(true,hd.absolute?)
|
113
|
+
assert_equal(hdurl+'/',hd.to_url)
|
114
|
+
assert_equal(hdurl+'/',hd.abs.to_url)
|
115
|
+
|
116
|
+
hdurl = 'file:///'
|
117
|
+
hduri = ::URI.parse(hdurl)
|
118
|
+
hd = rio(hduri)
|
119
|
+
assert_equal('/',hd.path)
|
120
|
+
assert_equal('/',hd.fspath)
|
121
|
+
assert_equal('file',hd.scheme)
|
122
|
+
assert_equal('',hd.host)
|
123
|
+
assert_equal(true,hd.abs?)
|
124
|
+
assert_equal(true,hd.absolute?)
|
125
|
+
assert_equal(hdurl,hd.to_url)
|
126
|
+
assert_equal(hdurl,hd.abs.to_url)
|
127
|
+
|
128
|
+
hdurl = 'file:///'
|
129
|
+
hd = rio(hdurl)
|
130
|
+
assert_equal('/',hd.path)
|
131
|
+
assert_equal('/',hd.fspath)
|
132
|
+
assert_equal('file',hd.scheme)
|
133
|
+
assert_equal('',hd.host)
|
134
|
+
assert_equal(true,hd.abs?)
|
135
|
+
assert_equal(true,hd.absolute?)
|
136
|
+
assert_equal(hdurl,hd.to_url)
|
137
|
+
assert_equal(hdurl,hd.abs.to_url)
|
138
|
+
|
139
|
+
hdurl = '/'
|
140
|
+
hd = rio(hdurl)
|
141
|
+
assert_equal('/',hd.path)
|
142
|
+
assert_equal('/',hd.fspath)
|
143
|
+
assert_equal('file',hd.scheme)
|
144
|
+
assert_equal('',hd.host)
|
145
|
+
assert_equal(true,hd.abs?)
|
146
|
+
assert_equal(true,hd.absolute?)
|
147
|
+
assert_equal(hdurl,hd.abs.to_s)
|
148
|
+
assert_equal('file:///',hd.to_url)
|
149
|
+
assert_equal('file:///',hd.abs.to_url)
|
150
|
+
require 'tmpdir'
|
151
|
+
|
152
|
+
hdurl = '/tmp'
|
153
|
+
hdurl = '/WINDOWS' unless FileTest.directory?(hdurl)
|
154
|
+
hd = rio(hdurl)
|
155
|
+
# assert_equal(hdurl+'/',hd.path)
|
156
|
+
assert_equal(hdurl,hd.fspath)
|
157
|
+
assert_equal('file',hd.scheme)
|
158
|
+
assert_equal('',hd.host)
|
159
|
+
assert_equal(true,hd.abs?)
|
160
|
+
assert_equal(true,hd.absolute?)
|
161
|
+
assert_equal(hdurl,hd.abs.to_s)
|
162
|
+
# assert_equal('file://'+hdurl+'/',hd.to_url)
|
163
|
+
# assert_equal('file://'+hdurl+'/',hd.abs.to_url)
|
164
|
+
|
165
|
+
hdurl = '/tmp/'
|
166
|
+
hd = rio(hdurl)
|
167
|
+
assert_equal('/tmp/',hd.path)
|
168
|
+
assert_equal('/tmp/',hd.fspath)
|
169
|
+
assert_equal('file',hd.scheme)
|
170
|
+
assert_equal('',hd.host)
|
171
|
+
assert_equal(true,hd.abs?)
|
172
|
+
assert_equal(true,hd.absolute?)
|
173
|
+
assert_equal(hdurl,hd.abs.to_s)
|
174
|
+
assert_equal('file:///tmp/',hd.to_url)
|
175
|
+
assert_equal('file:///tmp/',hd.abs.to_url)
|
176
|
+
|
177
|
+
# case qp dir does not exist
|
178
|
+
rio('qp').delete!
|
179
|
+
hdurl = 'qp'
|
180
|
+
hd = rio(hdurl)
|
181
|
+
assert_equal('qp',hd.path)
|
182
|
+
assert_equal('qp',hd.fspath)
|
183
|
+
assert_equal('path',hd.scheme)
|
184
|
+
assert_nil(hd.host)
|
185
|
+
assert_equal(false,hd.abs?)
|
186
|
+
assert_equal(false,hd.absolute?)
|
187
|
+
cwd = ::Dir.getwd
|
188
|
+
assert_equal(cwd+'/'+hdurl,hd.abs.to_s)
|
189
|
+
assert_equal('path:qp',hd.to_url)
|
190
|
+
|
191
|
+
assert_equal('file://'+RIO::RL.fs2url(cwd)+'/'+hdurl,hd.abs.to_url)
|
192
|
+
|
193
|
+
hdurl = 'qp/'
|
194
|
+
hd = rio(hdurl)
|
195
|
+
assert_equal('qp/',hd.path)
|
196
|
+
assert_equal('qp/',hd.fspath)
|
197
|
+
assert_equal('path',hd.scheme)
|
198
|
+
assert_nil(hd.host)
|
199
|
+
assert_equal(false,hd.abs?)
|
200
|
+
assert_equal(false,hd.absolute?)
|
201
|
+
cwd = ::Dir.getwd
|
202
|
+
assert_equal(cwd+'/'+hdurl,hd.abs.to_s)
|
203
|
+
assert_equal('path:qp/',hd.to_url)
|
204
|
+
assert_equal('file://'+RIO::RL.fs2url(cwd)+'/'+hdurl,hd.abs.to_url)
|
205
|
+
|
206
|
+
# case qp dir exists
|
207
|
+
rio('qp').mkdir
|
208
|
+
|
209
|
+
hdurl = 'qp'
|
210
|
+
hd = rio(hdurl)
|
211
|
+
# assert_equal('qp/',hd.path)
|
212
|
+
assert_equal('qp',hd.fspath)
|
213
|
+
assert_equal('path',hd.scheme)
|
214
|
+
assert_nil(hd.host)
|
215
|
+
assert_equal(false,hd.abs?)
|
216
|
+
assert_equal(false,hd.absolute?)
|
217
|
+
cwd = ::Dir.getwd
|
218
|
+
assert_equal(cwd+'/'+hdurl,hd.abs.to_s)
|
219
|
+
assert_equal('path:qp',hd.to_url)
|
220
|
+
assert_equal('file://'+RIO::RL.fs2url(cwd)+'/'+hdurl,hd.abs.to_url)
|
221
|
+
|
222
|
+
hdurl = 'qp/'
|
223
|
+
hd = rio(hdurl)
|
224
|
+
assert_equal('qp/',hd.path)
|
225
|
+
assert_equal('qp/',hd.fspath)
|
226
|
+
assert_equal('path',hd.scheme)
|
227
|
+
assert_nil(hd.host)
|
228
|
+
assert_equal(false,hd.abs?)
|
229
|
+
assert_equal(false,hd.absolute?)
|
230
|
+
cwd = ::Dir.getwd
|
231
|
+
assert_equal(cwd+'/'+hdurl,hd.abs.to_s)
|
232
|
+
assert_equal('path:qp/',hd.to_url)
|
233
|
+
assert_equal('file://'+RIO::RL.fs2url(cwd)+'/'+hdurl,hd.abs.to_url)
|
234
|
+
|
235
|
+
# case qp file exists
|
236
|
+
rio('qp').rmtree.touch
|
237
|
+
|
238
|
+
hdurl = 'qp'
|
239
|
+
hd = rio(hdurl)
|
240
|
+
assert_equal('qp',hd.path)
|
241
|
+
assert_equal('qp',hd.fspath)
|
242
|
+
assert_equal('path',hd.scheme)
|
243
|
+
assert_nil(hd.host)
|
244
|
+
assert_equal(false,hd.abs?)
|
245
|
+
assert_equal(false,hd.absolute?)
|
246
|
+
cwd = ::Dir.getwd
|
247
|
+
assert_equal(cwd+'/'+hdurl,hd.abs.to_s)
|
248
|
+
assert_equal('path:qp',hd.to_url)
|
249
|
+
assert_equal('file://'+RIO::RL.fs2url(cwd)+'/'+hdurl,hd.abs.to_url)
|
250
|
+
|
251
|
+
io = RIO.root
|
252
|
+
assert_kind_of(RIO::Rio,io)
|
253
|
+
assert_equal('/',io.to_s)
|
254
|
+
|
255
|
+
|
256
|
+
z = RIO.rio(RIO.root,%w/tmp zippy/)
|
257
|
+
assert_kind_of(RIO::Rio,z)
|
258
|
+
assert_equal('/tmp/zippy',z.to_s)
|
259
|
+
|
260
|
+
|
261
|
+
io = RIO.cwd
|
262
|
+
assert_kind_of(RIO::Rio,io)
|
263
|
+
cwd = ::Dir.getwd
|
264
|
+
assert_equal(cwd,io.path)
|
265
|
+
|
266
|
+
io = RIO.cwd
|
267
|
+
assert_kind_of(RIO::Rio,io)
|
268
|
+
cwd = ::Dir.getwd
|
269
|
+
assert_equal(cwd,io.to_s)
|
270
|
+
|
271
|
+
io = RIO.root/'tmp'
|
272
|
+
assert_kind_of(RIO::Rio,io)
|
273
|
+
assert_equal('/tmp',io.to_s)
|
274
|
+
|
275
|
+
tmp = RIO.root('tmp')
|
276
|
+
assert_kind_of(RIO::Rio,tmp)
|
277
|
+
assert_equal('/tmp',tmp.to_s)
|
278
|
+
|
279
|
+
z = tmp.join('zippy')
|
280
|
+
assert_kind_of(RIO::Rio,z)
|
281
|
+
assert_equal('/tmp/zippy',z.to_s)
|
282
|
+
|
283
|
+
z = tmp/'zippy'
|
284
|
+
assert_kind_of(RIO::Rio,z)
|
285
|
+
assert_equal('/tmp/zippy',z.to_s)
|
286
|
+
|
287
|
+
z = RIO.rio('/tmp/zippy')
|
288
|
+
assert_kind_of(RIO::Rio,z)
|
289
|
+
assert_equal('/tmp/zippy',z.to_s)
|
290
|
+
|
291
|
+
z = RIO.rio(tmp,'zippy')
|
292
|
+
assert_kind_of(RIO::Rio,z)
|
293
|
+
assert_equal('/tmp/zippy',z.to_s)
|
294
|
+
|
295
|
+
z = RIO.rio(RIO.root,%w/tmp zippy/)
|
296
|
+
assert_kind_of(RIO::Rio,z)
|
297
|
+
assert_equal('/tmp/zippy',z.to_s)
|
298
|
+
|
299
|
+
z = RIO.rio(tmp)/'zippy'
|
300
|
+
assert_kind_of(RIO::Rio,z)
|
301
|
+
assert_equal('/tmp/zippy',z.to_s)
|
302
|
+
|
303
|
+
z = rio('/tmp/zippy')
|
304
|
+
assert_kind_of(RIO::Rio,z)
|
305
|
+
assert_equal('/tmp/zippy',z.to_s)
|
306
|
+
|
307
|
+
z = rio(tmp,'zippy')
|
308
|
+
assert_kind_of(RIO::Rio,z)
|
309
|
+
assert_equal('/tmp/zippy',z.to_s)
|
310
|
+
|
311
|
+
z = rio(RIO.root,%w/tmp zippy/)
|
312
|
+
assert_kind_of(RIO::Rio,z)
|
313
|
+
assert_equal('/tmp/zippy',z.to_s)
|
314
|
+
|
315
|
+
z = rio(tmp).join('zippy')
|
316
|
+
assert_kind_of(RIO::Rio,z)
|
317
|
+
assert_equal('/tmp/zippy',z.to_s)
|
318
|
+
|
319
|
+
require 'rio/uri/file'
|
320
|
+
z = rio(URI('zippy/f.html'))
|
321
|
+
assert_kind_of(RIO::Rio,z)
|
322
|
+
assert_equal('zippy/f.html',z.to_s)
|
323
|
+
|
324
|
+
z = rio(URI("file:///tmp/zippy/f.html"))
|
325
|
+
assert_kind_of(RIO::Rio,z)
|
326
|
+
assert_equal('/tmp/zippy/f.html',z.to_s)
|
327
|
+
|
328
|
+
z = rio("file:///tmp/zippy/f.html")
|
329
|
+
assert_kind_of(RIO::Rio,z)
|
330
|
+
assert_equal('/tmp/zippy/f.html',z.to_s)
|
331
|
+
|
332
|
+
z = rio("file:///tmp/","zippy/f.html")
|
333
|
+
assert_kind_of(RIO::Rio,z)
|
334
|
+
assert_equal('/tmp/zippy/f.html',z.to_s)
|
335
|
+
|
336
|
+
u = URI('zippy/f.html')
|
337
|
+
|
338
|
+
z = rio("file:///tmp/",u)
|
339
|
+
assert_kind_of(RIO::Rio,z)
|
340
|
+
assert_equal('/tmp/zippy/f.html',z.to_s)
|
341
|
+
|
342
|
+
z = rio("file:///tmp/",RIO::RL::Builder.build(u))
|
343
|
+
assert_kind_of(RIO::Rio,z)
|
344
|
+
assert_equal('/tmp/zippy/f.html',z.to_s)
|
345
|
+
|
346
|
+
z = rio("file:///tmp/",rio(u))
|
347
|
+
assert_kind_of(RIO::Rio,z)
|
348
|
+
assert_equal('/tmp/zippy/f.html',z.to_s)
|
349
|
+
|
350
|
+
z = rio("/tmp",rio(u))
|
351
|
+
assert_kind_of(RIO::Rio,z)
|
352
|
+
assert_equal('/tmp/zippy/f.html',z.to_s)
|
353
|
+
}
|
354
|
+
end
|
355
|
+
end
|
data/test/tc/all.rb
ADDED
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'test/unit'
|
2
|
+
require 'tc/testcase'
|
3
|
+
|
4
|
+
require 'tc/yaml'
|
5
|
+
require 'tc/truncate'
|
6
|
+
require 'tc/line_record_row'
|
7
|
+
require 'tc/path_parts'
|
8
|
+
require 'tc/abs'
|
9
|
+
require 'tc/tonl'
|
10
|
+
require 'tc/files_select'
|
11
|
+
require 'tc/emptyriodir'
|
12
|
+
require 'tc/entsel'
|
13
|
+
require 'tc/base'
|
14
|
+
require 'tc/base2'
|
15
|
+
require 'tc/clearsel'
|
16
|
+
require 'tc/closeoncopy'
|
17
|
+
require 'tc/closeoneof'
|
18
|
+
require 'tc/cmdpipe'
|
19
|
+
require 'tc/copy'
|
20
|
+
require 'tc/copy-from'
|
21
|
+
require 'tc/copy-to'
|
22
|
+
require 'tc/copyarray'
|
23
|
+
require 'tc/copydest'
|
24
|
+
require 'tc/copydir'
|
25
|
+
require 'tc/copy-dir-samevar'
|
26
|
+
require 'tc/copydirlines'
|
27
|
+
require 'tc/copylines'
|
28
|
+
require 'tc/create'
|
29
|
+
require 'tc/csv'
|
30
|
+
require 'tc/csv2'
|
31
|
+
require 'tc/csv_columns'
|
32
|
+
require 'tc/dir'
|
33
|
+
require 'tc/dir_iter'
|
34
|
+
require 'tc/dirent'
|
35
|
+
require 'tc/each'
|
36
|
+
require 'tc/each_break'
|
37
|
+
require 'tc/empty'
|
38
|
+
require 'tc/entary'
|
39
|
+
require 'tc/eq'
|
40
|
+
require 'tc/expand_path'
|
41
|
+
require 'tc/ext'
|
42
|
+
require 'tc/get'
|
43
|
+
require 'tc/gzip'
|
44
|
+
require 'tc/getrec'
|
45
|
+
require 'tc/io_each_byte'
|
46
|
+
require 'tc/io_read'
|
47
|
+
require 'tc/iometh'
|
48
|
+
require 'tc/likeio'
|
49
|
+
require 'tc/lines'
|
50
|
+
require 'tc/clone'
|
51
|
+
require 'tc/misc'
|
52
|
+
require 'tc/nolines'
|
53
|
+
require 'tc/noqae'
|
54
|
+
require 'tc/null' unless $mswin32
|
55
|
+
require 'tc/overload'
|
56
|
+
require 'tc/pa'
|
57
|
+
require 'tc/paths'
|
58
|
+
require 'tc/pid'
|
59
|
+
require 'tc/piper' unless $mswin32
|
60
|
+
require 'tc/qae'
|
61
|
+
require 'tc/qae_riovar'
|
62
|
+
require 'tc/readline'
|
63
|
+
require 'tc/records'
|
64
|
+
require 'tc/rename'
|
65
|
+
require 'tc/riorl'
|
66
|
+
require 'tc/route'
|
67
|
+
require 'tc/selnosel'
|
68
|
+
require 'tc/skip'
|
69
|
+
require 'tc/skiplines'
|
70
|
+
require 'tc/split'
|
71
|
+
require 'tc/splitpath'
|
72
|
+
require 'tc/splitlines'
|
73
|
+
require 'tc/symlink' unless $mswin32
|
74
|
+
require 'tc/symlink0' unless $mswin32
|
75
|
+
require 'tc/symlink1' unless $mswin32
|
76
|
+
require 'tc/temp'
|
77
|
+
require 'tc/tempdir'
|
78
|
+
require 'tc/tempfile'
|
79
|
+
|
80
|
+
|