rio 0.3.6 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +171 -0
- data/README +3 -16
- data/RUNME.1st.rb +1 -3
- data/Rakefile +10 -7
- data/VERSION +1 -1
- data/doc/ANNOUNCE +1 -1
- data/doc/RELEASE_NOTES +3 -4
- data/ex/colx.rb +8 -0
- data/ex/findinruby +16 -0
- data/ex/findruby +15 -0
- data/ex/passwd_report.rb +8 -0
- data/ex/prompt.rb +25 -0
- data/ex/rgb.txt.gz +0 -0
- data/ex/riocat +35 -0
- data/ex/riogunzip +31 -0
- data/ex/riogzip +24 -0
- data/ex/rioprompt.rb +6 -0
- data/ex/targz2zip +17 -0
- data/ex/tolf +11 -0
- data/lib/rio.rb +0 -3
- data/lib/rio/construct.rb +14 -20
- data/lib/rio/dir.rb +2 -2
- data/lib/rio/doc/INTRO.rb +12 -16
- data/lib/rio/ext.rb +2 -1
- data/lib/rio/ext/csv.rb +5 -1
- data/lib/rio/ext/yaml.rb +11 -12
- data/lib/rio/filter.rb +1 -1
- data/lib/rio/ftp.rb +1 -1
- data/lib/rio/if/dir.rb +2 -2
- data/lib/rio/if/grande.rb +7 -1
- data/lib/rio/if/yaml.rb +1 -1
- data/lib/rio/ioh.rb +11 -1
- data/lib/rio/ops/construct.rb +11 -10
- data/lib/rio/ops/dir.rb +38 -19
- data/lib/rio/rl/ioi.rb +2 -2
- data/lib/rio/scheme/temp.rb +2 -2
- data/lib/rio/state.rb +1 -1
- data/lib/rio/stream/open.rb +9 -6
- data/lib/rio/util.rb +49 -0
- data/lib/rio/version.rb +1 -1
- data/test/tc/all.rb +3 -1
- data/test/tc/cd1.rb +0 -3
- data/test/tc/clearsel.rb +1 -2
- data/test/tc/copy-from.rb +0 -3
- data/test/tc/copy-to.rb +0 -3
- data/test/tc/copyarray.rb +1 -4
- data/test/tc/copydir.rb +0 -3
- data/test/tc/copydirlines.rb +0 -3
- data/test/tc/copynonex.rb +0 -3
- data/test/tc/csv.rb +0 -3
- data/test/tc/dir.rb +0 -3
- data/test/tc/dir_iter.rb +384 -0
- data/test/tc/dirautoclose.rb +4 -7
- data/test/tc/dirent.rb +3 -5
- data/test/tc/dirss.rb +2 -5
- data/test/tc/each.rb +3 -3
- data/test/tc/each_break.rb +17 -28
- data/test/tc/edf.rb +1 -2
- data/test/tc/entary.rb +1 -4
- data/test/tc/expand_path.rb +1 -2
- data/test/tc/ext.rb +0 -3
- data/test/tc/fileno.rb +1 -2
- data/test/tc/get.rb +151 -0
- data/test/tc/lineno.rb +1 -2
- data/test/tc/methods.rb +1 -1
- data/test/tc/misc.rb +1 -5
- data/test/tc/nolines.rb +3 -4
- data/test/tc/noqae.rb +1 -4
- data/test/tc/pa.rb +1 -2
- data/test/tc/pathop.rb +0 -3
- data/test/tc/paths.rb +1 -3
- data/test/tc/qae.rb +1 -2
- data/test/tc/qae_riovar.rb +1 -2
- data/test/tc/records.rb +1 -2
- data/test/tc/rename.rb +1 -3
- data/test/tc/rename_assign.rb +0 -3
- data/test/tc/riorl.rb +82 -52
- data/test/tc/selnosel.rb +0 -3
- data/test/tc/sub.rb +0 -3
- data/test/tc/symlink.rb +1 -2
- data/test/tc/symlink0.rb +1 -2
- data/test/tc/symlink1.rb +1 -2
- data/test/tc/temp.rb +0 -3
- data/test/tc/tempdir.rb +0 -3
- data/test/tc/tempfile.rb +0 -3
- data/test/tc/testcase.rb +9 -4
- data/test/tc/yaml.rb +11 -1
- metadata +141 -386
- data/doc/rdoc/classes/Kernel.html +0 -181
- data/doc/rdoc/classes/Kernel.src/M000214.html +0 -18
- data/doc/rdoc/classes/RIO.html +0 -621
- data/doc/rdoc/classes/RIO.src/M000001.html +0 -18
- data/doc/rdoc/classes/RIO.src/M000002.html +0 -18
- data/doc/rdoc/classes/RIO.src/M000003.html +0 -18
- data/doc/rdoc/classes/RIO/Doc.html +0 -138
- data/doc/rdoc/classes/RIO/Doc/HOWTO.html +0 -1040
- data/doc/rdoc/classes/RIO/Doc/INTRO.html +0 -1613
- data/doc/rdoc/classes/RIO/Doc/MISC.html +0 -443
- data/doc/rdoc/classes/RIO/Doc/SYNOPSIS.html +0 -338
- data/doc/rdoc/classes/RIO/IF.html +0 -114
- data/doc/rdoc/classes/RIO/IF/CSV.html +0 -202
- data/doc/rdoc/classes/RIO/IF/CSV.src/M000004.html +0 -19
- data/doc/rdoc/classes/RIO/IF/CSV.src/M000005.html +0 -16
- data/doc/rdoc/classes/RIO/IF/CSV.src/M000006.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.html +0 -499
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000007.html +0 -19
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000008.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000009.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000010.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000011.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000012.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000013.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000014.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000015.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000016.html +0 -16
- data/doc/rdoc/classes/RIO/IF/YAML.src/M000017.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.html +0 -7121
- data/doc/rdoc/classes/RIO/Rio.src/M000018.html +0 -18
- data/doc/rdoc/classes/RIO/Rio.src/M000019.html +0 -20
- data/doc/rdoc/classes/RIO/Rio.src/M000020.html +0 -27
- data/doc/rdoc/classes/RIO/Rio.src/M000021.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000023.html +0 -19
- data/doc/rdoc/classes/RIO/Rio.src/M000024.html +0 -20
- data/doc/rdoc/classes/RIO/Rio.src/M000025.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000026.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000027.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000028.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000029.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000030.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000031.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000032.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000033.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000034.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000035.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000036.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000037.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000038.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000039.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000040.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000041.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000042.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000043.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000044.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000045.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000046.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000047.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000048.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000049.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000050.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000051.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000052.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000053.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000054.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000055.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000056.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000057.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000058.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000059.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000060.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000061.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000062.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000063.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000064.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000065.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000066.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000067.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000068.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000069.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000070.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000071.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000072.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000073.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000074.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000075.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000076.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000077.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000078.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000079.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000080.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000081.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000082.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000083.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000084.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000085.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000086.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000087.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000088.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000089.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000090.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000091.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000092.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000093.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000094.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000095.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000096.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000097.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000098.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000099.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000100.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000101.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000102.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000103.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000104.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000105.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000106.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000107.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000108.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000109.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000110.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000111.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000112.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000113.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000114.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000115.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000116.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000117.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000118.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000119.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000120.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000121.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000122.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000123.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000124.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000125.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000126.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000127.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000128.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000129.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000130.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000131.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000132.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000133.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000134.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000135.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000136.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000137.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000138.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000139.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000140.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000141.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000142.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000143.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000144.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000145.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000146.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000147.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000148.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000149.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000150.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000151.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000152.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000153.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000154.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000155.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000156.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000157.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000158.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000159.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000160.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000161.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000162.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000163.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000164.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000165.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000166.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000167.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000168.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000169.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000170.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000171.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000172.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000173.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000174.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000175.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000176.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000177.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000178.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000179.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000180.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000181.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000182.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000183.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000184.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000185.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000186.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000187.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000188.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000189.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000190.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000191.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000192.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000193.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000194.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000195.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000196.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000197.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000198.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000199.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000200.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000201.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000202.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000203.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000204.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000205.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000206.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000207.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000208.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000209.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000210.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000211.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000212.html +0 -16
- data/doc/rdoc/classes/RIO/Rio.src/M000213.html +0 -16
- data/doc/rdoc/created.rid +0 -1
- data/doc/rdoc/files/README.html +0 -243
- data/doc/rdoc/files/lib/rio/constructor_rb.html +0 -142
- data/doc/rdoc/files/lib/rio/doc/HOWTO_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/doc/INTRO_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/doc/MISC_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/doc/SYNOPSIS_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/basic_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/csv_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/dir_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/file_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/fileordir_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/grande_entry_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/grande_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/grande_stream_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/internal_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/path_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/stream_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/string_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/temp_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/test_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/if/yaml_rb.html +0 -135
- data/doc/rdoc/files/lib/rio/kernel_rb.html +0 -142
- data/doc/rdoc/files/lib/rio_rb.html +0 -154
- data/doc/rdoc/fr_class_index.html +0 -37
- data/doc/rdoc/fr_file_index.html +0 -49
- data/doc/rdoc/fr_method_index.html +0 -241
- data/doc/rdoc/index.html +0 -24
- data/doc/rdoc/rdoc-style.css +0 -384
- data/test/methods/path.rb +0 -12
data/lib/rio/ops/dir.rb
CHANGED
@@ -35,7 +35,6 @@
|
|
35
35
|
# The documented interface and behavior is subject to change without notice.</b>
|
36
36
|
|
37
37
|
|
38
|
-
require 'extensions/object'
|
39
38
|
require 'rio/grande'
|
40
39
|
require 'rio/cp'
|
41
40
|
require 'rio/ops/either'
|
@@ -191,6 +190,13 @@ module RIO
|
|
191
190
|
read_()
|
192
191
|
end
|
193
192
|
|
193
|
+
def get()
|
194
|
+
self.each_ent_ { |d|
|
195
|
+
return d
|
196
|
+
}
|
197
|
+
return nil
|
198
|
+
end
|
199
|
+
|
194
200
|
def rewind() ioh.rewind(); self end
|
195
201
|
def seek(integer) ioh.seek(integer); self end
|
196
202
|
|
@@ -224,30 +230,43 @@ module RIO
|
|
224
230
|
args = cx['skip_args'] || []
|
225
231
|
self.skipentries(*args)
|
226
232
|
end
|
233
|
+
def handle_ent_(estr,selfstr,sel,&block)
|
234
|
+
begin
|
235
|
+
erio = new_rio_cx(selfstr ? Impl::U.join(selfstr,estr) : estr )
|
236
|
+
|
237
|
+
if stream_iter?
|
238
|
+
_add_stream_iter_cx(erio).each(&block) if erio.file? and sel.match?(erio)
|
239
|
+
else
|
240
|
+
yield _add_iter_cx(erio) if sel.match?(erio)
|
241
|
+
end
|
242
|
+
|
243
|
+
if cx.has_key?('all') and erio.directory?
|
244
|
+
rsel = Match::Entry::SelectorClassic.new(cx['r_sel'],cx['r_nosel'])
|
245
|
+
_add_recurse_iter_cx(erio).each(&block) if rsel.match?(erio)
|
246
|
+
end
|
247
|
+
|
248
|
+
rescue ::Errno::ENOENT, ::URI::InvalidURIError => ex
|
249
|
+
$stderr.puts(ex.message+". Skipping.")
|
250
|
+
end
|
251
|
+
end
|
227
252
|
def each_(*args,&block)
|
228
253
|
#p "#{callstr('each_',*args)} sel=#{cx['sel'].inspect} nosel=#{cx['nosel'].inspect}"
|
229
254
|
handle_skipped()
|
230
255
|
sel = Match::Entry::Selector.new(cx['entry_sel'])
|
231
256
|
selfstr = (self.to_s == '.' ? nil : self.to_s)
|
232
257
|
self.ioh.each do |estr|
|
233
|
-
next if
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
_add_recurse_iter_cx(erio).each(&block) if rsel.match?(erio)
|
246
|
-
end
|
247
|
-
|
248
|
-
rescue ::Errno::ENOENT, ::URI::InvalidURIError => ex
|
249
|
-
$stderr.puts(ex.message+". Skipping.")
|
250
|
-
end
|
258
|
+
next if
|
259
|
+
handle_ent_(estr,selfstr,sel,&block) unless estr =~ /^\.(\.)?$/
|
260
|
+
end
|
261
|
+
closeoneof? ? self.close : self
|
262
|
+
end
|
263
|
+
def each_ent_(*args,&block)
|
264
|
+
#p "#{callstr('each_',*args)} sel=#{cx['sel'].inspect} nosel=#{cx['nosel'].inspect}"
|
265
|
+
handle_skipped()
|
266
|
+
sel = Match::Entry::Selector.new(cx['entry_sel'])
|
267
|
+
selfstr = (self.to_s == '.' ? nil : self.to_s)
|
268
|
+
while estr = self.ioh.read
|
269
|
+
handle_ent_(estr,selfstr,sel,&block) unless estr =~ /^\.(\.)?$/
|
251
270
|
end
|
252
271
|
closeoneof? ? self.close : self
|
253
272
|
end
|
data/lib/rio/rl/ioi.rb
CHANGED
data/lib/rio/scheme/temp.rb
CHANGED
@@ -36,7 +36,7 @@
|
|
36
36
|
#
|
37
37
|
require 'tmpdir'
|
38
38
|
module RIO
|
39
|
-
module Temp
|
39
|
+
module Temp #:nodoc: all
|
40
40
|
RESET_STATE = 'Temp::Reset'
|
41
41
|
|
42
42
|
require 'rio/rl/base'
|
@@ -55,7 +55,7 @@ module RIO
|
|
55
55
|
def scheme() self.class.const_get(:RIOSCHEME) end
|
56
56
|
def opaque()
|
57
57
|
td = self.escape(@tmpdir.to_s)
|
58
|
-
td += '/' unless td.nil? or td.empty? or (td
|
58
|
+
td += '/' unless td.nil? or td.empty? or (td != '/' and td[-1] == ?/)
|
59
59
|
td + self.escape(@prefix)
|
60
60
|
end
|
61
61
|
|
data/lib/rio/state.rb
CHANGED
@@ -166,7 +166,7 @@ module RIO
|
|
166
166
|
|
167
167
|
# Section: Error Handling
|
168
168
|
def gofigure(sym,*args)
|
169
|
-
cs = "#{sym}("+args.map
|
169
|
+
cs = "#{sym}("+args.map{|el| el.to_s}.join(',')+")"
|
170
170
|
msg = "Go Figure! rio('#{self.to_s}').#{cs} Failed"
|
171
171
|
error(msg,sym,*args)
|
172
172
|
end
|
data/lib/rio/stream/open.rb
CHANGED
@@ -81,17 +81,17 @@ module RIO
|
|
81
81
|
end
|
82
82
|
|
83
83
|
|
84
|
-
|
84
|
+
require 'rio/util'
|
85
85
|
module RIO
|
86
86
|
module Stream
|
87
87
|
class Open < Base
|
88
88
|
def size()
|
89
89
|
self.contents.size
|
90
90
|
end
|
91
|
-
OUTPUT_SYMS = [:print,:printf,:puts,:putc,:write,
|
92
|
-
|
93
|
-
|
94
|
-
|
91
|
+
OUTPUT_SYMS = Util::build_sym_hash([:print,:printf,:puts,:putc,:write,
|
92
|
+
:print!,:printf!,:puts!,:putc!,:write!,
|
93
|
+
:put_,:putrec,:putrec!,:<,:<< ])
|
94
|
+
|
95
95
|
def sym_state(sym,im,om)
|
96
96
|
if OUTPUT_SYMS[sym.to_s] or RIO::Ext::OUTPUT_SYMS[sym.to_s]
|
97
97
|
om ||= (sym.to_s == '<<' ? 'a' : 'w')
|
@@ -192,10 +192,13 @@ module RIO
|
|
192
192
|
cx['retrystate'] = nil
|
193
193
|
self
|
194
194
|
end
|
195
|
-
def
|
195
|
+
def get()
|
196
196
|
self.close_.softreset
|
197
197
|
nil
|
198
198
|
end
|
199
|
+
alias :getline :get
|
200
|
+
alias :getrow :get
|
201
|
+
alias :getrec :get
|
199
202
|
|
200
203
|
def check?() true end
|
201
204
|
def base_state() 'Stream::Reset' end
|
data/lib/rio/util.rb
ADDED
@@ -0,0 +1,49 @@
|
|
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
|
+
module RIO
|
39
|
+
module Util #:nodoc: all
|
40
|
+
def build_sym_hash(syms)
|
41
|
+
result = {}
|
42
|
+
syms.each do |sym|
|
43
|
+
result[sym.to_s] = 1
|
44
|
+
end
|
45
|
+
result
|
46
|
+
end
|
47
|
+
module_function :build_sym_hash
|
48
|
+
end
|
49
|
+
end
|
data/lib/rio/version.rb
CHANGED
data/test/tc/all.rb
CHANGED
@@ -2,7 +2,8 @@ require 'test/unit'
|
|
2
2
|
require 'tc/testcase'
|
3
3
|
|
4
4
|
#require 'tc/yaml'
|
5
|
-
require 'tc/
|
5
|
+
require 'tc/dir_iter'
|
6
|
+
require 'tc/piper' unless $mswin32
|
6
7
|
require 'tc/cmdpipe'
|
7
8
|
require 'tc/base'
|
8
9
|
require 'tc/split'
|
@@ -39,6 +40,7 @@ require 'tc/eq'
|
|
39
40
|
require 'tc/expand_path'
|
40
41
|
require 'tc/ext'
|
41
42
|
require 'tc/getrec'
|
43
|
+
require 'tc/get'
|
42
44
|
require 'tc/lines'
|
43
45
|
require 'tc/methods'
|
44
46
|
require 'tc/misc'
|
data/test/tc/cd1.rb
CHANGED
data/test/tc/clearsel.rb
CHANGED
@@ -13,8 +13,7 @@ class TC_RIO_clearsel < Test::Unit::TestCase
|
|
13
13
|
def assert!(a,msg="negative assertion")
|
14
14
|
assert((!(a)),msg)
|
15
15
|
end
|
16
|
-
|
17
|
-
def smap(a) a.map( &:to_s ) end
|
16
|
+
def smap(a) a.map { |el| el.to_s } end
|
18
17
|
def mkafile(*args)
|
19
18
|
file = rio(*args)
|
20
19
|
file < (0..1).map { |i| "L#{i}:#{file.to_s}\n" }
|
data/test/tc/copy-from.rb
CHANGED
data/test/tc/copy-to.rb
CHANGED
data/test/tc/copyarray.rb
CHANGED
@@ -5,9 +5,6 @@ if $0 == __FILE__
|
|
5
5
|
end
|
6
6
|
|
7
7
|
require 'rio'
|
8
|
-
require 'test/unit'
|
9
|
-
require 'test/unit/testsuite'
|
10
|
-
require 'extensions/symbol'
|
11
8
|
require 'tc/testcase'
|
12
9
|
|
13
10
|
class TC_copyarray < Test::Unit::TestCase
|
@@ -111,7 +108,7 @@ class TC_copyarray < Test::Unit::TestCase
|
|
111
108
|
out = rio('out').delete!.mkpath
|
112
109
|
assert(out[].empty?)
|
113
110
|
inputdir = rio(@d[1])
|
114
|
-
out < inputdir[].map
|
111
|
+
out < inputdir[].map{|el| el.to_s}
|
115
112
|
assert_equal(@l[0],rio(out,@f[0].basename).lines[])
|
116
113
|
assert_equal(@l[1],rio(out,@f[1].basename).lines[])
|
117
114
|
assert_equal(@l[0],rio(out,@f[0]).lines[])
|
data/test/tc/copydir.rb
CHANGED
data/test/tc/copydirlines.rb
CHANGED
data/test/tc/copynonex.rb
CHANGED
data/test/tc/csv.rb
CHANGED
data/test/tc/dir.rb
CHANGED
data/test/tc/dir_iter.rb
ADDED
@@ -0,0 +1,384 @@
|
|
1
|
+
#!/usr/local/bin/ruby
|
2
|
+
if $0 == __FILE__
|
3
|
+
Dir.chdir File.dirname(__FILE__)+'/../'
|
4
|
+
$:.unshift File.expand_path('../lib/')
|
5
|
+
end
|
6
|
+
|
7
|
+
if ENV['TEST_RIO'] == 'gem'
|
8
|
+
require 'rubygems'
|
9
|
+
require_gem 'rio'
|
10
|
+
else
|
11
|
+
require 'rio'
|
12
|
+
end
|
13
|
+
|
14
|
+
require 'tc/testcase'
|
15
|
+
|
16
|
+
class TC_dir_iter < Test::RIO::TestCase
|
17
|
+
@@once = false
|
18
|
+
@@exp = {}
|
19
|
+
def self.once
|
20
|
+
@@once = true
|
21
|
+
(0..3).each { |n_ents|
|
22
|
+
d = rio('d'+n_ents.to_s).delete!.mkdir
|
23
|
+
@@exp[d.to_s] = []
|
24
|
+
d.chdir { |dir|
|
25
|
+
(0...n_ents).each { |fnum|
|
26
|
+
@@exp[d.to_s] << rio('f'+fnum.to_s).touch
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
end
|
31
|
+
def setup
|
32
|
+
super
|
33
|
+
self.class.once unless @@once
|
34
|
+
end
|
35
|
+
def otest_dir
|
36
|
+
(1..1).each do |n_ents|
|
37
|
+
get_each_dir(n_ents)
|
38
|
+
end
|
39
|
+
end
|
40
|
+
def doem(&block)
|
41
|
+
rio('.').each { |d|
|
42
|
+
ma = /d(\d)/.match(d.to_s)
|
43
|
+
n_ents = ma[1].to_i
|
44
|
+
exp = @@exp[d.to_s]
|
45
|
+
d.chdir { |dir|
|
46
|
+
yield(dir,n_ents,exp)
|
47
|
+
}
|
48
|
+
}
|
49
|
+
end
|
50
|
+
def test_ss
|
51
|
+
doem { |d,n,exp|
|
52
|
+
ans = d[]
|
53
|
+
assert_array_equal(exp,ans)
|
54
|
+
}
|
55
|
+
end
|
56
|
+
def test_each
|
57
|
+
doem { |d,n,exp|
|
58
|
+
ans = []
|
59
|
+
d.each { |e| ans << e }
|
60
|
+
assert_array_equal(exp,ans)
|
61
|
+
}
|
62
|
+
end
|
63
|
+
def test_read
|
64
|
+
doem { |d,n,exp|
|
65
|
+
ans = []
|
66
|
+
while e = d.read
|
67
|
+
ans << e
|
68
|
+
end
|
69
|
+
ans.reject! { |el| el =~ /^\.{1,2}$/ }
|
70
|
+
assert_array_equal(exp,ans)
|
71
|
+
}
|
72
|
+
end
|
73
|
+
def test_each_get_break
|
74
|
+
doem { |d,n,exp|
|
75
|
+
ans = []
|
76
|
+
d.each { |e|
|
77
|
+
ans << e
|
78
|
+
break
|
79
|
+
}
|
80
|
+
assert_array_equal(exp[0..0],ans)
|
81
|
+
ent = d.get
|
82
|
+
assert_equal(exp[1],ent)
|
83
|
+
ent2 = d.get
|
84
|
+
if ent.nil?
|
85
|
+
assert_equal(exp[0],ent2)
|
86
|
+
else
|
87
|
+
assert_equal(exp[2],ent2)
|
88
|
+
end
|
89
|
+
}
|
90
|
+
end
|
91
|
+
def test_each_get
|
92
|
+
doem { |d,n,exp|
|
93
|
+
ans = []
|
94
|
+
d.each { |e|
|
95
|
+
ans << e
|
96
|
+
}
|
97
|
+
assert_array_equal(exp,ans)
|
98
|
+
ent = d.get
|
99
|
+
assert_equal(exp[0],ent)
|
100
|
+
}
|
101
|
+
end
|
102
|
+
def test_each_get_nceof
|
103
|
+
doem { |d,n,exp|
|
104
|
+
ans = []
|
105
|
+
d.nocloseoneof.each { |e|
|
106
|
+
ans << e
|
107
|
+
break
|
108
|
+
}
|
109
|
+
assert_array_equal(exp[0..0],ans)
|
110
|
+
ent = d.get
|
111
|
+
assert_equal(exp[1],ent)
|
112
|
+
ent2 = d.get
|
113
|
+
assert_equal(exp[2],ent2)
|
114
|
+
}
|
115
|
+
end
|
116
|
+
def test_each_get_nac
|
117
|
+
doem { |d,n,exp|
|
118
|
+
ans = []
|
119
|
+
d.noautoclose.each { |e|
|
120
|
+
ans << e
|
121
|
+
break
|
122
|
+
}
|
123
|
+
assert_array_equal(exp[0..0],ans)
|
124
|
+
ent = d.get
|
125
|
+
assert_equal(exp[1],ent)
|
126
|
+
ent2 = d.get
|
127
|
+
assert_equal(exp[2],ent2)
|
128
|
+
}
|
129
|
+
end
|
130
|
+
def test_get_get
|
131
|
+
doem { |d,n,exp|
|
132
|
+
ans = []
|
133
|
+
while e = d.get
|
134
|
+
ans << e
|
135
|
+
end
|
136
|
+
while e = d.get
|
137
|
+
ans << e
|
138
|
+
end
|
139
|
+
assert_array_equal(exp+exp,ans)
|
140
|
+
}
|
141
|
+
end
|
142
|
+
def test_get_get_nac
|
143
|
+
doem { |d,n,exp|
|
144
|
+
ans = []
|
145
|
+
d.noautoclose
|
146
|
+
while e = d.get
|
147
|
+
ans << e
|
148
|
+
end
|
149
|
+
while e = d.get
|
150
|
+
ans << e
|
151
|
+
end
|
152
|
+
assert_array_equal(exp,ans)
|
153
|
+
}
|
154
|
+
end
|
155
|
+
def test_each_each
|
156
|
+
doem { |d,n,exp|
|
157
|
+
ans = []
|
158
|
+
d.each { |e|
|
159
|
+
ans << e
|
160
|
+
}
|
161
|
+
d.each { |e|
|
162
|
+
ans << e
|
163
|
+
}
|
164
|
+
assert_array_equal(exp+exp,ans)
|
165
|
+
}
|
166
|
+
end
|
167
|
+
def test_each_each_nac
|
168
|
+
doem { |d,n,exp|
|
169
|
+
ans = []
|
170
|
+
d.noautoclose.each { |e|
|
171
|
+
ans << e
|
172
|
+
}
|
173
|
+
d.each { |e|
|
174
|
+
ans << e
|
175
|
+
}
|
176
|
+
assert_array_equal(exp,ans)
|
177
|
+
}
|
178
|
+
end
|
179
|
+
def test_get
|
180
|
+
doem { |d,n,exp|
|
181
|
+
ans = []
|
182
|
+
while e = d.get
|
183
|
+
ans << e
|
184
|
+
end
|
185
|
+
assert_array_equal(exp,ans)
|
186
|
+
}
|
187
|
+
end
|
188
|
+
def test_get_select
|
189
|
+
doem { |d,n,exp|
|
190
|
+
ans = []
|
191
|
+
d.entries(/1/)
|
192
|
+
while e = d.get
|
193
|
+
ans << e
|
194
|
+
end
|
195
|
+
exp = exp.select { |el| el =~ /1/ }
|
196
|
+
assert_array_equal(exp,ans)
|
197
|
+
}
|
198
|
+
end
|
199
|
+
def test_get_skip
|
200
|
+
doem { |d,n,exp|
|
201
|
+
ans = []
|
202
|
+
d.skip(/1/)
|
203
|
+
while e = d.get
|
204
|
+
ans << e
|
205
|
+
end
|
206
|
+
exp = exp.reject { |el| el =~ /1/ }
|
207
|
+
assert_array_equal(exp,ans)
|
208
|
+
}
|
209
|
+
end
|
210
|
+
def test_get_skip_files
|
211
|
+
doem { |d,n,exp|
|
212
|
+
ans = []
|
213
|
+
d.skip.files(/1/)
|
214
|
+
while e = d.get
|
215
|
+
ans << e
|
216
|
+
end
|
217
|
+
exp = exp.reject { |el| el =~ /1/ }
|
218
|
+
assert_array_equal(exp,ans)
|
219
|
+
}
|
220
|
+
end
|
221
|
+
def test_get_skipfiles
|
222
|
+
doem { |d,n,exp|
|
223
|
+
ans = []
|
224
|
+
d.skipfiles(/1/)
|
225
|
+
while e = d.get
|
226
|
+
ans << e
|
227
|
+
end
|
228
|
+
exp = exp.reject { |el| el =~ /1/ }
|
229
|
+
assert_array_equal(exp,ans)
|
230
|
+
}
|
231
|
+
end
|
232
|
+
def get_each_dir(n_ents)
|
233
|
+
expa = []
|
234
|
+
d = rio('dir').delete!.mkdir
|
235
|
+
(0..n_ents-1).each { |n|
|
236
|
+
expa << (d/'f'+n.to_s).touch
|
237
|
+
}
|
238
|
+
|
239
|
+
d = rio('dir')
|
240
|
+
assert_array_equal(expa,d[])
|
241
|
+
|
242
|
+
begin
|
243
|
+
d = rio('dir')
|
244
|
+
ans = []
|
245
|
+
d.each { |ent| ans << ent }
|
246
|
+
assert_equal(expa,ans)
|
247
|
+
end
|
248
|
+
begin
|
249
|
+
d = rio('dir')
|
250
|
+
ans = []
|
251
|
+
while ent = d.get
|
252
|
+
ans << rec
|
253
|
+
end
|
254
|
+
assert_equal(expa,ans)
|
255
|
+
end
|
256
|
+
begin
|
257
|
+
while rec = f.get
|
258
|
+
ans << rec
|
259
|
+
end
|
260
|
+
assert_equal(expa,ans)
|
261
|
+
end
|
262
|
+
|
263
|
+
return
|
264
|
+
# $trace_states = true
|
265
|
+
|
266
|
+
# iterate twice using #get (no auto close)
|
267
|
+
begin
|
268
|
+
f = rio('f.txt').nocloseoneof
|
269
|
+
ans = []
|
270
|
+
while rec = f.get
|
271
|
+
ans << rec
|
272
|
+
end
|
273
|
+
assert_equal(expa,ans)
|
274
|
+
while rec = f.get
|
275
|
+
ans << rec
|
276
|
+
end
|
277
|
+
assert_equal(expa,ans)
|
278
|
+
end
|
279
|
+
|
280
|
+
# iterate using #get then using #each (no auto close)
|
281
|
+
begin
|
282
|
+
f = rio('f.txt').nocloseoneof
|
283
|
+
ans = []
|
284
|
+
while rec = f.get
|
285
|
+
ans << rec
|
286
|
+
end
|
287
|
+
assert_equal(expa,ans)
|
288
|
+
f.each do |rec|
|
289
|
+
ans << rec
|
290
|
+
end
|
291
|
+
assert_equal(expa,ans)
|
292
|
+
end
|
293
|
+
|
294
|
+
# iterate using #each then using #get (no auto close)
|
295
|
+
begin
|
296
|
+
f = rio('f.txt').nocloseoneof
|
297
|
+
ans = []
|
298
|
+
f.each do |rec|
|
299
|
+
ans << rec
|
300
|
+
end
|
301
|
+
assert_equal(expa,ans)
|
302
|
+
while rec = f.get
|
303
|
+
ans << rec
|
304
|
+
end
|
305
|
+
assert_equal(expa,ans)
|
306
|
+
end
|
307
|
+
|
308
|
+
# iterate twice using #get (with auto close)
|
309
|
+
begin
|
310
|
+
f = rio('f.txt')
|
311
|
+
ans = []
|
312
|
+
while rec = f.get
|
313
|
+
ans << rec
|
314
|
+
end
|
315
|
+
assert_equal(expa,ans)
|
316
|
+
while rec = f.get
|
317
|
+
ans << rec
|
318
|
+
end
|
319
|
+
assert_equal(expa+expa,ans)
|
320
|
+
end
|
321
|
+
|
322
|
+
# assure get returns nil once after iteration using #get (with auto close)
|
323
|
+
begin
|
324
|
+
f = rio('f.txt')
|
325
|
+
ans = []
|
326
|
+
|
327
|
+
f.each do |rec|
|
328
|
+
ans << rec
|
329
|
+
end
|
330
|
+
assert_equal(expa,ans)
|
331
|
+
|
332
|
+
rec = f.get
|
333
|
+
assert_nil(rec)
|
334
|
+
|
335
|
+
rec = f.get
|
336
|
+
assert_equal(expa[0],rec)
|
337
|
+
end
|
338
|
+
|
339
|
+
begin
|
340
|
+
f = rio('f.txt')
|
341
|
+
ans = []
|
342
|
+
|
343
|
+
rec = f.get
|
344
|
+
assert_equal(expa[0],rec)
|
345
|
+
ans << rec unless rec.nil?
|
346
|
+
f.each do |rec|
|
347
|
+
ans << rec
|
348
|
+
end
|
349
|
+
rec = f.get
|
350
|
+
assert_nil(rec)
|
351
|
+
end
|
352
|
+
|
353
|
+
begin
|
354
|
+
f = rio('f.txt')
|
355
|
+
ans = []
|
356
|
+
|
357
|
+
(0...n_lines).each do |n|
|
358
|
+
rec = f.get
|
359
|
+
assert_equal(expa[n],rec)
|
360
|
+
end
|
361
|
+
rec = f.get
|
362
|
+
assert_nil(rec)
|
363
|
+
|
364
|
+
f.each do |rec|
|
365
|
+
ans << rec
|
366
|
+
end
|
367
|
+
assert_equal(expa,ans)
|
368
|
+
end
|
369
|
+
|
370
|
+
begin
|
371
|
+
f = rio('f.txt')
|
372
|
+
ans = []
|
373
|
+
|
374
|
+
(0...n_lines).each do |n|
|
375
|
+
rec = f.get
|
376
|
+
assert_equal(expa[n],rec)
|
377
|
+
end
|
378
|
+
f.each do |rec|
|
379
|
+
ans << rec
|
380
|
+
end
|
381
|
+
assert_equal(expa,ans)
|
382
|
+
end
|
383
|
+
end
|
384
|
+
end
|