rio 0.4.2 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (641) hide show
  1. data/.gitignore +21 -0
  2. data/Gemfile +4 -0
  3. data/{COPYING → LICENSE} +3 -0
  4. data/README +20 -27
  5. data/Rakefile +48 -277
  6. data/lib/rio.rb +63 -24
  7. data/lib/rio/.document +5 -0
  8. data/lib/rio/abstract_method.rb +3 -14
  9. data/lib/rio/alturi.rb +507 -0
  10. data/lib/rio/alturi/algorithm.rb +313 -0
  11. data/lib/rio/alturi/cached_fields.rb +68 -0
  12. data/lib/rio/alturi/escape.rb +82 -0
  13. data/lib/rio/alturi/parse.rb +75 -0
  14. data/lib/rio/alturi/path_parts.rb +81 -0
  15. data/lib/rio/alturi/regex.rb +76 -0
  16. data/lib/rio/alturi/uri_parts.rb +512 -0
  17. data/lib/rio/argv.rb +3 -14
  18. data/lib/rio/arraynge.rb +146 -0
  19. data/lib/rio/arycopy.rb +3 -14
  20. data/lib/rio/assert.rb +87 -15
  21. data/lib/rio/base.rb +7 -30
  22. data/lib/rio/callstr.rb +3 -14
  23. data/lib/rio/const.rb +3 -14
  24. data/lib/rio/construct.rb +4 -15
  25. data/lib/rio/constructor.rb +4 -19
  26. data/lib/rio/context.rb +17 -14
  27. data/lib/rio/context/autoclose.rb +3 -14
  28. data/lib/rio/context/binmode.rb +63 -0
  29. data/lib/rio/context/copying.rb +3 -14
  30. data/lib/rio/context/cxx.rb +3 -14
  31. data/lib/rio/context/dir.rb +5 -15
  32. data/lib/rio/context/encoding.rb +84 -0
  33. data/lib/rio/context/gzip.rb +3 -14
  34. data/lib/rio/context/methods.rb +8 -17
  35. data/lib/rio/context/skip.rb +3 -14
  36. data/lib/rio/context/stream.rb +3 -14
  37. data/lib/rio/cp.rb +5 -20
  38. data/lib/rio/cxuri.rb +67 -0
  39. data/lib/rio/dbg/trace_states.rb +18 -0
  40. data/lib/rio/def.rb +3 -14
  41. data/lib/rio/dir.rb +9 -18
  42. data/lib/rio/doc.rb +3 -14
  43. data/lib/rio/doc/EXAMPLES.rb +256 -269
  44. data/lib/rio/doc/HOWTO.rb +685 -707
  45. data/lib/rio/doc/INDEX.rb +261 -282
  46. data/lib/rio/doc/INTRO.rb +1029 -1040
  47. data/lib/rio/doc/OPTIONAL.rb +77 -103
  48. data/lib/rio/doc/SYNOPSIS.rb +122 -143
  49. data/lib/rio/entrysel.rb +3 -14
  50. data/lib/rio/exception.rb +4 -14
  51. data/lib/rio/exception/copy.rb +3 -14
  52. data/lib/rio/exception/notimplemented.rb +3 -14
  53. data/lib/rio/exception/notsupported.rb +3 -14
  54. data/lib/rio/exception/open.rb +3 -14
  55. data/lib/rio/exception/state.rb +3 -14
  56. data/lib/rio/ext.rb +14 -17
  57. data/lib/rio/ext/csv.rb +25 -304
  58. data/lib/rio/ext/csv/csv-legacy.rb +344 -0
  59. data/lib/rio/ext/csv/csv.rb +359 -0
  60. data/lib/rio/ext/csv/filter.rb +209 -0
  61. data/lib/rio/ext/if.rb +3 -14
  62. data/lib/rio/ext/mp3info.rb +3 -14
  63. data/lib/rio/ext/splitlines.rb +3 -14
  64. data/lib/rio/ext/yaml.rb +3 -14
  65. data/lib/rio/ext/yaml/doc.rb +3 -14
  66. data/lib/rio/ext/yaml/tie.rb +3 -14
  67. data/lib/rio/ext/zipfile.rb +3 -14
  68. data/lib/rio/ext/zipfile/fs.rb +3 -14
  69. data/lib/rio/ext/zipfile/rl.rb +3 -14
  70. data/lib/rio/ext/zipfile/rootdir.rb +3 -14
  71. data/lib/rio/ext/zipfile/state.rb +3 -14
  72. data/lib/rio/ext/zipfile/wrap.rb +3 -14
  73. data/lib/rio/factory.rb +96 -213
  74. data/lib/rio/fibpipe.rb +373 -0
  75. data/lib/rio/file.rb +8 -17
  76. data/lib/rio/filter.rb +4 -15
  77. data/lib/rio/filter/closeoneof.rb +3 -14
  78. data/lib/rio/filter/gzip.rb +18 -27
  79. data/lib/rio/fs.rb +172 -0
  80. data/lib/rio/fs/base.rb +3 -14
  81. data/lib/rio/fs/impl.rb +3 -14
  82. data/lib/rio/fs/native.rb +3 -14
  83. data/lib/rio/fs/stream.rb +3 -14
  84. data/lib/rio/fs/url.rb +3 -14
  85. data/lib/rio/ftp/conncache.rb +16 -18
  86. data/lib/rio/ftp/dir.rb +4 -15
  87. data/lib/rio/ftp/fs.rb +62 -42
  88. data/lib/rio/fwd.rb +15 -0
  89. data/lib/rio/grande.rb +4 -15
  90. data/lib/rio/handle.rb +3 -45
  91. data/lib/rio/if.rb +15 -20
  92. data/lib/rio/if/basic.rb +3 -36
  93. data/lib/rio/if/csv.rb +7 -20
  94. data/lib/rio/if/dir.rb +9 -21
  95. data/lib/rio/if/file.rb +6 -19
  96. data/lib/rio/if/fileordir.rb +18 -29
  97. data/lib/rio/if/grande.rb +109 -120
  98. data/lib/rio/if/grande_entry.rb +5 -18
  99. data/lib/rio/if/grande_stream.rb +29 -42
  100. data/lib/rio/if/internal.rb +15 -16
  101. data/lib/rio/if/path.rb +35 -47
  102. data/lib/rio/if/rubyio.rb +35 -47
  103. data/lib/rio/if/string.rb +3 -16
  104. data/lib/rio/if/temp.rb +3 -16
  105. data/lib/rio/if/test.rb +8 -20
  106. data/lib/rio/if/yaml.rb +16 -29
  107. data/lib/rio/ioh.rb +35 -34
  108. data/lib/rio/iomode.rb +3 -14
  109. data/lib/rio/ios/fail.rb +3 -14
  110. data/lib/rio/ios/generic.rb +3 -14
  111. data/lib/rio/ios/mode.rb +3 -14
  112. data/lib/rio/ios/null.rb +3 -14
  113. data/lib/rio/iowrap.rb +3 -14
  114. data/lib/rio/kernel.rb +4 -17
  115. data/lib/rio/local.rb +3 -14
  116. data/lib/rio/match.rb +3 -14
  117. data/lib/rio/matchrecord.rb +8 -17
  118. data/lib/rio/no_warn.rb +3 -14
  119. data/lib/rio/nullio.rb +3 -14
  120. data/lib/rio/open3.rb +3 -16
  121. data/lib/rio/ops.rb +33 -0
  122. data/lib/rio/ops/construct.rb +3 -14
  123. data/lib/rio/ops/create.rb +11 -25
  124. data/lib/rio/ops/dir.rb +17 -24
  125. data/lib/rio/ops/either.rb +28 -31
  126. data/lib/rio/ops/file.rb +29 -26
  127. data/lib/rio/ops/path.rb +65 -34
  128. data/lib/rio/ops/stream.rb +13 -15
  129. data/lib/rio/ops/stream/input.rb +59 -28
  130. data/lib/rio/ops/stream/output.rb +4 -14
  131. data/lib/rio/ops/stream/read.rb +4 -15
  132. data/lib/rio/ops/stream/write.rb +3 -14
  133. data/lib/rio/ops/symlink.rb +6 -15
  134. data/lib/rio/path.rb +10 -17
  135. data/lib/rio/path/reset.rb +3 -14
  136. data/lib/rio/piper.rb +3 -27
  137. data/lib/rio/piper/cp.rb +50 -27
  138. data/lib/rio/prompt.rb +3 -14
  139. data/lib/rio/rectype.rb +8 -16
  140. data/lib/rio/rl/base.rb +12 -25
  141. data/lib/rio/rl/builder.rb +25 -24
  142. data/lib/rio/rl/chmap.rb +3 -16
  143. data/lib/rio/rl/fs2url.rb +5 -16
  144. data/lib/rio/rl/ioi.rb +3 -14
  145. data/lib/rio/rl/path.rb +14 -25
  146. data/lib/rio/rl/pathmethods.rb +3 -14
  147. data/lib/rio/rl/uri.rb +18 -35
  148. data/lib/rio/rl/withpath.rb +36 -53
  149. data/lib/rio/rrl/base.rb +75 -0
  150. data/lib/rio/rrl/builder.rb +122 -0
  151. data/lib/rio/rrl/chmap.rb +53 -0
  152. data/lib/rio/rrl/ioi.rb +78 -0
  153. data/lib/rio/rrl/path.rb +117 -0
  154. data/lib/rio/rrl/withpath.rb +269 -0
  155. data/lib/rio/scheme/aryio.rb +3 -14
  156. data/lib/rio/scheme/cmdio.rb +73 -42
  157. data/lib/rio/scheme/cmdpipe.rb +122 -59
  158. data/lib/rio/scheme/fd.rb +19 -33
  159. data/lib/rio/scheme/ftp.rb +34 -40
  160. data/lib/rio/scheme/http.rb +13 -22
  161. data/lib/rio/scheme/null.rb +6 -17
  162. data/lib/rio/scheme/path.rb +60 -71
  163. data/lib/rio/scheme/stderr.rb +9 -21
  164. data/lib/rio/scheme/stdio.rb +14 -26
  165. data/lib/rio/scheme/strio.rb +37 -38
  166. data/lib/rio/scheme/sysio.rb +20 -32
  167. data/lib/rio/scheme/tcp.rb +3 -14
  168. data/lib/rio/scheme/temp.rb +103 -92
  169. data/lib/rio/state.rb +85 -67
  170. data/lib/rio/state/data.rb +55 -0
  171. data/lib/rio/state/error.rb +7 -27
  172. data/lib/rio/stream.rb +46 -19
  173. data/lib/rio/stream/base.rb +14 -14
  174. data/lib/rio/stream/duplex.rb +64 -26
  175. data/lib/rio/stream/open.rb +9 -19
  176. data/lib/rio/symantics.rb +3 -14
  177. data/lib/rio/tempdir.rb +8 -17
  178. data/lib/rio/to_rio.rb +3 -16
  179. data/lib/rio/to_rio/all.rb +3 -14
  180. data/lib/rio/to_rio/array.rb +3 -14
  181. data/lib/rio/to_rio/io.rb +3 -14
  182. data/lib/rio/to_rio/object.rb +3 -14
  183. data/lib/rio/to_rio/string.rb +3 -14
  184. data/lib/rio/uri/file.rb +98 -153
  185. data/lib/rio/uriref.rb +144 -0
  186. data/lib/rio/util.rb +3 -14
  187. data/lib/rio/version.rb +4 -15
  188. data/misc/clean-heading-comments.rb +39 -0
  189. data/misc/fixdoclinks.rb +36 -0
  190. data/misc/update-copyright.rb +17 -0
  191. data/rio.gemspec +31 -0
  192. data/test/alturi/tc/create.rb +24 -0
  193. data/test/alturi/tc/empty.rb +13 -0
  194. data/test/alturi/tc/encoding.rb +73 -0
  195. data/test/alturi/tc/file_test.rb +335 -0
  196. data/test/alturi/tc/ftp_alturi.rb +147 -0
  197. data/test/alturi/tc/generic_test.rb +335 -0
  198. data/test/alturi/tc/http_test.rb +359 -0
  199. data/test/alturi/tc/path_parts_test.rb +215 -0
  200. data/test/alturi/tc/rfc_test.rb +83 -0
  201. data/test/alturi/tc/uri_parts_authority.rb +129 -0
  202. data/test/alturi/tc/uri_parts_test.rb +473 -0
  203. data/test/alturi/tc/uri_parts_userinfo.rb +140 -0
  204. data/test/alturi/tests.rb +27 -0
  205. data/test/base_test.rb +18 -0
  206. data/test/bin/demo_chdir.rb +60 -0
  207. data/test/bin/elipsis.rb +11 -0
  208. data/test/env.sh +4 -0
  209. data/test/ftp/initftpfiles.rb +1 -0
  210. data/test/ftp/tc/anon_copy_data.rb +31 -0
  211. data/test/ftp/tc/anon_misc.rb +109 -0
  212. data/test/ftp/tc/anon_read.rb +99 -0
  213. data/test/ftp/tc/anon_special.rb +37 -0
  214. data/test/ftp/tc/anon_write.rb +68 -0
  215. data/test/ftp/tc/copy.rb +35 -0
  216. data/test/ftp/tc/empty.rb +16 -0
  217. data/test/ftp/tc/ftp2ftp.rb +42 -0
  218. data/test/ftp/tc/ftp_fs.rb +333 -0
  219. data/test/ftp/testdef.rb +7 -2
  220. data/test/ftp/tests.rb +24 -0
  221. data/test/gem_runtests.rb +1 -1
  222. data/test/http/copy-from-http.rb +0 -1
  223. data/test/http/def.rb +20 -0
  224. data/test/http/tc/copy_from_http.rb +128 -0
  225. data/test/http/tc/empty.rb +14 -0
  226. data/test/http/tc/uri_meta.rb +52 -0
  227. data/test/http/tests.rb +19 -0
  228. data/test/lib/assertions.rb +7 -0
  229. data/test/lib/run_tests.rb +26 -0
  230. data/test/lib/temp_server.rb +7 -4
  231. data/test/methods/test_suite.rb +108 -0
  232. data/test/platform.rb +5 -0
  233. data/test/qpdir.rb +2 -0
  234. data/test/rio/scheme.rb +49 -0
  235. data/test/rio/tc/pathparts.rb +61 -0
  236. data/test/riotest/test_suite.rb +33 -0
  237. data/test/riotest/unit_test.rb +118 -0
  238. data/test/riotest/util.rb +23 -0
  239. data/test/runalltests.rb +1 -1
  240. data/test/runftptests.rb +2 -7
  241. data/test/runhttp.rb +4 -2
  242. data/test/runhttptests.rb +6 -5
  243. data/test/runtests.rb +66 -37
  244. data/test/srv/www/htdocs/riotest/dir/index.html +11 -0
  245. data/test/srv/www/htdocs/riotest/hw.html +8 -0
  246. data/test/srv/www/htdocs/riotest/lines.txt.gz +0 -0
  247. data/test/tc/abs2.rb +358 -0
  248. data/test/tc/all.rb +17 -10
  249. data/test/tc/base2.rb +8 -7
  250. data/test/tc/clearsel.rb +3 -2
  251. data/test/tc/closeoneof.rb +14 -15
  252. data/test/tc/cmdio.rb +193 -0
  253. data/test/tc/cmdpipe.rb +258 -63
  254. data/test/tc/copy.rb +3 -2
  255. data/test/tc/copyarray.rb +0 -4
  256. data/test/tc/copydest.rb +2 -3
  257. data/test/tc/copydir.rb +5 -1
  258. data/test/tc/copydir2.rb +68 -0
  259. data/test/tc/create.rb +4 -9
  260. data/test/tc/csv.rb +38 -119
  261. data/test/tc/csv2.rb +38 -57
  262. data/test/tc/csv_columns.rb +210 -8
  263. data/test/tc/csv_gzip.rb +78 -0
  264. data/test/tc/csv_headers.rb +134 -0
  265. data/test/tc/csvutil.rb +53 -16
  266. data/test/tc/dir.rb +3 -4
  267. data/test/tc/dir_iter.rb +3 -1
  268. data/test/tc/dirent.rb +8 -7
  269. data/test/tc/each.rb +62 -47
  270. data/test/tc/each_break.rb +67 -25
  271. data/test/tc/edf.rb +3 -2
  272. data/test/tc/empty.rb +6 -4
  273. data/test/tc/encoding.rb +30 -0
  274. data/test/tc/entary.rb +6 -5
  275. data/test/tc/eq.rb +2 -2
  276. data/test/tc/expand_path.rb +14 -14
  277. data/test/tc/ext.rb +7 -7
  278. data/test/tc/fileno.rb +3 -2
  279. data/test/tc/files_select.rb +1 -1
  280. data/test/tc/getrec.rb +2 -3
  281. data/test/tc/gzip.rb +5 -3
  282. data/test/tc/likeio.rb +5 -5
  283. data/test/tc/lineno.rb +1 -1
  284. data/test/tc/lines.rb +4 -4
  285. data/test/tc/misc.rb +29 -171
  286. data/test/tc/nolines.rb +4 -2
  287. data/test/tc/noqae.rb +12 -10
  288. data/test/tc/overload.rb +1 -2
  289. data/test/tc/pa.rb +25 -24
  290. data/test/tc/path_parts.rb +54 -20
  291. data/test/tc/paths.rb +3 -2
  292. data/test/tc/piper.rb +32 -31
  293. data/test/tc/programs_util.rb +9 -9
  294. data/test/tc/qae.rb +9 -8
  295. data/test/tc/qae_riovar.rb +9 -8
  296. data/test/tc/records.rb +3 -2
  297. data/test/tc/rename.rb +4 -4
  298. data/test/tc/riorl.rb +19 -19
  299. data/test/tc/rlparts.ans.yml +1161 -0
  300. data/test/tc/splitlines.rb +1 -1
  301. data/test/tc/splitpath.rb +9 -8
  302. data/test/tc/strio.rb +73 -0
  303. data/test/tc/symlink.rb +3 -2
  304. data/test/tc/symlink0.rb +4 -3
  305. data/test/tc/symlink1.rb +4 -3
  306. data/test/tc/temp.rb +40 -26
  307. data/test/tc/tempdir.rb +12 -12
  308. data/test/tc/testcase.rb +45 -31
  309. data/test/tc/tonl.rb +0 -1
  310. data/test/tc/truncate.rb +111 -13
  311. data/test/tc/yaml.rb +1 -1
  312. data/test/test_suite.rb +31 -0
  313. data/test/tests.rb +35 -0
  314. data/test/tsuite.rb +19 -0
  315. data/test/uriref/tc/basic.rb +171 -0
  316. data/test/uriref/tc/build.rb +30 -0
  317. data/test/uriref/tc/empty.rb +13 -0
  318. data/test/uriref/tc/route.rb +72 -0
  319. data/test/uriref/tests.rb +16 -0
  320. metadata +356 -424
  321. data/ChangeLog +0 -3122
  322. data/VERSION +0 -1
  323. data/build_doc.rb +0 -94
  324. data/doc/ANNOUNCE +0 -157
  325. data/doc/RELEASE_NOTES +0 -308
  326. data/doc/RIOIS +0 -215
  327. data/doc/generators/template/html/rio.css +0 -428
  328. data/doc/generators/template/html/rio.rb +0 -523
  329. data/doc/generators/template/html/ugly.rb +0 -132
  330. data/doc/pkg_def.rb +0 -60
  331. data/doc/rdoc/classes/Kernel.html +0 -133
  332. data/doc/rdoc/classes/Kernel.src/M000234.html +0 -18
  333. data/doc/rdoc/classes/RIO.html +0 -625
  334. data/doc/rdoc/classes/RIO.src/M000001.html +0 -18
  335. data/doc/rdoc/classes/RIO.src/M000002.html +0 -18
  336. data/doc/rdoc/classes/RIO.src/M000003.html +0 -18
  337. data/doc/rdoc/classes/RIO/Doc.html +0 -149
  338. data/doc/rdoc/classes/RIO/Doc/EXAMPLES.html +0 -432
  339. data/doc/rdoc/classes/RIO/Doc/HOWTO.html +0 -1084
  340. data/doc/rdoc/classes/RIO/Doc/INDEX.html +0 -368
  341. data/doc/rdoc/classes/RIO/Doc/INTRO.html +0 -1529
  342. data/doc/rdoc/classes/RIO/Doc/OPTIONAL.html +0 -221
  343. data/doc/rdoc/classes/RIO/Doc/SYNOPSIS.html +0 -336
  344. data/doc/rdoc/classes/RIO/IF.html +0 -165
  345. data/doc/rdoc/classes/RIO/IF/CSV.html +0 -203
  346. data/doc/rdoc/classes/RIO/IF/CSV.src/M000129.html +0 -19
  347. data/doc/rdoc/classes/RIO/IF/CSV.src/M000130.html +0 -16
  348. data/doc/rdoc/classes/RIO/IF/CSV.src/M000131.html +0 -16
  349. data/doc/rdoc/classes/RIO/IF/Dir.html +0 -343
  350. data/doc/rdoc/classes/RIO/IF/Dir.src/M000045.html +0 -16
  351. data/doc/rdoc/classes/RIO/IF/Dir.src/M000046.html +0 -16
  352. data/doc/rdoc/classes/RIO/IF/Dir.src/M000047.html +0 -16
  353. data/doc/rdoc/classes/RIO/IF/Dir.src/M000048.html +0 -16
  354. data/doc/rdoc/classes/RIO/IF/Dir.src/M000049.html +0 -16
  355. data/doc/rdoc/classes/RIO/IF/Dir.src/M000050.html +0 -16
  356. data/doc/rdoc/classes/RIO/IF/Dir.src/M000051.html +0 -16
  357. data/doc/rdoc/classes/RIO/IF/File.html +0 -223
  358. data/doc/rdoc/classes/RIO/IF/File.src/M000216.html +0 -16
  359. data/doc/rdoc/classes/RIO/IF/File.src/M000217.html +0 -16
  360. data/doc/rdoc/classes/RIO/IF/File.src/M000218.html +0 -16
  361. data/doc/rdoc/classes/RIO/IF/File.src/M000219.html +0 -16
  362. data/doc/rdoc/classes/RIO/IF/FileOrDir.html +0 -572
  363. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000117.html +0 -16
  364. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000118.html +0 -16
  365. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000119.html +0 -16
  366. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000120.html +0 -16
  367. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000121.html +0 -16
  368. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000122.html +0 -16
  369. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000123.html +0 -16
  370. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000124.html +0 -16
  371. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000125.html +0 -16
  372. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000126.html +0 -16
  373. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000127.html +0 -16
  374. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000128.html +0 -16
  375. data/doc/rdoc/classes/RIO/IF/Grande.html +0 -1376
  376. data/doc/rdoc/classes/RIO/IF/Grande.src/M000052.html +0 -16
  377. data/doc/rdoc/classes/RIO/IF/Grande.src/M000053.html +0 -16
  378. data/doc/rdoc/classes/RIO/IF/Grande.src/M000054.html +0 -16
  379. data/doc/rdoc/classes/RIO/IF/Grande.src/M000055.html +0 -16
  380. data/doc/rdoc/classes/RIO/IF/Grande.src/M000056.html +0 -16
  381. data/doc/rdoc/classes/RIO/IF/Grande.src/M000057.html +0 -16
  382. data/doc/rdoc/classes/RIO/IF/Grande.src/M000058.html +0 -21
  383. data/doc/rdoc/classes/RIO/IF/Grande.src/M000059.html +0 -16
  384. data/doc/rdoc/classes/RIO/IF/Grande.src/M000060.html +0 -16
  385. data/doc/rdoc/classes/RIO/IF/Grande.src/M000061.html +0 -16
  386. data/doc/rdoc/classes/RIO/IF/Grande.src/M000062.html +0 -16
  387. data/doc/rdoc/classes/RIO/IF/Grande.src/M000063.html +0 -16
  388. data/doc/rdoc/classes/RIO/IF/Grande.src/M000064.html +0 -16
  389. data/doc/rdoc/classes/RIO/IF/Grande.src/M000065.html +0 -21
  390. data/doc/rdoc/classes/RIO/IF/Grande.src/M000066.html +0 -16
  391. data/doc/rdoc/classes/RIO/IF/Grande.src/M000067.html +0 -16
  392. data/doc/rdoc/classes/RIO/IF/Grande.src/M000068.html +0 -16
  393. data/doc/rdoc/classes/RIO/IF/Grande.src/M000069.html +0 -16
  394. data/doc/rdoc/classes/RIO/IF/Grande.src/M000070.html +0 -16
  395. data/doc/rdoc/classes/RIO/IF/GrandeEntry.html +0 -810
  396. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000107.html +0 -16
  397. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000108.html +0 -16
  398. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000109.html +0 -16
  399. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000110.html +0 -16
  400. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000111.html +0 -16
  401. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000112.html +0 -16
  402. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000113.html +0 -16
  403. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000114.html +0 -16
  404. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000115.html +0 -16
  405. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000116.html +0 -16
  406. data/doc/rdoc/classes/RIO/IF/GrandeStream.html +0 -1513
  407. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000071.html +0 -16
  408. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000072.html +0 -16
  409. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000073.html +0 -16
  410. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000074.html +0 -16
  411. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000075.html +0 -16
  412. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000076.html +0 -16
  413. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000077.html +0 -16
  414. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000078.html +0 -16
  415. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000079.html +0 -16
  416. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000080.html +0 -16
  417. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000081.html +0 -16
  418. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000082.html +0 -16
  419. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000083.html +0 -16
  420. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000084.html +0 -16
  421. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000085.html +0 -16
  422. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000086.html +0 -16
  423. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000087.html +0 -19
  424. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000088.html +0 -16
  425. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000089.html +0 -16
  426. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000090.html +0 -16
  427. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000091.html +0 -16
  428. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000092.html +0 -16
  429. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000093.html +0 -16
  430. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000094.html +0 -16
  431. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000095.html +0 -16
  432. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000096.html +0 -16
  433. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000097.html +0 -16
  434. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000098.html +0 -16
  435. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000099.html +0 -16
  436. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000100.html +0 -16
  437. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000101.html +0 -16
  438. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000102.html +0 -16
  439. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000103.html +0 -16
  440. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000104.html +0 -16
  441. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000105.html +0 -16
  442. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000106.html +0 -16
  443. data/doc/rdoc/classes/RIO/IF/Path.html +0 -999
  444. data/doc/rdoc/classes/RIO/IF/Path.src/M000132.html +0 -16
  445. data/doc/rdoc/classes/RIO/IF/Path.src/M000133.html +0 -16
  446. data/doc/rdoc/classes/RIO/IF/Path.src/M000134.html +0 -16
  447. data/doc/rdoc/classes/RIO/IF/Path.src/M000135.html +0 -16
  448. data/doc/rdoc/classes/RIO/IF/Path.src/M000136.html +0 -16
  449. data/doc/rdoc/classes/RIO/IF/Path.src/M000137.html +0 -16
  450. data/doc/rdoc/classes/RIO/IF/Path.src/M000138.html +0 -16
  451. data/doc/rdoc/classes/RIO/IF/Path.src/M000139.html +0 -16
  452. data/doc/rdoc/classes/RIO/IF/Path.src/M000140.html +0 -16
  453. data/doc/rdoc/classes/RIO/IF/Path.src/M000141.html +0 -16
  454. data/doc/rdoc/classes/RIO/IF/Path.src/M000142.html +0 -16
  455. data/doc/rdoc/classes/RIO/IF/Path.src/M000143.html +0 -16
  456. data/doc/rdoc/classes/RIO/IF/Path.src/M000144.html +0 -16
  457. data/doc/rdoc/classes/RIO/IF/Path.src/M000145.html +0 -16
  458. data/doc/rdoc/classes/RIO/IF/Path.src/M000146.html +0 -16
  459. data/doc/rdoc/classes/RIO/IF/Path.src/M000147.html +0 -16
  460. data/doc/rdoc/classes/RIO/IF/Path.src/M000148.html +0 -16
  461. data/doc/rdoc/classes/RIO/IF/Path.src/M000149.html +0 -16
  462. data/doc/rdoc/classes/RIO/IF/Path.src/M000150.html +0 -16
  463. data/doc/rdoc/classes/RIO/IF/Path.src/M000151.html +0 -16
  464. data/doc/rdoc/classes/RIO/IF/Path.src/M000152.html +0 -16
  465. data/doc/rdoc/classes/RIO/IF/Path.src/M000153.html +0 -16
  466. data/doc/rdoc/classes/RIO/IF/Path.src/M000154.html +0 -18
  467. data/doc/rdoc/classes/RIO/IF/Path.src/M000155.html +0 -16
  468. data/doc/rdoc/classes/RIO/IF/Path.src/M000156.html +0 -16
  469. data/doc/rdoc/classes/RIO/IF/Path.src/M000157.html +0 -16
  470. data/doc/rdoc/classes/RIO/IF/Path.src/M000158.html +0 -16
  471. data/doc/rdoc/classes/RIO/IF/Path.src/M000159.html +0 -16
  472. data/doc/rdoc/classes/RIO/IF/Path.src/M000160.html +0 -16
  473. data/doc/rdoc/classes/RIO/IF/Path.src/M000161.html +0 -16
  474. data/doc/rdoc/classes/RIO/IF/Path.src/M000162.html +0 -16
  475. data/doc/rdoc/classes/RIO/IF/Path.src/M000163.html +0 -16
  476. data/doc/rdoc/classes/RIO/IF/RubyIO.html +0 -1416
  477. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000004.html +0 -16
  478. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000005.html +0 -16
  479. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000006.html +0 -16
  480. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000007.html +0 -16
  481. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000008.html +0 -16
  482. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000009.html +0 -16
  483. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000010.html +0 -16
  484. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000011.html +0 -16
  485. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000012.html +0 -16
  486. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000013.html +0 -16
  487. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000014.html +0 -16
  488. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000015.html +0 -16
  489. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000016.html +0 -16
  490. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000017.html +0 -16
  491. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000018.html +0 -16
  492. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000019.html +0 -16
  493. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000020.html +0 -16
  494. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000021.html +0 -16
  495. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000022.html +0 -16
  496. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000023.html +0 -16
  497. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000024.html +0 -16
  498. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000025.html +0 -16
  499. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000026.html +0 -16
  500. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000027.html +0 -16
  501. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000028.html +0 -16
  502. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000029.html +0 -16
  503. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000030.html +0 -16
  504. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000031.html +0 -16
  505. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000032.html +0 -16
  506. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000033.html +0 -16
  507. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000034.html +0 -16
  508. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000035.html +0 -16
  509. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000036.html +0 -16
  510. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000037.html +0 -16
  511. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000038.html +0 -16
  512. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000039.html +0 -16
  513. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000040.html +0 -16
  514. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000041.html +0 -16
  515. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000042.html +0 -16
  516. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000043.html +0 -16
  517. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000044.html +0 -16
  518. data/doc/rdoc/classes/RIO/IF/String.html +0 -203
  519. data/doc/rdoc/classes/RIO/IF/String.src/M000213.html +0 -16
  520. data/doc/rdoc/classes/RIO/IF/String.src/M000214.html +0 -16
  521. data/doc/rdoc/classes/RIO/IF/String.src/M000215.html +0 -16
  522. data/doc/rdoc/classes/RIO/IF/Test.html +0 -990
  523. data/doc/rdoc/classes/RIO/IF/Test.src/M000177.html +0 -16
  524. data/doc/rdoc/classes/RIO/IF/Test.src/M000178.html +0 -16
  525. data/doc/rdoc/classes/RIO/IF/Test.src/M000179.html +0 -16
  526. data/doc/rdoc/classes/RIO/IF/Test.src/M000180.html +0 -16
  527. data/doc/rdoc/classes/RIO/IF/Test.src/M000181.html +0 -16
  528. data/doc/rdoc/classes/RIO/IF/Test.src/M000182.html +0 -16
  529. data/doc/rdoc/classes/RIO/IF/Test.src/M000183.html +0 -16
  530. data/doc/rdoc/classes/RIO/IF/Test.src/M000184.html +0 -16
  531. data/doc/rdoc/classes/RIO/IF/Test.src/M000185.html +0 -16
  532. data/doc/rdoc/classes/RIO/IF/Test.src/M000186.html +0 -16
  533. data/doc/rdoc/classes/RIO/IF/Test.src/M000187.html +0 -16
  534. data/doc/rdoc/classes/RIO/IF/Test.src/M000188.html +0 -16
  535. data/doc/rdoc/classes/RIO/IF/Test.src/M000189.html +0 -16
  536. data/doc/rdoc/classes/RIO/IF/Test.src/M000190.html +0 -16
  537. data/doc/rdoc/classes/RIO/IF/Test.src/M000191.html +0 -16
  538. data/doc/rdoc/classes/RIO/IF/Test.src/M000192.html +0 -16
  539. data/doc/rdoc/classes/RIO/IF/Test.src/M000193.html +0 -16
  540. data/doc/rdoc/classes/RIO/IF/Test.src/M000194.html +0 -16
  541. data/doc/rdoc/classes/RIO/IF/Test.src/M000195.html +0 -16
  542. data/doc/rdoc/classes/RIO/IF/Test.src/M000196.html +0 -16
  543. data/doc/rdoc/classes/RIO/IF/Test.src/M000197.html +0 -16
  544. data/doc/rdoc/classes/RIO/IF/Test.src/M000198.html +0 -16
  545. data/doc/rdoc/classes/RIO/IF/Test.src/M000199.html +0 -16
  546. data/doc/rdoc/classes/RIO/IF/Test.src/M000200.html +0 -16
  547. data/doc/rdoc/classes/RIO/IF/Test.src/M000201.html +0 -16
  548. data/doc/rdoc/classes/RIO/IF/Test.src/M000202.html +0 -16
  549. data/doc/rdoc/classes/RIO/IF/Test.src/M000203.html +0 -16
  550. data/doc/rdoc/classes/RIO/IF/Test.src/M000204.html +0 -16
  551. data/doc/rdoc/classes/RIO/IF/Test.src/M000205.html +0 -16
  552. data/doc/rdoc/classes/RIO/IF/Test.src/M000206.html +0 -16
  553. data/doc/rdoc/classes/RIO/IF/Test.src/M000207.html +0 -16
  554. data/doc/rdoc/classes/RIO/IF/Test.src/M000208.html +0 -16
  555. data/doc/rdoc/classes/RIO/IF/Test.src/M000209.html +0 -16
  556. data/doc/rdoc/classes/RIO/IF/Test.src/M000210.html +0 -16
  557. data/doc/rdoc/classes/RIO/IF/Test.src/M000211.html +0 -16
  558. data/doc/rdoc/classes/RIO/IF/Test.src/M000212.html +0 -16
  559. data/doc/rdoc/classes/RIO/IF/YAML.html +0 -517
  560. data/doc/rdoc/classes/RIO/IF/YAML.src/M000164.html +0 -19
  561. data/doc/rdoc/classes/RIO/IF/YAML.src/M000165.html +0 -16
  562. data/doc/rdoc/classes/RIO/IF/YAML.src/M000166.html +0 -16
  563. data/doc/rdoc/classes/RIO/IF/YAML.src/M000167.html +0 -16
  564. data/doc/rdoc/classes/RIO/IF/YAML.src/M000168.html +0 -16
  565. data/doc/rdoc/classes/RIO/IF/YAML.src/M000169.html +0 -16
  566. data/doc/rdoc/classes/RIO/IF/YAML.src/M000170.html +0 -16
  567. data/doc/rdoc/classes/RIO/IF/YAML.src/M000171.html +0 -16
  568. data/doc/rdoc/classes/RIO/IF/YAML.src/M000172.html +0 -16
  569. data/doc/rdoc/classes/RIO/IF/YAML.src/M000173.html +0 -16
  570. data/doc/rdoc/classes/RIO/IF/YAML.src/M000174.html +0 -16
  571. data/doc/rdoc/classes/RIO/IF/YAML.src/M000175.html +0 -16
  572. data/doc/rdoc/classes/RIO/IF/YAML.src/M000176.html +0 -16
  573. data/doc/rdoc/classes/RIO/Rio.html +0 -508
  574. data/doc/rdoc/classes/RIO/Rio.src/M000220.html +0 -18
  575. data/doc/rdoc/classes/RIO/Rio.src/M000221.html +0 -20
  576. data/doc/rdoc/classes/RIO/Rio.src/M000222.html +0 -27
  577. data/doc/rdoc/classes/RIO/Rio.src/M000223.html +0 -16
  578. data/doc/rdoc/classes/RIO/Rio.src/M000225.html +0 -19
  579. data/doc/rdoc/classes/RIO/Rio.src/M000226.html +0 -20
  580. data/doc/rdoc/classes/RIO/Rio.src/M000227.html +0 -16
  581. data/doc/rdoc/classes/RIO/Rio.src/M000228.html +0 -16
  582. data/doc/rdoc/classes/RIO/Rio.src/M000229.html +0 -16
  583. data/doc/rdoc/classes/RIO/Rio.src/M000230.html +0 -16
  584. data/doc/rdoc/classes/RIO/Rio.src/M000231.html +0 -16
  585. data/doc/rdoc/classes/RIO/Rio.src/M000232.html +0 -16
  586. data/doc/rdoc/classes/RIO/Rio.src/M000233.html +0 -16
  587. data/doc/rdoc/created.rid +0 -1
  588. data/doc/rdoc/files/README.html +0 -232
  589. data/doc/rdoc/files/lib/rio/constructor_rb.html +0 -141
  590. data/doc/rdoc/files/lib/rio/doc/EXAMPLES_rb.html +0 -134
  591. data/doc/rdoc/files/lib/rio/doc/HOWTO_rb.html +0 -134
  592. data/doc/rdoc/files/lib/rio/doc/INDEX_rb.html +0 -134
  593. data/doc/rdoc/files/lib/rio/doc/INTRO_rb.html +0 -134
  594. data/doc/rdoc/files/lib/rio/doc/OPTIONAL_rb.html +0 -134
  595. data/doc/rdoc/files/lib/rio/doc/SYNOPSIS_rb.html +0 -134
  596. data/doc/rdoc/files/lib/rio/if/basic_rb.html +0 -134
  597. data/doc/rdoc/files/lib/rio/if/csv_rb.html +0 -134
  598. data/doc/rdoc/files/lib/rio/if/dir_rb.html +0 -134
  599. data/doc/rdoc/files/lib/rio/if/file_rb.html +0 -134
  600. data/doc/rdoc/files/lib/rio/if/fileordir_rb.html +0 -134
  601. data/doc/rdoc/files/lib/rio/if/grande_entry_rb.html +0 -134
  602. data/doc/rdoc/files/lib/rio/if/grande_rb.html +0 -141
  603. data/doc/rdoc/files/lib/rio/if/grande_stream_rb.html +0 -134
  604. data/doc/rdoc/files/lib/rio/if/internal_rb.html +0 -134
  605. data/doc/rdoc/files/lib/rio/if/path_rb.html +0 -134
  606. data/doc/rdoc/files/lib/rio/if/rubyio_rb.html +0 -134
  607. data/doc/rdoc/files/lib/rio/if/string_rb.html +0 -134
  608. data/doc/rdoc/files/lib/rio/if/temp_rb.html +0 -134
  609. data/doc/rdoc/files/lib/rio/if/test_rb.html +0 -134
  610. data/doc/rdoc/files/lib/rio/if/yaml_rb.html +0 -134
  611. data/doc/rdoc/files/lib/rio/kernel_rb.html +0 -142
  612. data/doc/rdoc/files/lib/rio_rb.html +0 -153
  613. data/doc/rdoc/fr_class_index.html +0 -49
  614. data/doc/rdoc/fr_file_index.html +0 -51
  615. data/doc/rdoc/fr_method_index.html +0 -260
  616. data/doc/rdoc/index.html +0 -30
  617. data/doc/rdoc/rdoc-style.css +0 -428
  618. data/doc/rfc1738.txt +0 -1403
  619. data/doc/rfc959.txt +0 -3933
  620. data/ex/catcsv.rb +0 -64
  621. data/ex/colx.rb +0 -8
  622. data/ex/findinruby +0 -15
  623. data/ex/findruby +0 -14
  624. data/ex/passwd_report.rb +0 -8
  625. data/ex/prompt.rb +0 -25
  626. data/ex/rgb.txt.gz +0 -0
  627. data/ex/riocat +0 -42
  628. data/ex/riogunzip +0 -31
  629. data/ex/riogzip +0 -24
  630. data/ex/rioprompt.rb +0 -10
  631. data/ex/targz2zip +0 -17
  632. data/ex/tonl +0 -10
  633. data/setup.rb +0 -1360
  634. data/test/ftp/all.rb +0 -9
  635. data/test/ftp/anon_copy_data.rb +0 -36
  636. data/test/ftp/anon_misc.rb +0 -124
  637. data/test/ftp/anon_read.rb +0 -105
  638. data/test/ftp/anon_special.rb +0 -68
  639. data/test/ftp/anon_write.rb +0 -70
  640. data/test/ftp/ftp2ftp.rb +0 -51
  641. data/test/tc/abs.rb +0 -355
@@ -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>open (RIO::IF::FileOrDir)</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/fileordir.rb, line 42</span>
14
- 42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">open</span>(<span class="ruby-identifier">m</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">m</span>,<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>); <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>symlink (RIO::IF::FileOrDir)</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/fileordir.rb, line 75</span>
14
- 75: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">symlink</span>(<span class="ruby-identifier">dest</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">symlink</span>(<span class="ruby-identifier">dest</span>); <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>readlink (RIO::IF::FileOrDir)</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/fileordir.rb, line 82</span>
14
- 82: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">readlink</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">readlink</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>rename (RIO::IF::FileOrDir)</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/fileordir.rb, line 109</span>
14
- 109: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rename</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">rename</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>); <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>rename! (RIO::IF::FileOrDir)</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/fileordir.rb, line 114</span>
14
- 114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rename!</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">rename!</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>); <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>read (RIO::IF::FileOrDir)</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/fileordir.rb, line 141</span>
14
- 141: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">read</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">read</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>)<span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>rewind (RIO::IF::FileOrDir)</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/fileordir.rb, line 167</span>
14
- 167: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rewind</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">rewind</span>(<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>); <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>seek (RIO::IF::FileOrDir)</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/fileordir.rb, line 199</span>
14
- 199: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">seek</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">seek</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>); <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>pos (RIO::IF::FileOrDir)</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/fileordir.rb, line 227</span>
14
- 227: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pos</span>() <span class="ruby-identifier">target</span>.<span class="ruby-identifier">pos</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>tell (RIO::IF::FileOrDir)</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/fileordir.rb, line 230</span>
14
- 230: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tell</span>() <span class="ruby-identifier">target</span>.<span class="ruby-identifier">tell</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>pos= (RIO::IF::FileOrDir)</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/fileordir.rb, line 254</span>
14
- 254: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">pos=</span>(<span class="ruby-identifier">integer</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">pos</span> = <span class="ruby-identifier">integer</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -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>reopen (RIO::IF::FileOrDir)</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/fileordir.rb, line 259</span>
14
- 259: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">reopen</span>(<span class="ruby-identifier">mode</span>=<span class="ruby-keyword kw">nil</span>) <span class="ruby-identifier">target</span>.<span class="ruby-identifier">reopen</span>(<span class="ruby-identifier">mode</span>); <span class="ruby-keyword kw">self</span> <span class="ruby-keyword kw">end</span></pre>
15
- </body>
16
- </html>
@@ -1,1376 +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 xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
7
- <head>
8
- <title>Module: RIO::IF::Grande</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <meta http-equiv="Content-Script-Type" content="text/javascript" />
11
- <meta name="revisit-after" content="5 days">
12
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
13
- <script type="text/javascript">
14
- // <![CDATA[
15
-
16
- function popupCode( url ) {
17
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
18
- }
19
-
20
- function toggleCode( id ) {
21
- if ( document.getElementById )
22
- elem = document.getElementById( id );
23
- else if ( document.all )
24
- elem = eval( "document.all." + id );
25
- else
26
- return false;
27
-
28
- elemStyle = elem.style;
29
-
30
- if ( elemStyle.display != "block" ) {
31
- elemStyle.display = "block"
32
- } else {
33
- elemStyle.display = "none"
34
- }
35
-
36
- return true;
37
- }
38
-
39
- // Make codeblocks hidden by default
40
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
41
-
42
- // ]]>
43
- </script>
44
-
45
- </head>
46
- <body>
47
-
48
-
49
-
50
- <div id="classHeader">
51
- <table class="header-table">
52
- <tr class="top-aligned-row">
53
- <td class="class-mod"><strong>Module</strong></td>
54
- <td class="class-name-in-header">RIO::IF::Grande</td>
55
- <td rowspan="2" class="class-header-space-col"></td>
56
- <td rowspan="2">
57
- <a class="in-url" href="../../../files/lib/rio/if/grande_rb.html">
58
- lib/rio/if/grande.rb
59
- </a>
60
- &nbsp;&nbsp;
61
- </td>
62
- </tr>
63
-
64
- </table>
65
- </div>
66
- <!-- banner header -->
67
-
68
- <div id="bodyContent">
69
-
70
-
71
-
72
- <div id="contextContent">
73
-
74
-
75
-
76
- </div>
77
-
78
- <div id="method-list">
79
- <h3 class="section-bar">Methods</h3>
80
-
81
- <div class="name-list">
82
- <a href="#M000065">&lt;</a>&nbsp;&nbsp;
83
- <a href="#M000063">&lt;&lt;</a>&nbsp;&nbsp;
84
- <a href="#M000058">&gt;</a>&nbsp;&nbsp;
85
- <a href="#M000061">&gt;&gt;</a>&nbsp;&nbsp;
86
- <a href="#M000053">[]</a>&nbsp;&nbsp;
87
- <a href="#M000064">append_from</a>&nbsp;&nbsp;
88
- <a href="#M000062">append_to</a>&nbsp;&nbsp;
89
- <a href="#M000066">copy_from</a>&nbsp;&nbsp;
90
- <a href="#M000059">copy_to</a>&nbsp;&nbsp;
91
- <a href="#M000055">delete</a>&nbsp;&nbsp;
92
- <a href="#M000057">delete!</a>&nbsp;&nbsp;
93
- <a href="#M000054">each</a>&nbsp;&nbsp;
94
- <a href="#M000069">empty?</a>&nbsp;&nbsp;
95
- <a href="#M000067">get</a>&nbsp;&nbsp;
96
- <a href="#M000068">skip</a>&nbsp;&nbsp;
97
- <a href="#M000070">split</a>&nbsp;&nbsp;
98
- <a href="#M000052">to_a</a>&nbsp;&nbsp;
99
- <a href="#M000056">unlink</a>&nbsp;&nbsp;
100
- <a href="#M000060">|</a>&nbsp;&nbsp;
101
- </div>
102
- </div>
103
-
104
-
105
-
106
- <!-- if includes -->
107
-
108
- <div id="section">
109
-
110
-
111
-
112
-
113
-
114
-
115
-
116
-
117
- <!-- if method_list -->
118
- <div id="methods">
119
- <h3 class="section-bar">Public Instance methods</h3>
120
-
121
- <div id="method-M000065" class="method-detail">
122
- <a name="M000065"></a>
123
-
124
- <div class="method-heading">
125
- <a href="Grande.src/M000065.html" target="Code" class="method-signature"
126
- onclick="popupCode('Grande.src/M000065.html');return false;">
127
- <span class="method-name">&lt;</span><span class="method-args">(source)</span>
128
- </a>
129
- </div>
130
-
131
- <div class="method-description">
132
- <p>
133
- Grande Copy-From Operator
134
- </p>
135
- <p>
136
- The copy-from grande-operator copies a Rio from another Rio or another ruby
137
- object. Its operation is dependent on the the file system objects
138
- referenced, the rio options set, and the state of its source and
139
- destination. In the broadest of terms it could be described as doing the
140
- following:
141
- </p>
142
- <pre>
143
- source.each do |entry|
144
- destination &lt;&lt; entry
145
- end
146
- </pre>
147
- <p>
148
- That is to say, it iterates through its argument, calling the copy-from
149
- operator again for each element. While it is not implemented like this, and
150
- the above code would not give the same results, This generalized
151
- description is convenient.
152
- </p>
153
- <p>
154
- For example the code:
155
- </p>
156
- <pre>
157
- destination &lt; source
158
- </pre>
159
- <p>
160
- is like
161
- </p>
162
- <pre>
163
- source.each { |element| destination &lt;&lt; element }
164
- </pre>
165
- <p>
166
- for any of the following definitions of src and dst
167
- </p>
168
- <ul>
169
- <li>copying files
170
-
171
- <pre>
172
- src = rio('afile')
173
- dst = rio('acopy')
174
- </pre>
175
- </li>
176
- <li>copying parts of files
177
-
178
- <pre>
179
- src = rio('afile').lines(0..9)
180
- dst = rio('acopy')
181
- </pre>
182
- </li>
183
- <li>copying directories
184
-
185
- <pre>
186
- src = rio('srcdir')
187
- dst = rio('dstdir')
188
- </pre>
189
- </li>
190
- <li>copy directories selectively
191
-
192
- <pre>
193
- src = rio('srcdir').dirs(/^\./).files('*.tmp')
194
- dst = rio('dstdir')
195
- </pre>
196
- </li>
197
- <li>copying to a file from an array
198
-
199
- <pre>
200
- src = [&quot;line0\n&quot;,&quot;line1\n&quot;]
201
- dst = rio('afile')
202
- </pre>
203
- </li>
204
- <li>copying to a directory from an array
205
-
206
- <pre>
207
- array = [rio(&quot;file1&quot;),rio(&quot;file2&quot;)]
208
- dst = rio('adir')
209
- </pre>
210
- </li>
211
- </ul>
212
- <p>
213
- Arrays are handled differently depending on whether the rio references a
214
- file or a directory.
215
- </p>
216
- <ul>
217
- <li>If the destination is a file.
218
-
219
- <pre>
220
- dest = rio('afile')
221
- dest &lt; array
222
- # is roughly equivelent to
223
- array.each do |el|
224
- case el
225
- when ::String then dest.print(el)
226
- when ::Rio then dest &lt;&lt; el
227
- else dest &lt;&lt; rio(el)
228
- end
229
- </pre>
230
- </li>
231
- <li>If the destination is a directory
232
-
233
- <pre>
234
- dest = rio('adir')
235
- dest &lt; array
236
- # is roughly equivelent to
237
- array.each do |el|
238
- case el
239
- when ::String then rio(el)
240
- when ::Rio then dest &lt;&lt; el
241
- else dest &lt;&lt; rio(el)
242
- end
243
- </pre>
244
- </li>
245
- </ul>
246
- <p>
247
- To improve run-time efficiency, Rio will choose from among several
248
- strategies when copying. For instance when no file or directory filtering
249
- is specified, FileUtils#cp_r is used to copy directories; and when no line
250
- filtering is specified, FileUtils#cp is used to copy files.
251
- </p>
252
- <pre>
253
- rio('adir') &lt; rio('anotherdir') # 'anotherdir' is copied to 'adir' using FileUtils#cp_r
254
- rio('adir') &lt; rio('anotherdir').files('*.rb') # copy only .rb files
255
- rio('afile') &lt; rio('anotherfile') # 'anotherfile' is copied to 'afile' using FileUtils#cp
256
- rio('afile') &lt; ios # ios must be an IO object opened for reading
257
- rio('afile') &lt; astring # basically the same as rio('afile').print(astring)
258
-
259
- anarray = [ astring, rio('anotherfile') ]
260
- rio('afile') &lt; anarray # copies each element to 'afile' as if one had written
261
- ario = rio('afile')
262
- anarray.each do |el|
263
- ario &lt;&lt; el
264
- end
265
- ario.close
266
- rio('skeldir') &lt; rio('adir').dirs # copy only the directory structure
267
- rio('destdir') &lt; rio('adir').dirs.files(/^\./) # copy the directory structure and all dot files
268
- </pre>
269
- <p>
270
- See also <a href="Grande.html#M000058">></a> (copy-to), <a
271
- href="Grande.html#M000054">each</a>, <a href="Grande.html#M000053">[]</a>
272
- </p>
273
- </div>
274
- </div>
275
-
276
- <div id="method-M000063" class="method-detail">
277
- <a name="M000063"></a>
278
-
279
- <div class="method-heading">
280
- <a href="Grande.src/M000063.html" target="Code" class="method-signature"
281
- onclick="popupCode('Grande.src/M000063.html');return false;">
282
- <span class="method-name">&lt;&lt;</span><span class="method-args">(source)</span>
283
- </a>
284
- </div>
285
-
286
- <div class="method-description">
287
- <p>
288
- Grande Append-From Operator
289
- </p>
290
- <p>
291
- The append-from grande-operator copies a Rio from another Rio or another
292
- ruby object. This behaves like <a href="Grande.html#M000065"><</a>
293
- (copy-from) except unopened Rios are opened for append.
294
- </p>
295
- <p>
296
- The following summarizes how objects are copied:
297
- </p>
298
- <table>
299
- <tr><td valign="top">IO:</td><td>IO#each is used to iterate through the source with each record appended to
300
- the Rio
301
-
302
- </td></tr>
303
- <tr><td valign="top">Array:</td><td>Each element of the Array is appended individually to the Rio.
304
-
305
- </td></tr>
306
- <tr><td valign="top">String:</td><td>The string is appended to the Rio using <a
307
- href="RubyIO.html#M000015">print</a>
308
-
309
- </td></tr>
310
- <tr><td valign="top">Rio:</td><td>The source Rio is appended using its <a href="Grande.html#M000061">>></a>
311
- (append-to) operator
312
-
313
- </td></tr>
314
- </table>
315
- <p>
316
- See <a href="Grande.html#M000065"><</a> (copy-from)
317
- </p>
318
- </div>
319
- </div>
320
-
321
- <div id="method-M000058" class="method-detail">
322
- <a name="M000058"></a>
323
-
324
- <div class="method-heading">
325
- <a href="Grande.src/M000058.html" target="Code" class="method-signature"
326
- onclick="popupCode('Grande.src/M000058.html');return false;">
327
- <span class="method-name">&gt;</span><span class="method-args">(destination)</span>
328
- </a>
329
- </div>
330
-
331
- <div class="method-description">
332
- <p>
333
- Grande Copy-To Operator
334
- </p>
335
- <p>
336
- The copy grande-operator copies a Rio to a another Rio or another ruby
337
- object. The behaviour and the library used depend on the types of the of
338
- the source and destination. For simple file or directory copying
339
- ::FileUtils#cp or ::FileUtils#cp_r will be used. If any of the Rio grande
340
- methods are specified for the source or destination, the source Rio will be
341
- iterated through copying records to the destintion as specified. Roughly
342
- equivelant to
343
- </p>
344
- <pre>
345
- dst = rio('dst_file')
346
- rio('src_file').each do |line|
347
- dst.print(line)
348
- end
349
- dst.close
350
- </pre>
351
- <p>
352
- The destination of the copy operators may be a:
353
- </p>
354
- <table>
355
- <tr><td valign="top">IO:</td><td>Each record of the Rio is written to the IO using IO#print. The IO must be
356
- opened for writing.
357
-
358
- </td></tr>
359
- <tr><td valign="top">Array:</td><td>Each record or entry of the Rio becomes an element of the array
360
-
361
- </td></tr>
362
- <tr><td valign="top">String:</td><td>Puts the entire contents of the Rio into the string
363
-
364
- </td></tr>
365
- <tr><td valign="top">Rio:</td><td>Depends on the destination. See below.
366
-
367
- </td></tr>
368
- </table>
369
- <p>
370
- Copy a file to a file
371
- </p>
372
- <pre>
373
- rio('src_file') &gt; rio('dst_file')
374
- </pre>
375
- <p>
376
- Copy a file to a directory
377
- </p>
378
- <pre>
379
- rio('src_file') &gt; rio('dst_dir')
380
- </pre>
381
- <p>
382
- Copy a directory to another directory
383
- </p>
384
- <pre>
385
- rio('src_dir') &gt; rio('dst_dir')
386
- </pre>
387
- <p>
388
- Make an ungizipped copy of a gzipped file
389
- </p>
390
- <pre>
391
- rio('src.txt.gz').gzip &gt; rio('dst.txt')
392
- </pre>
393
- <p>
394
- Copying to an array
395
- </p>
396
- <pre>
397
- rio('afile') &gt; ary # each line of the file becomes an element of the ary
398
- rio('afile').chomp &gt; ary # same thing with lines chomped
399
- rio('afile.gz').gzip.chomp &gt; ary # same thing from a gzipped file
400
-
401
- rio('afile').lines(0..9) &gt; ary # ary will contain only the first ten lines of the file
402
- rio('afile').chomp.lines(0..9) &gt; ary # same thing with lines chomped
403
- rio('afile').gzip.chomp.lines(0..9) &gt; ary # same thing from a gzipped file
404
-
405
- rio('afile').skiplines(0..9) &gt; ary # ary will contain all but the first ten lines of the file
406
-
407
- rio('adir') &gt; ary # ary will contain a Rio for each entry in the directory
408
- rio('adir').files &gt; ary # same, but only files
409
- rio('adir').files('*.rb') &gt;ary # same, but only .rb files
410
- </pre>
411
- <p>
412
- Copying to a string
413
- </p>
414
- <pre>
415
- rio('afile') &gt; astring # slurp the entire contents of the file into astring
416
- astring = rio('afile').contents # same effect
417
- </pre>
418
- <p>
419
- Copy the first line <b>and</b> every line containing the word Rio into a
420
- gzipped file
421
- </p>
422
- <pre>
423
- rio('src').lines(1,/Rio/) &gt; rio('dst.gz').gzip
424
- </pre>
425
- <p>
426
- Copy lines of a web page into an array with each line chomped
427
- </p>
428
- <pre>
429
- rio('http://ruby-doc.org/index.html').chomp &gt; an_array
430
- </pre>
431
- <p>
432
- Copy the first and 8th through 10th columns of the first ten rows of a
433
- gzipped csv file on a web site into a local gzipped csv file that uses
434
- semi-colons as separators
435
- </p>
436
- <pre>
437
- rio('http://host/file.csv.gz').columns(0,7..9).gzip.csv[0..9] &gt; rio('localfile.csv.gz').csv(';').gzip
438
- </pre>
439
- <p>
440
- See also <a href="Grande.html#M000061">>></a>, <a
441
- href="Grande.html#M000060">|</a>
442
- </p>
443
- </div>
444
- </div>
445
-
446
- <div id="method-M000061" class="method-detail">
447
- <a name="M000061"></a>
448
-
449
- <div class="method-heading">
450
- <a href="Grande.src/M000061.html" target="Code" class="method-signature"
451
- onclick="popupCode('Grande.src/M000061.html');return false;">
452
- <span class="method-name">&gt;&gt;</span><span class="method-args">(destination)</span>
453
- </a>
454
- </div>
455
-
456
- <div class="method-description">
457
- <p>
458
- Grande Append-To Operator
459
- </p>
460
- <p>
461
- The append-to grande-operator is the same as <a
462
- href="Grande.html#M000058">></a> (copy-to) except that it opens the
463
- destination for append. The destination can be a kind of:
464
- </p>
465
- <table>
466
- <tr><td valign="top">IO:</td><td>Each record of the Rio is written to the IO using IO#print. The IO must be
467
- opened for writing.
468
-
469
- </td></tr>
470
- <tr><td valign="top">Array:</td><td>Each record or entry of the Rio is appended to the destination array
471
-
472
- </td></tr>
473
- <tr><td valign="top">String:</td><td>Appends the entire contents of the Rio to destination
474
-
475
- </td></tr>
476
- <tr><td valign="top">Rio:</td><td>Just like <a href="Grande.html#M000058">></a> (copy-to) except the unopened
477
- object are opened for append. If the destination is already opened for
478
- writing or is a directory, this is identical to <a
479
- href="Grande.html#M000058">></a> (copy-to)
480
-
481
- </td></tr>
482
- </table>
483
- <p>
484
- See <a href="Grande.html#M000058">></a> (copy-to)
485
- </p>
486
- <pre>
487
- rio('afile') &gt;&gt; rio('anotherfile') # append the contents of 'afile' to 'anotherfile'
488
- rio('afile') &gt;&gt; rio('adir') # copies 'afile' to the directory 'adir'
489
- rio('adir') &gt;&gt; rio('anotherdir') # copy directory 'adir' recursively to 'anotherdir'
490
- rio('adir') &gt;&gt; array # a Rio for each entry in the directory will be appended to ary
491
- </pre>
492
- </div>
493
- </div>
494
-
495
- <div id="method-M000053" class="method-detail">
496
- <a name="M000053"></a>
497
-
498
- <div class="method-heading">
499
- <a href="Grande.src/M000053.html" target="Code" class="method-signature"
500
- onclick="popupCode('Grande.src/M000053.html');return false;">
501
- <span class="method-name">[]</span><span class="method-args">(*selectors)</span>
502
- </a>
503
- </div>
504
-
505
- <div class="method-description">
506
- <p>
507
- Grande subscript operator.
508
- </p>
509
- <p>
510
- For files this returns all or part of a file as an array.
511
- </p>
512
- <p>
513
- For directories this returns all or some of the entries in a directory
514
- </p>
515
- <h3>Files</h3>
516
- <p>
517
- This combines the record selection offered by <a
518
- href="GrandeStream.html#M000076">records</a> with the conversion to an
519
- array provided by <a href="Grande.html#M000052">to_a</a>. The following two
520
- are equivelant:
521
- </p>
522
- <pre>
523
- ario[*args]
524
- ario.records(*args).to_a
525
- </pre>
526
- <p>
527
- What constitutes an array element is determined by <a
528
- href="GrandeStream.html#M000074">lines</a>, <a
529
- href="GrandeStream.html#M000075">bytes</a>, or by an extension such as <a
530
- href="CSV.html#M000129">csv</a>. <a
531
- href="GrandeStream.html#M000074">lines</a> is the default.
532
- </p>
533
- <p>
534
- Arguments may consist of zero or more integers, ranges, regular
535
- expressions, symbols, procs, and arrays An empty argument list selects all
536
- records
537
- </p>
538
- <p>
539
- Records are selected as follows.
540
- </p>
541
- <table>
542
- <tr><td valign="top">range:</td><td>specifies a range of records to be selected (zero based)
543
-
544
- </td></tr>
545
- <tr><td valign="top">regexp:</td><td>matching records will be selected.
546
-
547
- </td></tr>
548
- <tr><td valign="top">integer:</td><td>treated like a one element range
549
-
550
- </td></tr>
551
- <tr><td valign="top">symbol:</td><td>the symbol is sent to each record. Record is selected unless false is
552
- returned
553
-
554
- </td></tr>
555
- <tr><td valign="top">proc:</td><td>the proc is called with the record as an argument. Record is selected
556
- unless false is returned
557
-
558
- </td></tr>
559
- <tr><td valign="top">array:</td><td>the array may contain any of the other selector types. Record is selected
560
- unless any of the selectors returns false. (a logical and)
561
-
562
- </td></tr>
563
- </table>
564
- <p>
565
- A record matching <b>any</b> of the selectors will be included in the
566
- array. (acts like an <em>or</em>)
567
- </p>
568
- <p>
569
- Because this is implemented in terms of the <a
570
- href="Grande.html#M000054">each</a>, When only record ranges are used to
571
- select records, iteration will stop when the recno exceeds the maximum of
572
- any range. That is to say
573
- </p>
574
- <p>
575
- This reads one record from a file and returns it
576
- </p>
577
- <pre>
578
- rio('bigfile.mp3').bytes(1024)[0]
579
- </pre>
580
- <p>
581
- While this reads <b>all</b> records from a file and returns the first one
582
- </p>
583
- <pre>
584
- rio('bigfile.mp3').bytes(1024).to_a[0]
585
- </pre>
586
- <h3>Directories</h3>
587
- <p>
588
- This combines the entry selection offered by <a
589
- href="GrandeEntry.html#M000109">entries</a> with the conversion to an array
590
- provided by <a href="Grande.html#M000052">to_a</a>. The following two are
591
- equivelant:
592
- </p>
593
- <pre>
594
- ario[*args]
595
- ario.entries(*args).to_a
596
- </pre>
597
- <p>
598
- Arguments may consist of strings (treated as globs) or regular expressions.
599
- An empty argument list selects all entries See ::Dir#glob and
600
- ::File::fnmatch? for more in information on <em>globs</em>. Be warned that
601
- using the &#8217;**&#8217; glob recurses into directories independently of
602
- <a href="GrandeEntry.html#M000114">all</a> and using both is unsupported.
603
- </p>
604
- <pre>
605
- ario = rio('adir')
606
- ario[] # returns an array containg all entries in _adir_
607
- ario[/^zippy/] # all entries starting with 'zippy'
608
- ario['zippy*'] # same thing
609
- </pre>
610
- <p>
611
- As with <a href="Grande.html#M000054">each</a>:
612
- </p>
613
- <ul>
614
- <li>Files and directories are returned as Rios
615
-
616
- </li>
617
- <li>The types of entries is also affected by <a
618
- href="GrandeEntry.html#M000111">files</a> and <a
619
- href="GrandeEntry.html#M000107">dirs</a>.
620
-
621
- <pre>
622
- rio('adir').files['*.txt'] # array of all .txt files
623
- rio('adir').dirs[/^\./] # array of all dot directories
624
- </pre>
625
- </li>
626
- <li>Recursion is enabled using <a href="GrandeEntry.html#M000114">all</a>
627
-
628
- <pre>
629
- rio('adir').all.files['*.[ch]'] # array of c source files in adir and its subdirecories
630
- rio('adir').all.dirs[/^\.svn/] # array of subversion directories in adir and subdirectories
631
- </pre>
632
- </li>
633
- <li><a href="GrandeEntry.html#M000111">files</a> and <a
634
- href="GrandeEntry.html#M000107">dirs</a> act independently of each other.
635
- Specifying both will cause both to be returned. The argument list to <a
636
- href="Grande.html#M000053">[]</a> will be applied to the closest.
637
-
638
- <pre>
639
- rio('adir').files('*.rb').dirs['ruby*'] # array of .rb files and
640
- # directories starting with 'ruby'
641
- rio('adir').dirs('ruby*').files['*.rb'] # same thing
642
- </pre>
643
- </li>
644
- </ul>
645
- <h3>Lines</h3>
646
- <p>
647
- This section applies similarly to <a
648
- href="GrandeStream.html#M000074">lines</a>, <a
649
- href="GrandeStream.html#M000075">bytes</a>, <a
650
- href="GrandeStream.html#M000076">records</a>, and <a
651
- href="GrandeStream.html#M000079">rows</a>
652
- </p>
653
- <p>
654
- Using <a href="GrandeStream.html#M000074">lines</a> and related methods
655
- with a Rio referencing a directory imples <a
656
- href="GrandeEntry.html#M000111">files</a> and will cause an array of the
657
- lines or bytes in the files to be returned. As above, the arguments to the
658
- subscript operator will be applied to the closest.
659
- </p>
660
- <pre>
661
- rio('adir').lines[] # array of all lines in the files in 'adir'
662
- rio('adir').files.lines[] # same thing
663
- rio('adir').lines(0..9).files['*.txt'] # array of the first ten lines of all .txt files
664
- rio('adir').files('*.txt').lines[0..9] # same thing
665
- rio('adir').all.files('*.rb').lines[/^\s*require/] # array of 'require' lines in .rb files in
666
- # 'adir and its subdirectories
667
- </pre>
668
- <p>
669
- Note the difference between the following similar usages
670
- </p>
671
- <pre>
672
- it1 = rio('adir').files('*.rb') # returns a Rio, prepared for selecting ruby files
673
- it2 = rio('adir').files['*.rb'] # returns an array of the ruby files
674
- </pre>
675
- <p>
676
- The second example above could have been written
677
- </p>
678
- <pre>
679
- it2 = it1.to_a
680
- </pre>
681
- <p>
682
- Examples:
683
- </p>
684
- <pre>
685
- rio('afile.txt').lines[1..2] # array containing the 2nd and 3rd line
686
-
687
- rio('afile.txt')[1,3..5] # array containing lines 1,3,4 and 5
688
-
689
- rio('afile.txt')[/Zippy/] # array of all lines containing 'Zippy'
690
-
691
- rio('afile.txt')[1,3..5,/Zippy/] # array with lines 1,3,4 and 5 and all lines containing 'Zippy'
692
-
693
- rio('afile.dat').bytes(50)[] # array containing the contents of afile.dat broken up into 50 byte chunks
694
-
695
- rio('afile.dat').bytes(50)[0,2] # array containing the first and third such chunk
696
-
697
- rio('afile.dat').bytes(50).records[0,2] # same thing
698
-
699
- rio('afile.dat').bytes(50).records(0,2).to_a # once again
700
-
701
- rio('afile.csv').csv[0..9] # array of the first 10 records of afile.csv parsed by the ::CSV module
702
-
703
- rio('afile.csv').csv.records[0..9] # same thing
704
-
705
- rio('afile.csv').csv(';').records[0..9] # same thing using semi-colon as the value separator
706
-
707
- rio('afile.csv').csv.records[0,/Zippy/] # record 0 and all records containing 'Zippy'
708
- # the regexp is matched against the line before parsing by ::CSV
709
-
710
- rio('adir')[] # array of entries in 'adir'
711
-
712
- rio('adir')['*.txt'] # array of all .txt entries
713
-
714
- rio('adir').all['*.txt'] # array of all .txt entries in 'adir and its subdirectories
715
-
716
- rio('adir').files['*.txt'] # array of all .txt files
717
-
718
- rio('adir').dirs['CSV'] # array of all CSV directories
719
- rio('adir').skipdirs['CSV'] # array of all non-CSV directories
720
- </pre>
721
- </div>
722
- </div>
723
-
724
- <div id="method-M000064" class="method-detail">
725
- <a name="M000064"></a>
726
-
727
- <div class="method-heading">
728
- <a href="Grande.src/M000064.html" target="Code" class="method-signature"
729
- onclick="popupCode('Grande.src/M000064.html');return false;">
730
- <span class="method-name">append_from</span><span class="method-args">(source)</span>
731
- </a>
732
- </div>
733
-
734
- <div class="method-description">
735
- <p>
736
- Alias for <a href="Grande.html#M000063"><<</a> (append-from grande
737
- operator)
738
- </p>
739
- </div>
740
- </div>
741
-
742
- <div id="method-M000062" class="method-detail">
743
- <a name="M000062"></a>
744
-
745
- <div class="method-heading">
746
- <a href="Grande.src/M000062.html" target="Code" class="method-signature"
747
- onclick="popupCode('Grande.src/M000062.html');return false;">
748
- <span class="method-name">append_to</span><span class="method-args">(destination)</span>
749
- </a>
750
- </div>
751
-
752
- <div class="method-description">
753
- <p>
754
- Alias for <a href="Grande.html#M000061">>></a> (append-to grande operator)
755
- </p>
756
- </div>
757
- </div>
758
-
759
- <div id="method-M000066" class="method-detail">
760
- <a name="M000066"></a>
761
-
762
- <div class="method-heading">
763
- <a href="Grande.src/M000066.html" target="Code" class="method-signature"
764
- onclick="popupCode('Grande.src/M000066.html');return false;">
765
- <span class="method-name">copy_from</span><span class="method-args">(source)</span>
766
- </a>
767
- </div>
768
-
769
- <div class="method-description">
770
- <p>
771
- Alias for <a href="Grande.html#M000065"><</a> (copy-from grande operator)
772
- </p>
773
- </div>
774
- </div>
775
-
776
- <div id="method-M000059" class="method-detail">
777
- <a name="M000059"></a>
778
-
779
- <div class="method-heading">
780
- <a href="Grande.src/M000059.html" target="Code" class="method-signature"
781
- onclick="popupCode('Grande.src/M000059.html');return false;">
782
- <span class="method-name">copy_to</span><span class="method-args">(destination)</span>
783
- </a>
784
- </div>
785
-
786
- <div class="method-description">
787
- <p>
788
- Alias for <a href="Grande.html#M000058">></a> (copy-to grande operator)
789
- </p>
790
- </div>
791
- </div>
792
-
793
- <div id="method-M000055" class="method-detail">
794
- <a name="M000055"></a>
795
-
796
- <div class="method-heading">
797
- <a href="Grande.src/M000055.html" target="Code" class="method-signature"
798
- onclick="popupCode('Grande.src/M000055.html');return false;">
799
- <span class="method-name">delete</span><span class="method-args">()</span>
800
- </a>
801
- </div>
802
-
803
- <div class="method-description">
804
- <p>
805
- For a file Rio <tt>delete</tt> calls FileUtils#rm. For a directory Rio
806
- <tt>delete</tt> calls FileUtils#rmdir Returns the Rio. If the Rio does not
807
- exist, simply return the Rio.
808
- </p>
809
- <pre>
810
- rio('afile,txt').delete # delete 'afile.txt'
811
- rio('adir').delete # delete adir
812
- rio('something').delete # delete something
813
- </pre>
814
- </div>
815
- </div>
816
-
817
- <div id="method-M000057" class="method-detail">
818
- <a name="M000057"></a>
819
-
820
- <div class="method-heading">
821
- <a href="Grande.src/M000057.html" target="Code" class="method-signature"
822
- onclick="popupCode('Grande.src/M000057.html');return false;">
823
- <span class="method-name">delete!</span><span class="method-args">()</span>
824
- </a>
825
- </div>
826
-
827
- <div class="method-description">
828
- <p>
829
- For a file <a href="Grande.html#M000057">delete!</a> calls FileUtils#rm.
830
- For a directory <a href="Grande.html#M000057">delete!</a> calls
831
- FileUtils#rmtree. Returns the Rio. If the rio does not exist, simply
832
- returns itself.
833
- </p>
834
- <pre>
835
- rio('afile,txt').delete! # delete f.txt
836
- rio('adir').delete! # delete adir
837
-
838
- # create a directory, after deleting anything that previously had its name
839
- rio('adir/asubdir').delete!.mkpath
840
- </pre>
841
- <h4>Deleting Summary</h4>
842
- <ul>
843
- <li>To delete something only if it is not a directory use <a
844
- href="File.html#M000216">rm</a>
845
-
846
- </li>
847
- <li>To delete an empty directory use <a href="Dir.html#M000048">rmdir</a>
848
-
849
- </li>
850
- <li>To delete an entire directory tree use <a
851
- href="Dir.html#M000049">rmtree</a>
852
-
853
- </li>
854
- <li>To delete anything except a populated directory use <a
855
- href="Grande.html#M000055">delete</a>
856
-
857
- </li>
858
- <li>To delete anything use <a href="Grande.html#M000057">delete!</a>
859
-
860
- </li>
861
- </ul>
862
- <p>
863
- In all cases, deleting something that does not exist is considered
864
- successful.
865
- </p>
866
- </div>
867
- </div>
868
-
869
- <div id="method-M000054" class="method-detail">
870
- <a name="M000054"></a>
871
-
872
- <div class="method-heading">
873
- <a href="Grande.src/M000054.html" target="Code" class="method-signature"
874
- onclick="popupCode('Grande.src/M000054.html');return false;">
875
- <span class="method-name">each</span><span class="method-args">(*args,&amp;block)</span>
876
- </a>
877
- </div>
878
-
879
- <div class="method-description">
880
- <p>
881
- Iterate through a rio. Executes the block for each item selected for the
882
- Rio. See <a href="GrandeStream.html#M000074">lines</a>, <a
883
- href="GrandeStream.html#M000076">records</a>, <a
884
- href="GrandeStream.html#M000075">bytes</a>, <a
885
- href="GrandeEntry.html#M000111">files</a>, <a
886
- href="GrandeEntry.html#M000107">dirs</a>, <a
887
- href="Grande.html#M000053">[]</a> and <a
888
- href="Grande.html#M000052">to_a</a> for more information on how records are
889
- selected and what kind of record is passed to the block.
890
- </p>
891
- <p>
892
- <a href="Grande.html#M000054">each</a> is the fundemental method for all
893
- the Rio grande operators. <a href="Grande.html#M000052">to_a</a> and the
894
- Rio copy operators <a href="Grande.html#M000065"><</a>, <a
895
- href="Grande.html#M000063"><<</a>, <a href="Grande.html#M000061">>></a>,
896
- and <a href="Grande.html#M000058">></a> are all implemented in terms of <a
897
- href="Grande.html#M000054">each</a>.
898
- </p>
899
- <p>
900
- While <a href="Grande.html#M000054">each</a> is fundamental to a Rio, it
901
- rarely needs actually be called because all the grande configuration
902
- methods will also take a block and call <a
903
- href="Grande.html#M000054">each</a> if one is given. So the existance of a
904
- block after many methods is taken as an implied <a
905
- href="Grande.html#M000054">each</a>
906
- </p>
907
- <p>
908
- For Rios that refer to files, the item passed to the block is a String
909
- containing the line or block as selected by <a
910
- href="GrandeStream.html#M000074">lines</a>, or <a
911
- href="GrandeStream.html#M000075">bytes</a>. <tt>lines</tt> is the default.
912
- </p>
913
- <pre>
914
- rio('afile').lines.each { |line| ...}
915
- </pre>
916
- <p>
917
- The block passed to <tt>each</tt> will also accept an optional second
918
- parameter which will contain the result of the matching function. What this
919
- variable contains depends on the argument to <tt>lines</tt> that resulted
920
- in the match as follows:
921
- </p>
922
- <table>
923
- <tr><td valign="top">Regexp:</td><td>The MatchData that resulted from the match.
924
-
925
- </td></tr>
926
- <tr><td valign="top">Range:</td><td>The record number of the matching record.
927
-
928
- </td></tr>
929
- <tr><td valign="top">Fixnum:</td><td>The record number of the matching record.
930
-
931
- </td></tr>
932
- <tr><td valign="top">Proc:</td><td>The value returned by the proc.
933
-
934
- </td></tr>
935
- <tr><td valign="top">Symbol:</td><td>The value resulting from sending the symbol to the String.
936
-
937
- </td></tr>
938
- </table>
939
- <p>
940
- If no selection arguments were used, this variable will simply contain
941
- <tt>true</tt>.
942
- </p>
943
- <pre>
944
- rio(??).puts(%w[0:zero 1:one]).rewind.lines(/(\d+):([a-z]+)/) do |line,match|
945
- puts(&quot;#{match[1]} is spelled '#{match[2]}'&quot;)
946
- end
947
- </pre>
948
- <p>
949
- Produces:
950
- </p>
951
- <pre>
952
- 0 is spelled 'zero'
953
- 1 is spelled 'one'
954
- </pre>
955
- <p>
956
- For Rios that refer to directories, the item passed to the block is a Rio
957
- refering to the directory entry.
958
- </p>
959
- <pre>
960
- rio('adir').files.each do |file|
961
- file.kind_of?(RIO::Rio) # true
962
- end
963
- </pre>
964
- <p>
965
- In addition, the Rio passed to the block inherits certain attributes from
966
- the directory Rio.
967
- </p>
968
- <pre>
969
- rio('adir').files.chomp.each do |file| # chomp is ignored for directories,
970
- file.each do |line| # chomp attribute is inherited by the file rio
971
- # .. line is chomped
972
- end
973
- end
974
- </pre>
975
- <p>
976
- <a href="Grande.html#M000054">each</a> returns the Rio which called it.
977
- </p>
978
- <p>
979
- Here are a few illustrative examples
980
- </p>
981
- <ul>
982
- <li>Processing lines in a file
983
-
984
- <pre>
985
- rio('f.txt').each { |line| ... } # execute block for every line in the file
986
- rio('f.txt').lines.each { |line| ... } # same thing
987
- rio('f.txt').lines { |line| ... } # same thing
988
-
989
- rio('f.txt').chomp.each { |line| ... } # same as above with lines chomped
990
- rio('f.txt').chomp { |line| ... } # ditto
991
- rio('f.txt').lines.chomp { |line| ... } # ditto
992
- rio('f.txt').chomp.lines { |line| ... } # ditto
993
-
994
- rio('f.txt.gz').gzip.each { |line| ... } # execute block for every line in a gzipped file
995
- rio('f.txt.gz').gzip { |line| ... } # same thing
996
- rio('f.txt.gz').lines.gzip { |line| ... } # same thing
997
-
998
- rio('f.txt.gz').gzip.chomp { |line| ... } # chomp lines from a gzipped file
999
- rio('f.txt.gz').gzip.chomp.each { |line| ... } # ditto
1000
- rio('f.txt.gz').chomp.lines.gzip { |line| ... } # ditto
1001
-
1002
- rio('f.txt').lines(0..9) { |line| ... } # execute block for the first 10 lines in the file
1003
- rio('f.txt').lines(0..9).each { |line| ... } # same thing
1004
-
1005
- rio('f.txt').lines(/^\s*#/) { |line| ... } # execute block for comment-only lines
1006
- rio('f.txt').lines(/^\s*#/).each { |line| ... } # same thing
1007
-
1008
- rio('f.txt').lines(0,/Rio/) { |line| ... } # execute block for the first line and
1009
- # all lines containing 'Rio'
1010
-
1011
- rio('f.txt.gz').gzip.chomp.lines(0..1) { |line| ... } # first 2 lines chomped from a gzip file
1012
- </pre>
1013
- </li>
1014
- <li>Processing a file a block at a time
1015
-
1016
- <pre>
1017
- rio('f.dat').bytes(10).each { |data| ... } # process the file 10 bytes at a time
1018
- rio('f.dat').bytes(10) { |data| ... } # same thing
1019
- rio('f.dat').bytes(10).records(2,4) { |data| ... } # only 3rd and 5th ten-byte data-block
1020
- rio('f.dat.gz').gzip.records(2,4).bytes(10) { |data| ... } # same from a gzipped file
1021
- </pre>
1022
- </li>
1023
- <li>Iterating over directories
1024
-
1025
- <pre>
1026
- rio('adir').each { |ent| ... } # execute the block for each entry in the directory 'adir'
1027
- rio('adir').files.each { |file| ...} # only files
1028
- rio('adir').files { |file| ...} # ditto
1029
- rio('adir').all.files { |file| ...} # files, recurse into subdirectories
1030
- rio('adir').dirs { |dir| ...} # only directories
1031
- rio('adir').files('*.rb') { |file| ...} # only .rb files using a glob
1032
- rio('adir').files(/\.rb$/) { |file| ...} # only .rb files using a regular expression
1033
- rio('adir').all.files('*.rb') { |file| ...} # .rb files, recursing into subdirectories
1034
- rio('adir').dirs(/^\./) { |dir| ... } # only dot directories
1035
- rio('adir').dirs('/home/*') { |dir| ... } # home directories
1036
- </pre>
1037
- </li>
1038
- </ul>
1039
- <p>
1040
- See <a href="../Doc/HOWTO.html">RIO::Doc::HOWTO</a> and <a
1041
- href="../Doc/SYNOPSIS.html">RIO::Doc::SYNOPSIS</a> for more examples, and
1042
- <a href="../Doc/INTRO.html">RIO::Doc::INTRO</a> for further explanation.
1043
- </p>
1044
- </div>
1045
- </div>
1046
-
1047
- <div id="method-M000069" class="method-detail">
1048
- <a name="M000069"></a>
1049
-
1050
- <div class="method-heading">
1051
- <a href="Grande.src/M000069.html" target="Code" class="method-signature"
1052
- onclick="popupCode('Grande.src/M000069.html');return false;">
1053
- <span class="method-name">empty?</span><span class="method-args">()</span>
1054
- </a>
1055
- </div>
1056
-
1057
- <div class="method-description">
1058
- <p>
1059
- Returns true if the referenced file or directory is empty after honoring
1060
- the grande selection methods.
1061
- </p>
1062
- <pre>
1063
- rio('f0').delete!.touch.empty? #=&gt; true
1064
- rio('f1').puts!(&quot;Not Empty\n&quot;).empty? #=&gt; false
1065
- rio('d0').delete!.mkdir.empty? #=&gt; true
1066
- </pre>
1067
- </div>
1068
- </div>
1069
-
1070
- <div id="method-M000067" class="method-detail">
1071
- <a name="M000067"></a>
1072
-
1073
- <div class="method-heading">
1074
- <a href="Grande.src/M000067.html" target="Code" class="method-signature"
1075
- onclick="popupCode('Grande.src/M000067.html');return false;">
1076
- <span class="method-name">get</span><span class="method-args">()</span>
1077
- </a>
1078
- </div>
1079
-
1080
- <div class="method-description">
1081
- <p>
1082
- Reads and returns the next record or entry from a Rio, honoring the grande
1083
- selection methods.
1084
- </p>
1085
- <p>
1086
- Returns nil on end of file.
1087
- </p>
1088
- <p>
1089
- See also <a href="GrandeStream.html#M000076">records</a>, <a
1090
- href="GrandeStream.html#M000074">lines</a>, <a
1091
- href="Grande.html#M000054">each</a>, <a href="Grande.html#M000053">[]</a>
1092
- </p>
1093
- <pre>
1094
- ario = rio('afile').lines(10..12)
1095
- line10 = ario.get
1096
- line11 = ario.get
1097
- line12 = ario.get
1098
- a_nil = ario.get
1099
-
1100
- ario = rio('adir').entries('*.txt')
1101
- ent1 = ario.get
1102
- ent2 = ario.get
1103
- </pre>
1104
- </div>
1105
- </div>
1106
-
1107
- <div id="method-M000068" class="method-detail">
1108
- <a name="M000068"></a>
1109
-
1110
- <div class="method-heading">
1111
- <a href="Grande.src/M000068.html" target="Code" class="method-signature"
1112
- onclick="popupCode('Grande.src/M000068.html');return false;">
1113
- <span class="method-name">skip</span><span class="method-args">(*args,&amp;block)</span>
1114
- </a>
1115
- </div>
1116
-
1117
- <div class="method-description">
1118
- <p>
1119
- Grande Exclude method
1120
- </p>
1121
- <p>
1122
- <tt>skip</tt> can be used in two ways.
1123
- </p>
1124
- <h4>skip with no arguments</h4>
1125
- <p>
1126
- If called with no arguments it reverses the polarity of the next non-skip
1127
- grande selection method that is called. That is, it turns <tt>lines</tt>,
1128
- <tt>records</tt>, <tt>rows</tt>, <tt>files</tt>, <tt>dirs</tt> and
1129
- <tt>entries</tt> into <tt>skiplines</tt>, <tt>skiprecords</tt>,
1130
- <tt>skiprows</tt>, <tt>skipfiles</tt>, <tt>skipdirs</tt>, and
1131
- <tt>skipentries</tt>, respectively.
1132
- </p>
1133
- <pre>
1134
- rio('afile').skip.lines(0..5) # same as rio('afile').skiplines(0..5)
1135
- rio('adir').skip.files('*~') # same as rio('adir').skipfiles('*~')
1136
- </pre>
1137
- <p>
1138
- Note that it only affects the next selection method seen &#8212; and may be
1139
- used more than once. If no grande selection method is seen, <tt>skip</tt>
1140
- is ignored.
1141
- </p>
1142
- <h4>skip with arguments</h4>
1143
- <p>
1144
- When called with arguments it acts like <a
1145
- href="GrandeEntry.html#M000110">skipentries</a> for directory Rios and like
1146
- <a href="GrandeStream.html#M000077">skiprecords</a> for stream Rios.
1147
- </p>
1148
- <pre>
1149
- rio('afile').lines(/Rio/).skip[0..4] # lines containg 'Rio' excluding the
1150
- # first five lines
1151
-
1152
- rio('adir').files('*.rb').skip[:symlink?] # .rb files, but not symlinks to
1153
- # .rb files
1154
- </pre>
1155
- <p>
1156
- If a block is given, behaves as if <tt>skip(*args).each(&amp;block)</tt>
1157
- had been called.
1158
- </p>
1159
- <p>
1160
- Returns the Rio.
1161
- </p>
1162
- <p>
1163
- See <a href="GrandeStream.html#M000078">skiplines</a>, <a
1164
- href="GrandeStream.html#M000077">skiprecords</a>, <a
1165
- href="GrandeStream.html#M000080">skiprows</a>, <a
1166
- href="GrandeEntry.html#M000112">skipfiles</a>, <a
1167
- href="GrandeEntry.html#M000108">skipdirs</a>, and <a
1168
- href="GrandeEntry.html#M000110">skipentries</a>.
1169
- </p>
1170
- </div>
1171
- </div>
1172
-
1173
- <div id="method-M000070" class="method-detail">
1174
- <a name="M000070"></a>
1175
-
1176
- <div class="method-heading">
1177
- <a href="Grande.src/M000070.html" target="Code" class="method-signature"
1178
- onclick="popupCode('Grande.src/M000070.html');return false;">
1179
- <span class="method-name">split</span><span class="method-args">(*args,&amp;block)</span>
1180
- </a>
1181
- </div>
1182
-
1183
- <div class="method-description">
1184
- <p>
1185
- <a href="Grande.html#M000070">split</a> has two distinct behaviors
1186
- depending on whether or not it is called with an argument.
1187
- </p>
1188
- <h4>split with no aruments:</h4>
1189
- <p>
1190
- Returns an array of Rios, one for each path element. (Note that this
1191
- behavior differs from File#split.)
1192
- </p>
1193
- <pre>
1194
- rio('a/b/c').split #=&gt; [rio('a'),rio('b'),rio('c')]
1195
- </pre>
1196
- <p>
1197
- The array returned is extended with a <tt>to_rio</tt> method, which will
1198
- put the parts back together again.
1199
- </p>
1200
- <pre>
1201
- ary = rio('a/b/c').split #=&gt; [rio('a'),rio('b'),rio('c')]
1202
- ary.to_rio #=&gt; rio('a/b/c')
1203
-
1204
- ary = rio('a/b/c').split #=&gt; [rio('a'),rio('b'),rio('c')]
1205
- ary[1] = rio('d')
1206
- ary.to_rio #=&gt; rio('a/d/c')
1207
- </pre>
1208
- <p>
1209
- See also <a href="Path.html#M000152">join</a>, <a
1210
- href="Path.html#M000154">/</a>, <a href="Path.html#M000153">splitpath</a>
1211
- </p>
1212
- <h4>split with an argument:</h4>
1213
- <p>
1214
- This causes String#split(arg) to be called on every line before it is
1215
- returned. An array of the split lines is returned when iterating
1216
- </p>
1217
- <pre>
1218
- rio('/etc/passwd').split(':').columns(0,2) { |ary|
1219
- username,uid = ary
1220
- }
1221
-
1222
- rio('/etc/passwd').split(':').columns(0,2).to_a #=&gt; [[user1,uid1],[user2,uid2]]
1223
- </pre>
1224
- </div>
1225
- </div>
1226
-
1227
- <div id="method-M000052" class="method-detail">
1228
- <a name="M000052"></a>
1229
-
1230
- <div class="method-heading">
1231
- <a href="Grande.src/M000052.html" target="Code" class="method-signature"
1232
- onclick="popupCode('Grande.src/M000052.html');return false;">
1233
- <span class="method-name">to_a</span><span class="method-args">()</span>
1234
- </a>
1235
- </div>
1236
-
1237
- <div class="method-description">
1238
- <p>
1239
- Returns the contents of the rio as an array. (See ::Enumerable#to_a)
1240
- </p>
1241
- <p>
1242
- <a href="Grande.html#M000052">to_a</a> is implemented in terms of <a
1243
- href="Grande.html#M000054">each</a> so the the following are roughly
1244
- equivelent
1245
- </p>
1246
- <pre>
1247
- ary = ario.to_a
1248
-
1249
- ary = []
1250
- ario.each do |rec|
1251
- ary &lt;&lt; ary
1252
- end
1253
- </pre>
1254
- <p>
1255
- What constitutes an array element is determined by <a
1256
- href="GrandeStream.html#M000074">lines</a>, <a
1257
- href="GrandeStream.html#M000075">bytes</a>, <a
1258
- href="GrandeStream.html#M000076">records</a>, <a
1259
- href="GrandeStream.html#M000079">rows</a> or by an extension such as <a
1260
- href="CSV.html#M000129">csv</a>. <a
1261
- href="GrandeStream.html#M000074">lines</a> is the default.
1262
- </p>
1263
- <pre>
1264
- rio('afile.txt').to_a # returns an array of the lines in afile.txt
1265
-
1266
- rio('afile.txt').lines(1...3).to_a # an array containing lines 1 and 2 of afile.txt
1267
-
1268
- rio('afile.dat').bytes(50).to_a # an array containing the contents of afile.dat broken
1269
- # up into 50 byte chunks
1270
- </pre>
1271
- <p>
1272
- See also <a href="Grande.html#M000053">[]</a> (subscript operator)
1273
- </p>
1274
- </div>
1275
- </div>
1276
-
1277
- <div id="method-M000056" class="method-detail">
1278
- <a name="M000056"></a>
1279
-
1280
- <div class="method-heading">
1281
- <a href="Grande.src/M000056.html" target="Code" class="method-signature"
1282
- onclick="popupCode('Grande.src/M000056.html');return false;">
1283
- <span class="method-name">unlink</span><span class="method-args">()</span>
1284
- </a>
1285
- </div>
1286
-
1287
- <div class="method-description">
1288
- <p>
1289
- See <a href="Grande.html#M000055">delete</a>
1290
- </p>
1291
- </div>
1292
- </div>
1293
-
1294
- <div id="method-M000060" class="method-detail">
1295
- <a name="M000060"></a>
1296
-
1297
- <div class="method-heading">
1298
- <a href="Grande.src/M000060.html" target="Code" class="method-signature"
1299
- onclick="popupCode('Grande.src/M000060.html');return false;">
1300
- <span class="method-name">|</span><span class="method-args">(destination)</span>
1301
- </a>
1302
- </div>
1303
-
1304
- <div class="method-description">
1305
- <p>
1306
- Grande Pipe Operator
1307
- </p>
1308
- <p>
1309
- The Rio pipe operator is actually an alternative syntax for calling the <a
1310
- href="Grande.html#M000058">></a> (copy-to) operator, designed to allow
1311
- several copy operation to be performed in one line of code, with behavior
1312
- that mimics the pipe operator commonly available in shells.
1313
- </p>
1314
- <p>
1315
- If <tt>destination</tt> is a <tt>cmdio</tt>, a <tt>cmdpipe</tt> Rio is
1316
- returned, and none of the commands are run.
1317
- </p>
1318
- <p>
1319
- Otherwise the <tt>cmdpipe</tt> Rio is run with the output of the pipe being
1320
- copied to the destination. In this case a Rio representing the
1321
- <tt>destination</tt> is returned.
1322
- </p>
1323
- <p>
1324
- If destination is not a Rio it is passed to the Rio constructor as is done
1325
- with the copy-to operator except that if <tt>destination</tt> is a String
1326
- it is assumed to be a command instead of a path.
1327
- </p>
1328
- <pre>
1329
- rio('afile') | rio(?-,'grep i') | rio(?-) # returns rio(?-)
1330
- # equivelent to rio(?-, 'grep i') &lt; rio('afile') &gt; rio(?-)
1331
-
1332
- rio('infile') | rio(?-, 'acmd') | rio(?-, 'acmd2') | rio('outfile')
1333
- # same as
1334
- # acmd = rio(?-,'acmd')
1335
- # acmd2 = rio(?-,'acmd2')
1336
- # out = rio('outfile')
1337
- # acmd &lt; rio('infile')
1338
- # acmd2 &lt; acmd
1339
- # out &lt; acmd2
1340
-
1341
- rio('afile') | 'acmd' | 'acmd2' | rio('outfile') # same thing
1342
-
1343
- acmdpipe = rio(?-,'acmd') | 'acmd2'
1344
- rio('afile') | acmdpipe | rio('outfile') # same thing
1345
-
1346
- acmdpipe1 = rio(?|,'acmd','acmd2')
1347
- rio('afile') | acmdpipe1 | rio('outfile') # same thing
1348
-
1349
- acmdpipe2 = rio('afile') | 'acmd' | 'acmd2'
1350
- acmdpipe2 | rio('outfile') # same thing
1351
- </pre>
1352
- <p>
1353
- The grande pipe operator can not be used to create a <tt>cmdpipe</tt> Rio
1354
- that includes a destination. This must be done using a Rio constructor
1355
- </p>
1356
- <pre>
1357
- cmd_with_output = rio(?|,'acmd',rio('outfile'))
1358
- rio('afile') | cmd_with_output # same as above
1359
- </pre>
1360
- </div>
1361
- </div>
1362
-
1363
-
1364
- </div>
1365
- </div>
1366
-
1367
-
1368
- </div>
1369
-
1370
-
1371
- <div id="validator-badges">
1372
- <p><small>Copyright &copy; 2005,2006,2007,2008 Christopher Kleckner. <a href="http://www.gnu.org/licenses/gpl.html">All rights reserved</a>.</small></p>
1373
- </div>
1374
-
1375
- </body>
1376
- </html>