rio 0.3.6 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (342) hide show
  1. data/ChangeLog +171 -0
  2. data/README +3 -16
  3. data/RUNME.1st.rb +1 -3
  4. data/Rakefile +10 -7
  5. data/VERSION +1 -1
  6. data/doc/ANNOUNCE +1 -1
  7. data/doc/RELEASE_NOTES +3 -4
  8. data/ex/colx.rb +8 -0
  9. data/ex/findinruby +16 -0
  10. data/ex/findruby +15 -0
  11. data/ex/passwd_report.rb +8 -0
  12. data/ex/prompt.rb +25 -0
  13. data/ex/rgb.txt.gz +0 -0
  14. data/ex/riocat +35 -0
  15. data/ex/riogunzip +31 -0
  16. data/ex/riogzip +24 -0
  17. data/ex/rioprompt.rb +6 -0
  18. data/ex/targz2zip +17 -0
  19. data/ex/tolf +11 -0
  20. data/lib/rio.rb +0 -3
  21. data/lib/rio/construct.rb +14 -20
  22. data/lib/rio/dir.rb +2 -2
  23. data/lib/rio/doc/INTRO.rb +12 -16
  24. data/lib/rio/ext.rb +2 -1
  25. data/lib/rio/ext/csv.rb +5 -1
  26. data/lib/rio/ext/yaml.rb +11 -12
  27. data/lib/rio/filter.rb +1 -1
  28. data/lib/rio/ftp.rb +1 -1
  29. data/lib/rio/if/dir.rb +2 -2
  30. data/lib/rio/if/grande.rb +7 -1
  31. data/lib/rio/if/yaml.rb +1 -1
  32. data/lib/rio/ioh.rb +11 -1
  33. data/lib/rio/ops/construct.rb +11 -10
  34. data/lib/rio/ops/dir.rb +38 -19
  35. data/lib/rio/rl/ioi.rb +2 -2
  36. data/lib/rio/scheme/temp.rb +2 -2
  37. data/lib/rio/state.rb +1 -1
  38. data/lib/rio/stream/open.rb +9 -6
  39. data/lib/rio/util.rb +49 -0
  40. data/lib/rio/version.rb +1 -1
  41. data/test/tc/all.rb +3 -1
  42. data/test/tc/cd1.rb +0 -3
  43. data/test/tc/clearsel.rb +1 -2
  44. data/test/tc/copy-from.rb +0 -3
  45. data/test/tc/copy-to.rb +0 -3
  46. data/test/tc/copyarray.rb +1 -4
  47. data/test/tc/copydir.rb +0 -3
  48. data/test/tc/copydirlines.rb +0 -3
  49. data/test/tc/copynonex.rb +0 -3
  50. data/test/tc/csv.rb +0 -3
  51. data/test/tc/dir.rb +0 -3
  52. data/test/tc/dir_iter.rb +384 -0
  53. data/test/tc/dirautoclose.rb +4 -7
  54. data/test/tc/dirent.rb +3 -5
  55. data/test/tc/dirss.rb +2 -5
  56. data/test/tc/each.rb +3 -3
  57. data/test/tc/each_break.rb +17 -28
  58. data/test/tc/edf.rb +1 -2
  59. data/test/tc/entary.rb +1 -4
  60. data/test/tc/expand_path.rb +1 -2
  61. data/test/tc/ext.rb +0 -3
  62. data/test/tc/fileno.rb +1 -2
  63. data/test/tc/get.rb +151 -0
  64. data/test/tc/lineno.rb +1 -2
  65. data/test/tc/methods.rb +1 -1
  66. data/test/tc/misc.rb +1 -5
  67. data/test/tc/nolines.rb +3 -4
  68. data/test/tc/noqae.rb +1 -4
  69. data/test/tc/pa.rb +1 -2
  70. data/test/tc/pathop.rb +0 -3
  71. data/test/tc/paths.rb +1 -3
  72. data/test/tc/qae.rb +1 -2
  73. data/test/tc/qae_riovar.rb +1 -2
  74. data/test/tc/records.rb +1 -2
  75. data/test/tc/rename.rb +1 -3
  76. data/test/tc/rename_assign.rb +0 -3
  77. data/test/tc/riorl.rb +82 -52
  78. data/test/tc/selnosel.rb +0 -3
  79. data/test/tc/sub.rb +0 -3
  80. data/test/tc/symlink.rb +1 -2
  81. data/test/tc/symlink0.rb +1 -2
  82. data/test/tc/symlink1.rb +1 -2
  83. data/test/tc/temp.rb +0 -3
  84. data/test/tc/tempdir.rb +0 -3
  85. data/test/tc/tempfile.rb +0 -3
  86. data/test/tc/testcase.rb +9 -4
  87. data/test/tc/yaml.rb +11 -1
  88. metadata +141 -386
  89. data/doc/rdoc/classes/Kernel.html +0 -181
  90. data/doc/rdoc/classes/Kernel.src/M000214.html +0 -18
  91. data/doc/rdoc/classes/RIO.html +0 -621
  92. data/doc/rdoc/classes/RIO.src/M000001.html +0 -18
  93. data/doc/rdoc/classes/RIO.src/M000002.html +0 -18
  94. data/doc/rdoc/classes/RIO.src/M000003.html +0 -18
  95. data/doc/rdoc/classes/RIO/Doc.html +0 -138
  96. data/doc/rdoc/classes/RIO/Doc/HOWTO.html +0 -1040
  97. data/doc/rdoc/classes/RIO/Doc/INTRO.html +0 -1613
  98. data/doc/rdoc/classes/RIO/Doc/MISC.html +0 -443
  99. data/doc/rdoc/classes/RIO/Doc/SYNOPSIS.html +0 -338
  100. data/doc/rdoc/classes/RIO/IF.html +0 -114
  101. data/doc/rdoc/classes/RIO/IF/CSV.html +0 -202
  102. data/doc/rdoc/classes/RIO/IF/CSV.src/M000004.html +0 -19
  103. data/doc/rdoc/classes/RIO/IF/CSV.src/M000005.html +0 -16
  104. data/doc/rdoc/classes/RIO/IF/CSV.src/M000006.html +0 -16
  105. data/doc/rdoc/classes/RIO/IF/YAML.html +0 -499
  106. data/doc/rdoc/classes/RIO/IF/YAML.src/M000007.html +0 -19
  107. data/doc/rdoc/classes/RIO/IF/YAML.src/M000008.html +0 -16
  108. data/doc/rdoc/classes/RIO/IF/YAML.src/M000009.html +0 -16
  109. data/doc/rdoc/classes/RIO/IF/YAML.src/M000010.html +0 -16
  110. data/doc/rdoc/classes/RIO/IF/YAML.src/M000011.html +0 -16
  111. data/doc/rdoc/classes/RIO/IF/YAML.src/M000012.html +0 -16
  112. data/doc/rdoc/classes/RIO/IF/YAML.src/M000013.html +0 -16
  113. data/doc/rdoc/classes/RIO/IF/YAML.src/M000014.html +0 -16
  114. data/doc/rdoc/classes/RIO/IF/YAML.src/M000015.html +0 -16
  115. data/doc/rdoc/classes/RIO/IF/YAML.src/M000016.html +0 -16
  116. data/doc/rdoc/classes/RIO/IF/YAML.src/M000017.html +0 -16
  117. data/doc/rdoc/classes/RIO/Rio.html +0 -7121
  118. data/doc/rdoc/classes/RIO/Rio.src/M000018.html +0 -18
  119. data/doc/rdoc/classes/RIO/Rio.src/M000019.html +0 -20
  120. data/doc/rdoc/classes/RIO/Rio.src/M000020.html +0 -27
  121. data/doc/rdoc/classes/RIO/Rio.src/M000021.html +0 -16
  122. data/doc/rdoc/classes/RIO/Rio.src/M000023.html +0 -19
  123. data/doc/rdoc/classes/RIO/Rio.src/M000024.html +0 -20
  124. data/doc/rdoc/classes/RIO/Rio.src/M000025.html +0 -16
  125. data/doc/rdoc/classes/RIO/Rio.src/M000026.html +0 -16
  126. data/doc/rdoc/classes/RIO/Rio.src/M000027.html +0 -16
  127. data/doc/rdoc/classes/RIO/Rio.src/M000028.html +0 -16
  128. data/doc/rdoc/classes/RIO/Rio.src/M000029.html +0 -16
  129. data/doc/rdoc/classes/RIO/Rio.src/M000030.html +0 -16
  130. data/doc/rdoc/classes/RIO/Rio.src/M000031.html +0 -16
  131. data/doc/rdoc/classes/RIO/Rio.src/M000032.html +0 -16
  132. data/doc/rdoc/classes/RIO/Rio.src/M000033.html +0 -16
  133. data/doc/rdoc/classes/RIO/Rio.src/M000034.html +0 -16
  134. data/doc/rdoc/classes/RIO/Rio.src/M000035.html +0 -16
  135. data/doc/rdoc/classes/RIO/Rio.src/M000036.html +0 -16
  136. data/doc/rdoc/classes/RIO/Rio.src/M000037.html +0 -16
  137. data/doc/rdoc/classes/RIO/Rio.src/M000038.html +0 -16
  138. data/doc/rdoc/classes/RIO/Rio.src/M000039.html +0 -16
  139. data/doc/rdoc/classes/RIO/Rio.src/M000040.html +0 -16
  140. data/doc/rdoc/classes/RIO/Rio.src/M000041.html +0 -16
  141. data/doc/rdoc/classes/RIO/Rio.src/M000042.html +0 -16
  142. data/doc/rdoc/classes/RIO/Rio.src/M000043.html +0 -16
  143. data/doc/rdoc/classes/RIO/Rio.src/M000044.html +0 -16
  144. data/doc/rdoc/classes/RIO/Rio.src/M000045.html +0 -16
  145. data/doc/rdoc/classes/RIO/Rio.src/M000046.html +0 -16
  146. data/doc/rdoc/classes/RIO/Rio.src/M000047.html +0 -16
  147. data/doc/rdoc/classes/RIO/Rio.src/M000048.html +0 -16
  148. data/doc/rdoc/classes/RIO/Rio.src/M000049.html +0 -16
  149. data/doc/rdoc/classes/RIO/Rio.src/M000050.html +0 -16
  150. data/doc/rdoc/classes/RIO/Rio.src/M000051.html +0 -16
  151. data/doc/rdoc/classes/RIO/Rio.src/M000052.html +0 -16
  152. data/doc/rdoc/classes/RIO/Rio.src/M000053.html +0 -16
  153. data/doc/rdoc/classes/RIO/Rio.src/M000054.html +0 -16
  154. data/doc/rdoc/classes/RIO/Rio.src/M000055.html +0 -16
  155. data/doc/rdoc/classes/RIO/Rio.src/M000056.html +0 -16
  156. data/doc/rdoc/classes/RIO/Rio.src/M000057.html +0 -16
  157. data/doc/rdoc/classes/RIO/Rio.src/M000058.html +0 -16
  158. data/doc/rdoc/classes/RIO/Rio.src/M000059.html +0 -16
  159. data/doc/rdoc/classes/RIO/Rio.src/M000060.html +0 -16
  160. data/doc/rdoc/classes/RIO/Rio.src/M000061.html +0 -16
  161. data/doc/rdoc/classes/RIO/Rio.src/M000062.html +0 -16
  162. data/doc/rdoc/classes/RIO/Rio.src/M000063.html +0 -16
  163. data/doc/rdoc/classes/RIO/Rio.src/M000064.html +0 -16
  164. data/doc/rdoc/classes/RIO/Rio.src/M000065.html +0 -16
  165. data/doc/rdoc/classes/RIO/Rio.src/M000066.html +0 -16
  166. data/doc/rdoc/classes/RIO/Rio.src/M000067.html +0 -16
  167. data/doc/rdoc/classes/RIO/Rio.src/M000068.html +0 -16
  168. data/doc/rdoc/classes/RIO/Rio.src/M000069.html +0 -16
  169. data/doc/rdoc/classes/RIO/Rio.src/M000070.html +0 -16
  170. data/doc/rdoc/classes/RIO/Rio.src/M000071.html +0 -16
  171. data/doc/rdoc/classes/RIO/Rio.src/M000072.html +0 -16
  172. data/doc/rdoc/classes/RIO/Rio.src/M000073.html +0 -16
  173. data/doc/rdoc/classes/RIO/Rio.src/M000074.html +0 -16
  174. data/doc/rdoc/classes/RIO/Rio.src/M000075.html +0 -16
  175. data/doc/rdoc/classes/RIO/Rio.src/M000076.html +0 -16
  176. data/doc/rdoc/classes/RIO/Rio.src/M000077.html +0 -16
  177. data/doc/rdoc/classes/RIO/Rio.src/M000078.html +0 -16
  178. data/doc/rdoc/classes/RIO/Rio.src/M000079.html +0 -16
  179. data/doc/rdoc/classes/RIO/Rio.src/M000080.html +0 -16
  180. data/doc/rdoc/classes/RIO/Rio.src/M000081.html +0 -16
  181. data/doc/rdoc/classes/RIO/Rio.src/M000082.html +0 -16
  182. data/doc/rdoc/classes/RIO/Rio.src/M000083.html +0 -16
  183. data/doc/rdoc/classes/RIO/Rio.src/M000084.html +0 -16
  184. data/doc/rdoc/classes/RIO/Rio.src/M000085.html +0 -16
  185. data/doc/rdoc/classes/RIO/Rio.src/M000086.html +0 -16
  186. data/doc/rdoc/classes/RIO/Rio.src/M000087.html +0 -16
  187. data/doc/rdoc/classes/RIO/Rio.src/M000088.html +0 -16
  188. data/doc/rdoc/classes/RIO/Rio.src/M000089.html +0 -16
  189. data/doc/rdoc/classes/RIO/Rio.src/M000090.html +0 -16
  190. data/doc/rdoc/classes/RIO/Rio.src/M000091.html +0 -16
  191. data/doc/rdoc/classes/RIO/Rio.src/M000092.html +0 -16
  192. data/doc/rdoc/classes/RIO/Rio.src/M000093.html +0 -16
  193. data/doc/rdoc/classes/RIO/Rio.src/M000094.html +0 -16
  194. data/doc/rdoc/classes/RIO/Rio.src/M000095.html +0 -16
  195. data/doc/rdoc/classes/RIO/Rio.src/M000096.html +0 -16
  196. data/doc/rdoc/classes/RIO/Rio.src/M000097.html +0 -16
  197. data/doc/rdoc/classes/RIO/Rio.src/M000098.html +0 -16
  198. data/doc/rdoc/classes/RIO/Rio.src/M000099.html +0 -16
  199. data/doc/rdoc/classes/RIO/Rio.src/M000100.html +0 -16
  200. data/doc/rdoc/classes/RIO/Rio.src/M000101.html +0 -16
  201. data/doc/rdoc/classes/RIO/Rio.src/M000102.html +0 -16
  202. data/doc/rdoc/classes/RIO/Rio.src/M000103.html +0 -16
  203. data/doc/rdoc/classes/RIO/Rio.src/M000104.html +0 -16
  204. data/doc/rdoc/classes/RIO/Rio.src/M000105.html +0 -16
  205. data/doc/rdoc/classes/RIO/Rio.src/M000106.html +0 -16
  206. data/doc/rdoc/classes/RIO/Rio.src/M000107.html +0 -16
  207. data/doc/rdoc/classes/RIO/Rio.src/M000108.html +0 -16
  208. data/doc/rdoc/classes/RIO/Rio.src/M000109.html +0 -16
  209. data/doc/rdoc/classes/RIO/Rio.src/M000110.html +0 -16
  210. data/doc/rdoc/classes/RIO/Rio.src/M000111.html +0 -16
  211. data/doc/rdoc/classes/RIO/Rio.src/M000112.html +0 -16
  212. data/doc/rdoc/classes/RIO/Rio.src/M000113.html +0 -16
  213. data/doc/rdoc/classes/RIO/Rio.src/M000114.html +0 -16
  214. data/doc/rdoc/classes/RIO/Rio.src/M000115.html +0 -16
  215. data/doc/rdoc/classes/RIO/Rio.src/M000116.html +0 -16
  216. data/doc/rdoc/classes/RIO/Rio.src/M000117.html +0 -16
  217. data/doc/rdoc/classes/RIO/Rio.src/M000118.html +0 -16
  218. data/doc/rdoc/classes/RIO/Rio.src/M000119.html +0 -16
  219. data/doc/rdoc/classes/RIO/Rio.src/M000120.html +0 -16
  220. data/doc/rdoc/classes/RIO/Rio.src/M000121.html +0 -16
  221. data/doc/rdoc/classes/RIO/Rio.src/M000122.html +0 -16
  222. data/doc/rdoc/classes/RIO/Rio.src/M000123.html +0 -16
  223. data/doc/rdoc/classes/RIO/Rio.src/M000124.html +0 -16
  224. data/doc/rdoc/classes/RIO/Rio.src/M000125.html +0 -16
  225. data/doc/rdoc/classes/RIO/Rio.src/M000126.html +0 -16
  226. data/doc/rdoc/classes/RIO/Rio.src/M000127.html +0 -16
  227. data/doc/rdoc/classes/RIO/Rio.src/M000128.html +0 -16
  228. data/doc/rdoc/classes/RIO/Rio.src/M000129.html +0 -16
  229. data/doc/rdoc/classes/RIO/Rio.src/M000130.html +0 -16
  230. data/doc/rdoc/classes/RIO/Rio.src/M000131.html +0 -16
  231. data/doc/rdoc/classes/RIO/Rio.src/M000132.html +0 -16
  232. data/doc/rdoc/classes/RIO/Rio.src/M000133.html +0 -16
  233. data/doc/rdoc/classes/RIO/Rio.src/M000134.html +0 -16
  234. data/doc/rdoc/classes/RIO/Rio.src/M000135.html +0 -16
  235. data/doc/rdoc/classes/RIO/Rio.src/M000136.html +0 -16
  236. data/doc/rdoc/classes/RIO/Rio.src/M000137.html +0 -16
  237. data/doc/rdoc/classes/RIO/Rio.src/M000138.html +0 -16
  238. data/doc/rdoc/classes/RIO/Rio.src/M000139.html +0 -16
  239. data/doc/rdoc/classes/RIO/Rio.src/M000140.html +0 -16
  240. data/doc/rdoc/classes/RIO/Rio.src/M000141.html +0 -16
  241. data/doc/rdoc/classes/RIO/Rio.src/M000142.html +0 -16
  242. data/doc/rdoc/classes/RIO/Rio.src/M000143.html +0 -16
  243. data/doc/rdoc/classes/RIO/Rio.src/M000144.html +0 -16
  244. data/doc/rdoc/classes/RIO/Rio.src/M000145.html +0 -16
  245. data/doc/rdoc/classes/RIO/Rio.src/M000146.html +0 -16
  246. data/doc/rdoc/classes/RIO/Rio.src/M000147.html +0 -16
  247. data/doc/rdoc/classes/RIO/Rio.src/M000148.html +0 -16
  248. data/doc/rdoc/classes/RIO/Rio.src/M000149.html +0 -16
  249. data/doc/rdoc/classes/RIO/Rio.src/M000150.html +0 -16
  250. data/doc/rdoc/classes/RIO/Rio.src/M000151.html +0 -16
  251. data/doc/rdoc/classes/RIO/Rio.src/M000152.html +0 -16
  252. data/doc/rdoc/classes/RIO/Rio.src/M000153.html +0 -16
  253. data/doc/rdoc/classes/RIO/Rio.src/M000154.html +0 -16
  254. data/doc/rdoc/classes/RIO/Rio.src/M000155.html +0 -16
  255. data/doc/rdoc/classes/RIO/Rio.src/M000156.html +0 -16
  256. data/doc/rdoc/classes/RIO/Rio.src/M000157.html +0 -16
  257. data/doc/rdoc/classes/RIO/Rio.src/M000158.html +0 -16
  258. data/doc/rdoc/classes/RIO/Rio.src/M000159.html +0 -16
  259. data/doc/rdoc/classes/RIO/Rio.src/M000160.html +0 -16
  260. data/doc/rdoc/classes/RIO/Rio.src/M000161.html +0 -16
  261. data/doc/rdoc/classes/RIO/Rio.src/M000162.html +0 -16
  262. data/doc/rdoc/classes/RIO/Rio.src/M000163.html +0 -16
  263. data/doc/rdoc/classes/RIO/Rio.src/M000164.html +0 -16
  264. data/doc/rdoc/classes/RIO/Rio.src/M000165.html +0 -16
  265. data/doc/rdoc/classes/RIO/Rio.src/M000166.html +0 -16
  266. data/doc/rdoc/classes/RIO/Rio.src/M000167.html +0 -16
  267. data/doc/rdoc/classes/RIO/Rio.src/M000168.html +0 -16
  268. data/doc/rdoc/classes/RIO/Rio.src/M000169.html +0 -16
  269. data/doc/rdoc/classes/RIO/Rio.src/M000170.html +0 -16
  270. data/doc/rdoc/classes/RIO/Rio.src/M000171.html +0 -16
  271. data/doc/rdoc/classes/RIO/Rio.src/M000172.html +0 -16
  272. data/doc/rdoc/classes/RIO/Rio.src/M000173.html +0 -16
  273. data/doc/rdoc/classes/RIO/Rio.src/M000174.html +0 -16
  274. data/doc/rdoc/classes/RIO/Rio.src/M000175.html +0 -16
  275. data/doc/rdoc/classes/RIO/Rio.src/M000176.html +0 -16
  276. data/doc/rdoc/classes/RIO/Rio.src/M000177.html +0 -16
  277. data/doc/rdoc/classes/RIO/Rio.src/M000178.html +0 -16
  278. data/doc/rdoc/classes/RIO/Rio.src/M000179.html +0 -16
  279. data/doc/rdoc/classes/RIO/Rio.src/M000180.html +0 -16
  280. data/doc/rdoc/classes/RIO/Rio.src/M000181.html +0 -16
  281. data/doc/rdoc/classes/RIO/Rio.src/M000182.html +0 -16
  282. data/doc/rdoc/classes/RIO/Rio.src/M000183.html +0 -16
  283. data/doc/rdoc/classes/RIO/Rio.src/M000184.html +0 -16
  284. data/doc/rdoc/classes/RIO/Rio.src/M000185.html +0 -16
  285. data/doc/rdoc/classes/RIO/Rio.src/M000186.html +0 -16
  286. data/doc/rdoc/classes/RIO/Rio.src/M000187.html +0 -16
  287. data/doc/rdoc/classes/RIO/Rio.src/M000188.html +0 -16
  288. data/doc/rdoc/classes/RIO/Rio.src/M000189.html +0 -16
  289. data/doc/rdoc/classes/RIO/Rio.src/M000190.html +0 -16
  290. data/doc/rdoc/classes/RIO/Rio.src/M000191.html +0 -16
  291. data/doc/rdoc/classes/RIO/Rio.src/M000192.html +0 -16
  292. data/doc/rdoc/classes/RIO/Rio.src/M000193.html +0 -16
  293. data/doc/rdoc/classes/RIO/Rio.src/M000194.html +0 -16
  294. data/doc/rdoc/classes/RIO/Rio.src/M000195.html +0 -16
  295. data/doc/rdoc/classes/RIO/Rio.src/M000196.html +0 -16
  296. data/doc/rdoc/classes/RIO/Rio.src/M000197.html +0 -16
  297. data/doc/rdoc/classes/RIO/Rio.src/M000198.html +0 -16
  298. data/doc/rdoc/classes/RIO/Rio.src/M000199.html +0 -16
  299. data/doc/rdoc/classes/RIO/Rio.src/M000200.html +0 -16
  300. data/doc/rdoc/classes/RIO/Rio.src/M000201.html +0 -16
  301. data/doc/rdoc/classes/RIO/Rio.src/M000202.html +0 -16
  302. data/doc/rdoc/classes/RIO/Rio.src/M000203.html +0 -16
  303. data/doc/rdoc/classes/RIO/Rio.src/M000204.html +0 -16
  304. data/doc/rdoc/classes/RIO/Rio.src/M000205.html +0 -16
  305. data/doc/rdoc/classes/RIO/Rio.src/M000206.html +0 -16
  306. data/doc/rdoc/classes/RIO/Rio.src/M000207.html +0 -16
  307. data/doc/rdoc/classes/RIO/Rio.src/M000208.html +0 -16
  308. data/doc/rdoc/classes/RIO/Rio.src/M000209.html +0 -16
  309. data/doc/rdoc/classes/RIO/Rio.src/M000210.html +0 -16
  310. data/doc/rdoc/classes/RIO/Rio.src/M000211.html +0 -16
  311. data/doc/rdoc/classes/RIO/Rio.src/M000212.html +0 -16
  312. data/doc/rdoc/classes/RIO/Rio.src/M000213.html +0 -16
  313. data/doc/rdoc/created.rid +0 -1
  314. data/doc/rdoc/files/README.html +0 -243
  315. data/doc/rdoc/files/lib/rio/constructor_rb.html +0 -142
  316. data/doc/rdoc/files/lib/rio/doc/HOWTO_rb.html +0 -135
  317. data/doc/rdoc/files/lib/rio/doc/INTRO_rb.html +0 -135
  318. data/doc/rdoc/files/lib/rio/doc/MISC_rb.html +0 -135
  319. data/doc/rdoc/files/lib/rio/doc/SYNOPSIS_rb.html +0 -135
  320. data/doc/rdoc/files/lib/rio/if/basic_rb.html +0 -135
  321. data/doc/rdoc/files/lib/rio/if/csv_rb.html +0 -135
  322. data/doc/rdoc/files/lib/rio/if/dir_rb.html +0 -135
  323. data/doc/rdoc/files/lib/rio/if/file_rb.html +0 -135
  324. data/doc/rdoc/files/lib/rio/if/fileordir_rb.html +0 -135
  325. data/doc/rdoc/files/lib/rio/if/grande_entry_rb.html +0 -135
  326. data/doc/rdoc/files/lib/rio/if/grande_rb.html +0 -135
  327. data/doc/rdoc/files/lib/rio/if/grande_stream_rb.html +0 -135
  328. data/doc/rdoc/files/lib/rio/if/internal_rb.html +0 -135
  329. data/doc/rdoc/files/lib/rio/if/path_rb.html +0 -135
  330. data/doc/rdoc/files/lib/rio/if/stream_rb.html +0 -135
  331. data/doc/rdoc/files/lib/rio/if/string_rb.html +0 -135
  332. data/doc/rdoc/files/lib/rio/if/temp_rb.html +0 -135
  333. data/doc/rdoc/files/lib/rio/if/test_rb.html +0 -135
  334. data/doc/rdoc/files/lib/rio/if/yaml_rb.html +0 -135
  335. data/doc/rdoc/files/lib/rio/kernel_rb.html +0 -142
  336. data/doc/rdoc/files/lib/rio_rb.html +0 -154
  337. data/doc/rdoc/fr_class_index.html +0 -37
  338. data/doc/rdoc/fr_file_index.html +0 -49
  339. data/doc/rdoc/fr_method_index.html +0 -241
  340. data/doc/rdoc/index.html +0 -24
  341. data/doc/rdoc/rdoc-style.css +0 -384
  342. data/test/methods/path.rb +0 -12
@@ -1,18 +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>rio (RIO)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/rio/constructor.rb, line 214</span>
14
- 214: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">rio</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-comment cmt"># :yields: self</span>
15
- 215: <span class="ruby-constant">Rio</span>.<span class="ruby-identifier">rio</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
16
- 216: <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,18 +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>cwd (RIO)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/rio/constructor.rb, line 221</span>
14
- 221: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">cwd</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-comment cmt"># :yields: self</span>
15
- 222: <span class="ruby-constant">Rio</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">getwd</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
16
- 223: <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,18 +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>root (RIO)</title>
9
- <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
10
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
11
- </head>
12
- <body class="standalone-code">
13
- <pre> <span class="ruby-comment cmt"># File lib/rio/constructor.rb, line 228</span>
14
- 228: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">root</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-comment cmt"># :yields: self</span>
15
- 229: <span class="ruby-constant">Rio</span>.<span class="ruby-identifier">new</span>.<span class="ruby-identifier">rootpath</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">args</span>,<span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span>)
16
- 230: <span class="ruby-keyword kw">end</span></pre>
17
- </body>
18
- </html>
@@ -1,138 +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::Doc</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
- <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td class="class-mod"><strong>Module</strong></td>
53
- <td class="class-name-in-header">RIO::Doc</td>
54
- <td rowspan="2" class="class-header-space-col"></td>
55
- <td rowspan="2">
56
- <a class="in-url" href="../../files/lib/rio/doc/HOWTO_rb.html">
57
- lib/rio/doc/HOWTO.rb
58
- </a>
59
- &nbsp;&nbsp;
60
- <a class="in-url" href="../../files/lib/rio/doc/INTRO_rb.html">
61
- lib/rio/doc/INTRO.rb
62
- </a>
63
- &nbsp;&nbsp;
64
- <a class="in-url" href="../../files/lib/rio/doc/MISC_rb.html">
65
- lib/rio/doc/MISC.rb
66
- </a>
67
- &nbsp;&nbsp;
68
- <a class="in-url" href="../../files/lib/rio/doc/SYNOPSIS_rb.html">
69
- lib/rio/doc/SYNOPSIS.rb
70
- </a>
71
- &nbsp;&nbsp;
72
- </td>
73
- </tr>
74
-
75
- </table>
76
- </div>
77
- <!-- banner header -->
78
-
79
- <div id="bodyContent">
80
-
81
-
82
-
83
- <div id="contextContent">
84
-
85
- <div id="description">
86
- <p>
87
- Copyright &#169; 2005, Christopher Kleckner. All rights reserved
88
- </p>
89
- <p>
90
- This file is part of the <a href="Rio.html">Rio</a> library for ruby. <a
91
- href="Rio.html">Rio</a> is free software; you can redistribute it and/or
92
- modify it under the terms of the <a
93
- href="http://www.gnu.org/licenses/gpl.html">GNU General Public License</a>
94
- as published by the Free Software Foundation; either version 2 of the
95
- License, or (at your option) any later version.
96
- </p>
97
-
98
- </div>
99
-
100
-
101
- </div>
102
-
103
-
104
- </div>
105
-
106
-
107
- <!-- if includes -->
108
-
109
- <div id="section">
110
-
111
- <div id="class-list">
112
- <h3 class="section-bar">Classes and Modules</h3>
113
-
114
- Module <a href="Doc/HOWTO.html" class="link">RIO::Doc::HOWTO</a><br />
115
- Module <a href="Doc/INTRO.html" class="link">RIO::Doc::INTRO</a><br />
116
- Module <a href="Doc/MISC.html" class="link">RIO::Doc::MISC</a><br />
117
- Module <a href="Doc/SYNOPSIS.html" class="link">RIO::Doc::SYNOPSIS</a><br />
118
-
119
- </div>
120
-
121
-
122
-
123
-
124
-
125
-
126
-
127
- <!-- if method_list -->
128
-
129
-
130
- </div>
131
-
132
-
133
- <div id="validator-badges">
134
- <p><small>Copyright &copy; 2005 Christopher Kleckner. <a href="http://www.gnu.org/licenses/gpl.html">All rights reserved</a>.</small></p>
135
- </div>
136
-
137
- </body>
138
- </html>
@@ -1,1040 +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::Doc::HOWTO</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
- <link rel="stylesheet" href="../../.././rdoc-style.css" type="text/css" media="screen" />
12
- <script type="text/javascript">
13
- // <![CDATA[
14
-
15
- function popupCode( url ) {
16
- window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
17
- }
18
-
19
- function toggleCode( id ) {
20
- if ( document.getElementById )
21
- elem = document.getElementById( id );
22
- else if ( document.all )
23
- elem = eval( "document.all." + id );
24
- else
25
- return false;
26
-
27
- elemStyle = elem.style;
28
-
29
- if ( elemStyle.display != "block" ) {
30
- elemStyle.display = "block"
31
- } else {
32
- elemStyle.display = "none"
33
- }
34
-
35
- return true;
36
- }
37
-
38
- // Make codeblocks hidden by default
39
- document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
40
-
41
- // ]]>
42
- </script>
43
-
44
- </head>
45
- <body>
46
-
47
-
48
-
49
- <div id="classHeader">
50
- <table class="header-table">
51
- <tr class="top-aligned-row">
52
- <td class="class-mod"><strong>Module</strong></td>
53
- <td class="class-name-in-header">RIO::Doc::HOWTO</td>
54
- <td rowspan="2" class="class-header-space-col"></td>
55
- <td rowspan="2">
56
- <a class="in-url" href="../../../files/lib/rio/doc/HOWTO_rb.html">
57
- lib/rio/doc/HOWTO.rb
58
- </a>
59
- &nbsp;&nbsp;
60
- </td>
61
- </tr>
62
-
63
- </table>
64
- </div>
65
- <!-- banner header -->
66
-
67
- <div id="bodyContent">
68
-
69
-
70
-
71
- <div id="contextContent">
72
-
73
- <div id="description">
74
- <h1><a href="../Rio.html">Rio</a> - Ruby I/O Comfort Class</h1>
75
- <p>
76
- <a href="../Rio.html">Rio</a> is a convenience class wrapping much of the
77
- functionality of IO, File, Dir, Pathname, FileUtils, Tempfile, StringIO,
78
- OpenURI, Zlib, and CSV.
79
- </p>
80
- <h2><a href="HOWTO.html">HOWTO</a>&#8230;</h2>
81
- <h3>Read a single file</h3>
82
- <pre>
83
- ario = rio('afile')
84
- string = &quot;&quot;
85
- array = []
86
- </pre>
87
- <ul>
88
- <li>Read a file into a string.
89
-
90
- <pre>
91
- # method 1
92
- string = ario.contents
93
- # method 2
94
- ario &gt; string
95
- </pre>
96
- </li>
97
- <li>Append a file onto a string.
98
-
99
- <pre>
100
- # method 1
101
- ario &gt;&gt; string
102
- # method 2
103
- string += ario.contents
104
- </pre>
105
- </li>
106
- <li>Read lines of a file into an array
107
-
108
- <pre>
109
- # method 1
110
- array = ario[]
111
- # method 2
112
- ario &gt; array
113
- # method 3
114
- array = ario.to_a
115
- # method 4
116
- array = ario.readlines
117
- </pre>
118
- </li>
119
- <li>Append lines of a file into an array
120
-
121
- <pre>
122
- # method 1
123
- ario &gt;&gt; array
124
- # method 2
125
- array += ario.lines[]
126
- </pre>
127
- </li>
128
- <li>Read the first 10 lines of a file into an array
129
-
130
- <pre>
131
- # method 1
132
- array = ario[0...10]
133
- # method 2
134
- array = ario.lines[0...10]
135
- # method 3
136
- ario.lines(0...10) &gt; array
137
- </pre>
138
- </li>
139
- <li>Read lines of a file into an array, with each line chomped
140
-
141
- <pre>
142
- # method 1
143
- array = ario.chomp[]
144
- # method 2
145
- array = ario.chomp.lines[]
146
- # method 3
147
- ario.chomp &gt; array
148
- </pre>
149
- </li>
150
- <li>Append the first 10 lines of a file into an array, with each line chomped
151
-
152
- <pre>
153
- # method 1
154
- array += ario.chomp.lines[0...10]
155
- # method 2
156
- ario.chomp.lines(0...10) &gt;&gt; array
157
- </pre>
158
- </li>
159
- <li>Read all lines starting with &#8216;require&#8217; into an array, with each
160
- line chomped
161
-
162
- <pre>
163
- # method 1
164
- array = ario.chomp.lines[/^\s*require/]
165
- # method 2
166
- ario.chomp.lines(/^\s*require/) &gt; array
167
- </pre>
168
- </li>
169
- <li>Read a gzipped file into a string
170
-
171
- <pre>
172
- # method 1
173
- rio('afile.gz').gzip &gt; string
174
- # method 2
175
- string = rio('afile.gz').gzip.contents
176
- </pre>
177
- </li>
178
- <li>Append a gzipped file into a string
179
-
180
- <pre>
181
- # method 1
182
- rio('afile.gz').gzip &gt;&gt; string
183
- # method 2
184
- string += rio('afile.gz').gzip.contents
185
- </pre>
186
- </li>
187
- <li>Iterate through all the lines of a file
188
-
189
- <pre>
190
- # method 1
191
- rio('afile').lines { |line| ... }
192
- # method 2
193
- rio('afile').each { |line| ... }
194
- # method 3
195
- rio('afile').each_line { |line| ... }
196
- </pre>
197
- </li>
198
- <li>Iterate through the lines of a gzipped file
199
-
200
- <pre>
201
- rio('afile.gz').gzip { |line| ... }
202
- </pre>
203
- </li>
204
- <li>Iterate through all non-empty lines of a gzipped file, with each line
205
- chomped
206
-
207
- <pre>
208
- rio('afile.gz').gzip.chomp.skiplines(:empty?) { |line| ... }
209
- </pre>
210
- </li>
211
- <li>Iterate through the first 100 lines of a file
212
-
213
- <pre>
214
- # method 1
215
- rio('afile').lines(0...100) { |line| ... }
216
- </pre>
217
- </li>
218
- <li>Iterate through the first line and all ruby comment lines in a gzipped file
219
-
220
- <pre>
221
- rio('afile.rb.gz').gzip.lines(0,/^\s*#/) { |line| ... }
222
- </pre>
223
- </li>
224
- <li>Iterate through the lines of a ruby file that are neither empty nor
225
- comments, with all lines chomped
226
-
227
- <pre>
228
- rio('afile.rb.gz').chomp.skiplines(/^\s*#/,:empty?) { |line| ... }
229
- </pre>
230
- </li>
231
- <li>Read all the comment lines from a ruby file into an array with all lines
232
- chomped
233
-
234
- <pre>
235
- # method 1
236
- array = rio('afile.rb').chomp.lines[/^\s*#/]
237
- # method 2
238
- rio('afile.rb').chomp.lines(/^\s*#/) &gt; array
239
- </pre>
240
- </li>
241
- <li>Read lines of a file into an array, with each line chomped, skipping any
242
- lines longer than 1024 chars
243
-
244
- <pre>
245
- # method 1
246
- ario.chomp.lines(proc{ |line| line.length &lt;= 1024}) &gt; array
247
- # method 2
248
- array = ario.chomp.skiplines[proc{ |line| line.length &gt; 1024}]
249
- # method 3
250
- array = ario.chomp.lines(proc{ |line| line.length &lt;= 1024}).to_a
251
- </pre>
252
- </li>
253
- </ul>
254
- <hr size="1"></hr><h3>Write to a single file</h3>
255
- <pre>
256
- ario = rio('afile')
257
- string = &quot;A String\n&quot;
258
- array = [&quot;Line 0\n&quot;,&quot;Line 1\n&quot;]
259
- </pre>
260
- <ul>
261
- <li>Write a string to a file, leaving the <a href="../Rio.html">Rio</a> open
262
-
263
- <pre>
264
- # method 1
265
- ario.puts(string)
266
- # method 2
267
- ario.print(string)
268
- # method 3
269
- ario.noautoclose &lt; string
270
- </pre>
271
- </li>
272
- <li>Write a string to a file and close the file
273
-
274
- <pre>
275
- # method 1
276
- rio('afile') &lt; string
277
- # method 2
278
- ario.print!(string)
279
- # method 3
280
- ario.print(string).close
281
- </pre>
282
- </li>
283
- <li>Append a string to a file, leaving the <a href="../Rio.html">Rio</a> open
284
-
285
- <pre>
286
- # method 1
287
- ario.a.puts(string)
288
- # method 2
289
- ario.a.print(string)
290
- # method 3
291
- ario.noautoclose &lt;&lt; string
292
- </pre>
293
- </li>
294
- <li>Append a string to a file and close the file
295
-
296
- <pre>
297
- # method 1
298
- rio('afile') &lt;&lt; string
299
- # method 2
300
- rio('afile').a.print!(string)
301
- # method 3
302
- rio('afile').a.print(string).close
303
- </pre>
304
- </li>
305
- <li>Write an array to a file, leaving the <a href="../Rio.html">Rio</a> open
306
-
307
- <pre>
308
- # method 1
309
- ario = rio('afile').nocloseoncopy
310
- ario &lt;&lt; array
311
- # method 2
312
- ario.noautoclose &lt; array
313
- </pre>
314
- </li>
315
- <li>Write an array to a file and close the file
316
-
317
- <pre>
318
- # method 1
319
- rio('afile') &lt; array
320
- </pre>
321
- </li>
322
- </ul>
323
- <hr size="1"></hr><h3>Select records</h3>
324
- <pre>
325
- ario = rio('afile')
326
- string = &quot;&quot;
327
- array = []
328
- </pre>
329
- <ul>
330
- <li>Put lines one thru ten and line 100 into an array
331
-
332
- <pre>
333
- # method 1
334
- array = ario[0..9,99]
335
- # method 2
336
- array = ario[0...10,99..99]
337
- # method 3
338
- ario(0..9,99) &gt; array
339
- </pre>
340
- </li>
341
- <li>Put lines one thru ten,line 100 and lines starting with &#8216;zippy&#8217;
342
- into an array
343
-
344
- <pre>
345
- # method 1
346
- array = ario[0..9,99,/^zippy/]
347
- # method 2
348
- array = ario[0...10,99..99,/^zippy/]
349
- # method 3
350
- ario(0..9,99,/^zippy/) &gt; array
351
- </pre>
352
- </li>
353
- <li>Put lines that are longer than 128 bytes into an array
354
-
355
- <pre>
356
- # method 1
357
- array = ario[proc{ |l| l.length &gt; 128}]
358
- # method 2
359
- array = ario.lines[proc{ |l| l.length &gt; 128}]
360
- # method 3
361
- array = ario.skiplines[proc{ |l| l.length &lt;= 128}]
362
- </pre>
363
- </li>
364
- <li>Copy all lines that do not start with &#8216;zippy&#8217; into another file
365
-
366
- <pre>
367
- # method 1
368
- ario.skiplines(/^zippy/) &gt; rio('another_file')
369
- # method 2
370
- ario.lines.skiplines(/^zippy/) &gt; rio('another_file')
371
- # method 3
372
- rio('another_file') &lt; ario.skiplines(/^zippy/)
373
- </pre>
374
- </li>
375
- <li>Copy the first 10 lines and lines starting with &#8216;zippy&#8217;, but
376
- exclude any lines longer than 128 bytes
377
-
378
- <pre>
379
- # method 1
380
- ario.lines(0...10,/^zippy/).skiplines(proc{ |l| l.length &gt; 128}] &gt; rio('another_file')
381
- # method 2
382
- rio('another_file') &lt; ario.lines(0...10,/^zippy/).skiplines(proc{ |l| l.length &gt; 128})
383
- </pre>
384
- </li>
385
- </ul>
386
- <hr size="1"></hr><h3>Select directory entries</h3>
387
- <pre>
388
- ario = rio('adir')
389
- string = &quot;&quot;
390
- array = []
391
- </pre>
392
- <ul>
393
- <li>Put all entries with the extension &#8217;.txt&#8217; into an array
394
-
395
- <pre>
396
- # method 1
397
- array = ario['*.txt']
398
- # method 2
399
- array = ario[/\.txt/]
400
- # method 3
401
- array = ario.entries['*.txt']
402
- </pre>
403
- </li>
404
- <li>Put all files with the extension &#8217;.txt&#8217; into an array
405
-
406
- <pre>
407
- # method 1
408
- array = ario.files['*.txt']
409
- # method 2
410
- array = ario.files[/\.txt/]
411
- # method 3
412
- array = ario.files['*.txt']
413
- </pre>
414
- </li>
415
- <li>Put all entries with the extension &#8217;.txt&#8217; into an array,
416
- including those in subdirectories
417
-
418
- <pre>
419
- # method 1
420
- array = ario.all['*.txt']
421
- # method 2
422
- array = ario.all[/\.txt/]
423
- # method 3
424
- array = ario.all.entries['*.txt']
425
- </pre>
426
- </li>
427
- <li>Put all entries with the extension &#8217;.txt&#8217; into an array,
428
- including those in subdirectories, except those in subdirectories name
429
- &#8217;.svn&#8217;
430
-
431
- <pre>
432
- # method 1
433
- array = ario.norecurse('.svn').all['*.txt']
434
- # method 2
435
- array = ario.norecurse(/^\.svn$/).all[/\.txt/]
436
- # method 3
437
- array = ario.norecurse('.svn').entries['*.txt']
438
- # method 4
439
- array = ario.entries('*.txt').norecurse('.svn').to_a
440
- # method 5
441
- array = ario.norecurse('.svn')['*.txt']
442
- </pre>
443
- </li>
444
- <li>Iterate through ruby files in a directory and subdirectories skipping those
445
- in the &#8217;.svn&#8217;, and &#8216;pkg&#8217; directories
446
-
447
- <pre>
448
- # method 1
449
- is_ruby_exe = proc{ |f| f.executable? and f[0][0] =~ /^#!.+ruby/ }
450
- ario.norecurse('.svn','pkg').files('*.rb',is_ruby_exe) { |f| ... }
451
- # method 2
452
- is_ruby_exe = proc{ |f| f.executable? and f.gets =~ /^#!.+ruby/ }
453
- ario.norecurse('.svn','pkg').files('*.rb',is_ruby_exe) { |f| ... }
454
- </pre>
455
- </li>
456
- <li>Put all files excluding those that are symlinks to files in an array
457
-
458
- <pre>
459
- # method 1
460
- array = ario.skipfiles[:symlink?]
461
- # method 2
462
- array = ario.skipfiles(:symlink?).files[]
463
- # method 3
464
- array = ario.skipfiles(:symlink?).to_a
465
- # method 4
466
- array = ario.files.skipfiles[:symlink?]
467
- </pre>
468
- </li>
469
- <li>Put all entries that are not files (or symlinks to files) into an array
470
-
471
- <pre>
472
- # method 1
473
- array = ario.skipfiles[]
474
- # method 2
475
- array = ario.skipfiles.to_a
476
- </pre>
477
- </li>
478
- <li>Put all entries that are symlinks to files into an array
479
-
480
- <pre>
481
- # method 1
482
- array = ario.files[proc{|f| f.file? and f.symlink?}]
483
- # method 2
484
- array = ario.files(proc{|f| f.file? and f.symlink?}).to_a
485
- </pre>
486
- </li>
487
- <li>Put all directories except those named &#8217;.svn&#8217; into an array
488
-
489
- <pre>
490
- # method 1
491
- array = ario.skipdirs['.svn']
492
- # method 2
493
- array = ario.skipdirs[/^\.svn/]
494
- # method 3
495
- array = ario.skipdirs('.svn').to_a
496
- # method 4
497
- array = ario.skipdirs('.svn').dirs[]
498
- # method 5
499
- array = ario.skipdirs('.svn')[]
500
- </pre>
501
- </li>
502
- </ul>
503
- <hr size="1"></hr><h3>Read and writing files</h3>
504
- <pre>
505
- ario = rio('afile')
506
- string = &quot;&quot;
507
- array = []
508
- </pre>
509
- <ul>
510
- <li>Copy the contents of one file into another file
511
-
512
- <pre>
513
- # method 1
514
- rio('srcfile') &gt; rio('dstfile')
515
- # method 2
516
- rio('dstfile') &lt; rio('srcfile')
517
- # method 3
518
- rip('dstfile').print!(rio('srcfile').contents)
519
- </pre>
520
- </li>
521
- <li>Append the contents of one file to another file
522
-
523
- <pre>
524
- # method 1
525
- rio('srcfile') &gt;&gt; rio('dstfile')
526
- # method 2
527
- rio('dstfile') &lt;&lt; rio('srcfile')
528
- # method 3
529
- rip('dstfile').a.print!(rio('srcfile').contents)
530
- </pre>
531
- </li>
532
- <li>Copy the first 10 lines of one file to another file
533
-
534
- <pre>
535
- # method 1
536
- rio('srcfile').lines(0...10) &gt; rio('dstfile')
537
- # method 2
538
- rio('dstfile') &lt; rio('srcfile').lines(0...10)
539
- # method 3
540
- rio('dstfile') &lt; rio('srcfile').lines[0...10]
541
- </pre>
542
- </li>
543
- <li>Concatenate several files into one
544
-
545
- <pre>
546
- # method 1
547
- rio('dstfile') &lt; [ rio('src1'), rio('src2'), rio('src3') ]
548
- # method 2
549
- rio('dstfile') &lt; rio('src1') &lt;&lt; rio('src2') &lt;&lt; rio('src3')
550
- </pre>
551
- </li>
552
- <li>Copy a web page into a file
553
-
554
- <pre>
555
- # method 1
556
- rio('http://ruby-doc.org/') &gt; rio('afile')
557
- # method 2
558
- rio('afile') &lt; rio('http://ruby-doc.org/')
559
- # method 3
560
- rio('afile').print!(rio('http://ruby-doc.org/').contents)
561
- </pre>
562
- </li>
563
- <li>Append the output of the daytime server running on the localhost to a file
564
-
565
- <pre>
566
- # method 1
567
- rio(&quot;tcp://localhost:daytime&quot;) &gt;&gt; rio('afile')
568
- # method 2
569
- rio(&quot;tcp:&quot;,'localhost','daytime') &gt;&gt; rio('afile')
570
- # method 3
571
- rio('afile') &lt;&lt; rio(&quot;tcp://:daytime&quot;)
572
- # method 4
573
- rio('afile') &lt;&lt; rio(&quot;tcp://:13&quot;)
574
- </pre>
575
- </li>
576
- <li>Copy the first line and all lines containing &#8216;http:&#8217; to a file
577
-
578
- <pre>
579
- # method 1
580
- rio('srcfile').lines(0,/http:/) &gt; rio('dstfile')
581
- # method 2
582
- rio('dstfile') &lt; rio('srcfile').lines(0,/http:/)
583
- # method 3
584
- rio('dstfile') &lt; rio('srcfile').lines[0,/http:/]
585
- # method 4
586
- </pre>
587
- </li>
588
- <li>Create a gzipped copy of a file
589
-
590
- <pre>
591
- # method 1
592
- rio('afile') &gt; rio('afile.gz').gzip
593
- # method 2
594
- rio('afile.gz').gzip &lt; rio('afile')
595
- # method 3
596
- rio('afile.gz').gzip.print!( rio('afile').contents )
597
- </pre>
598
- </li>
599
- <li>Create an ungzipped copy of a gzipped file
600
-
601
- <pre>
602
- # method 1
603
- rio('afile') &lt; rio('afile.gz').gzip
604
- # method 2
605
- rio('afile.gz').gzip &gt; rio('afile')
606
- # method 3
607
- rio('afile').print!( rio('afile.gz').gzip.contents )
608
- </pre>
609
- </li>
610
- <li>Copy the first 100 lines of gzipped file on a webserver into a local file
611
-
612
- <pre>
613
- # method 1
614
- rio('http://aserver/afile.gz').gzip.lines(0...100) &gt; rio('afile')
615
- </pre>
616
- </li>
617
- <li>Create a file composed of a header from another file, the output of the
618
- &#8216;ps&#8217; command, some text and its creation time pulled from the
619
- daytime server running on your localhost
620
-
621
- <pre>
622
- # method 1
623
- rio('out') &lt; [ rio('header'), rio(?-,'ps'), &quot;Created on &quot;, rio('tcp://:daytime') ]
624
- # method 2
625
- rio('out') &lt; rio('header') &lt;&lt; rio(?-,'ps') &lt;&lt; &quot;Created on: &quot; &lt;&lt; rio(&quot;tcp://:daytime&quot;)
626
- </pre>
627
- </li>
628
- </ul>
629
- <hr size="1"></hr><h3>Reading multiple files</h3>
630
- <pre>
631
- ario = rio('adir')
632
- string = &quot;&quot;
633
- array = []
634
- </pre>
635
- <ul>
636
- <li>Count the lines of code in a directory tree of ruby source files
637
-
638
- <pre>
639
- # method 1
640
- cnt = ario.all.files('*.rb').chomp.skiplines(/^\s*#/,/^\s*$/).inject(0) { |sum,l| sum += 1 }
641
- # method 2
642
- cnt = ario.all.files('*.rb').chomp.skiplines[/^\s*#/,/^\s*$/].size
643
- </pre>
644
- </li>
645
- <li>Concatanate the contents of all .txt files in a directory into an array
646
-
647
- <pre>
648
- # method 1
649
- array = ario.lines.files['*.txt']
650
- # method 2
651
- array = ario.files('*.txt').lines[]
652
- # method 3
653
- ario.files('*.txt').lines &gt; array
654
- </pre>
655
- </li>
656
- <li>Concatanate the first line of all .txt files in a directory into an array
657
-
658
- <pre>
659
- # method 1
660
- array = ario.lines(0).files['*.txt']
661
- # method 2
662
- array = ario.files('*.txt').lines[0]
663
- # method 3
664
- ario.files('*.txt').lines(0) &gt; array
665
- </pre>
666
- </li>
667
- <li>Copy all .txt files (but only their first ten lines) in a directory into
668
- another directiory
669
-
670
- <pre>
671
- # method 1
672
- ario.files('*.txt').lines(0...10) &gt; rio('another_dir')
673
- </pre>
674
- </li>
675
- </ul>
676
- <hr size="1"></hr><h3>Read and write using Standard IO</h3>
677
- <pre>
678
- string = &quot;&quot;
679
- array = []
680
- </pre>
681
- <ul>
682
- <li>Prompt for input and return what was typed
683
-
684
- <pre>
685
- # method 1
686
- ans = rio(?-).chomp.print(&quot;Type Something: &quot;).gets
687
- # method 2
688
- stdio = rio(?-).chomp
689
- ans = stdio.print(&quot;Type Something: &quot;).gets
690
- </pre>
691
- </li>
692
- <li>Create a <a href="../Rio.html">Rio</a> tied to stdin or stdout, depending
693
- on how it is used
694
-
695
- <pre>
696
- stdio = rio(?-)
697
- </pre>
698
- </li>
699
- <li>Create a <a href="../Rio.html">Rio</a> tied to stderr
700
-
701
- <pre>
702
- stderr = rio(?=)
703
- </pre>
704
- </li>
705
- <li>Write a string to stdout
706
-
707
- <pre>
708
- # method 1
709
- rio(?-).puts(&quot;Hello World&quot;)
710
- # method 2
711
- rio(?-) &lt;&lt; &quot;Hello World\n&quot;
712
- # method 3
713
- rio(?-) &lt; &quot;Hello World\n&quot;
714
- </pre>
715
- </li>
716
- <li>Read a string from stdin with the input chomped
717
-
718
- <pre>
719
- # method 1
720
- ans = rio(?-).chomp.gets
721
- # method 2
722
- stdio = rio(?-).chomp
723
- ans = stdio.gets
724
- </pre>
725
- </li>
726
- <li>Read from stdin until end of file with the result going into a string
727
-
728
- <pre>
729
- # method 1
730
- rio(?-) &gt;&gt; string
731
- # method 2
732
- rio(?-) &gt; string
733
- </pre>
734
- </li>
735
- <li>Read from stdin until end of file with the chomped lines going into an
736
- array
737
-
738
- <pre>
739
- # method 1
740
- rio(?-).chomp &gt;&gt; array
741
- # method 2
742
- rio(?-).chomp &gt; array
743
- </pre>
744
- </li>
745
- <li>Read from stdin until end of file with the result going into a file
746
-
747
- <pre>
748
- # method 1
749
- rio(?-) &gt; rio('afile')
750
- # method 2
751
- rio('afile') &lt; rio(?-)
752
- </pre>
753
- </li>
754
- <li>Read from stdin until end of file with the result appended to a file
755
-
756
- <pre>
757
- # method 1
758
- rio(?-) &gt;&gt; rio('afile')
759
- # method 2
760
- rio('afile') &lt;&lt; rio(?-)
761
- </pre>
762
- </li>
763
- <li>Write a message to stderr
764
-
765
- <pre>
766
- # method 1
767
- rio(?=).puts(&quot;Hello Error&quot;)
768
- # method 2
769
- rio(?=) &lt;&lt; &quot;Hello Error\n&quot;
770
- # method 3
771
- rio(?=) &lt; &quot;Hello Error\n&quot;
772
- </pre>
773
- </li>
774
- <li>Dump a file to stdout
775
-
776
- <pre>
777
- # method 1
778
- rio(?-) &lt;&lt; rio('afile')
779
- # method 2
780
- rio('afile') &gt;&gt; rio(?-)
781
- # method 3
782
- rio('afile') &gt; rio(?-)
783
- # method 4
784
- rio(?-) &lt; rio('afile')
785
- # method 5
786
- rio(?-).print(rio('afile').contents)
787
- </pre>
788
- </li>
789
- <li>Emulate a simplified unix &#8216;head&#8217; command which reads from stdin
790
- and writes the first 10 lines to stdout
791
-
792
- <pre>
793
- # method 1
794
- rio(?-).lines(0..9) &gt; rio(?-)
795
- </pre>
796
- </li>
797
- </ul>
798
- <hr size="1"></hr><h3>Reading and writing from processes as one might do with popen</h3>
799
- <ul>
800
- <li>Read the output of the &#8216;ps&#8217; command into an array without the
801
- header line or the line representing the &#8216;ps&#8217; command itself
802
-
803
- <pre>
804
- ps = rio(?-,'ps -a').skiplines[0,/ps$/]
805
- </pre>
806
- </li>
807
- <li>Run an external program, copying its input from one location and its output
808
- to another, and make it look very much like a shell command.
809
-
810
- <pre>
811
- infile = rio(?&quot;,&quot;Hello Kitty\n&quot;)
812
- outfile = rio('out.txt')
813
-
814
- # method 1
815
- cat = rio(?-,'cat').w!
816
- cat &lt;infile &gt;outfile
817
-
818
- # method 2
819
- infile | 'cat' | outfile
820
- </pre>
821
- </li>
822
- </ul>
823
- <hr size="1"></hr><h3>Renaming and moving files</h3>
824
- <pre>
825
- string = &quot;&quot;
826
- array = []
827
- </pre>
828
- <ul>
829
- <li>Rename the file &#8216;a&#8217; to &#8216;b&#8217;
830
-
831
- <pre>
832
- # method 1
833
- rio('a').rename('b')
834
- # method 2
835
- rio('a').rename.filename = 'b'
836
- </pre>
837
- </li>
838
- <li>Rename a file and leave the <a href="../Rio.html">Rio</a> referencing the
839
- files old name
840
-
841
- <pre>
842
- ario = rio('a')
843
- # method 1
844
- ario.rename('b')
845
- </pre>
846
- </li>
847
- <li>Rename a file and change the <a href="../Rio.html">Rio</a> to reference the
848
- new file name
849
-
850
- <pre>
851
- ario = rio('a')
852
- # method 1
853
- ario.rename!('b')
854
- </pre>
855
- </li>
856
- <li>Rename the file &#8216;index.htm&#8217; to &#8216;index.html&#8216;
857
-
858
- <pre>
859
- # method 1
860
- rio('index.htm').rename('index.html')
861
- # method 2
862
- rio('index.htm').rename.extname = '.html'
863
- </pre>
864
- </li>
865
- <li>Rename the file &#8216;index.html&#8217; to &#8216;welcome.html&#8216;
866
-
867
- <pre>
868
- # method 1
869
- rio('index.html').rename('welecome.html')
870
- # method 2
871
- rio('index.htm').rename.basename = 'welcome'
872
- </pre>
873
- </li>
874
- <li>Move a file from directory &#8216;src&#8217; to directory &#8216;dst&#8217;
875
-
876
- <pre>
877
- # method 1
878
- rio('src/afile').rename('dst/afile')
879
- # method 2
880
- rio('src/afile').rename.dirname = 'dst'
881
- </pre>
882
- </li>
883
- <li>Change a file to have the extension &#8217;.html&#8217; leaving the rest of
884
- it as is
885
-
886
- <pre>
887
- # method 1
888
- ario.rename.extname = '.html'
889
- </pre>
890
- </li>
891
- <li>Change a files basename to &#8216;zippy&#8217; without changing its
892
- extension
893
-
894
- <pre>
895
- # method 1
896
- ario.rename.basename = 'zippy'
897
- </pre>
898
- </li>
899
- <li>Change a file ending with &#8217;.tar.gz&#8217; to end with
900
- &#8217;.tgz&#8217;
901
-
902
- <pre>
903
- # method 1
904
- ario.rename.ext('.tar.gz').extname = '.tgz'
905
- </pre>
906
- </li>
907
- <li>Change the extension of all files with the extension &#8217;.htm&#8217; in
908
- a directory to have the extension &#8217;.html&#8217;
909
-
910
- <pre>
911
- # method 1
912
- rio('adir').rename.files('*.htm') do |htmfile|
913
- htmlfile.extname = '.html'
914
- end
915
- # method 2
916
- rio('adir').files('*.htm') do |htmfile|
917
- htmlfile.rename.extname = '.html'
918
- end
919
- </pre>
920
- </li>
921
- <li>Change the extension of all files with the extension &#8217;.htm&#8217; in
922
- a directory and its subdirectories to have the extension
923
- &#8217;.html&#8217;
924
-
925
- <pre>
926
- # method 1
927
- rio('adir').rename.all.files('*.htm') do |htmfile|
928
- htmfile.extname = '.html'
929
- end
930
- # method 2
931
- rio('adir').all.files('*.htm') do |htmfile|
932
- htmfile.rename.extname = '.html'
933
- end
934
- </pre>
935
- </li>
936
- </ul>
937
- <hr size="1"></hr><h3>Manipulate a <a href="../Rio.html">Rio</a>&#8217;s path</h3>
938
- <pre>
939
- string = &quot;&quot;
940
- array = []
941
- </pre>
942
- <ul>
943
- <li>Create a <a href="../Rio.html">Rio</a> with an additional subdirectory
944
- appended
945
-
946
- <pre>
947
- ap = rio('adir')
948
- # method 1
949
- ap /= 'subdirectory'
950
- # method 2
951
- ap = ap.join('subdirectory')
952
- # method 3
953
- ap = rio(ap,'subdirectory')
954
- # method 4
955
- </pre>
956
- </li>
957
- <li>Create a <a href="../Rio.html">Rio</a> from an array of subdirectories
958
-
959
- <pre>
960
- dirs = ['adir','subdir1','subdir2']
961
- # method 1
962
- ario = rio(dirs)
963
- </pre>
964
- </li>
965
- <li>Create an array of subdirectories from a <a href="../Rio.html">Rio</a>
966
-
967
- <pre>
968
- # method 1
969
- anarray = rio('adir/subdir1/subdir2').split
970
- </pre>
971
- </li>
972
- <li>Append a string to a path
973
-
974
- <pre>
975
- # method 1
976
- ario = rio('apath') + astring
977
- # method 2
978
- ario = rio('apath')
979
- ario += astring
980
- </pre>
981
- </li>
982
- <li>create a directory &#8216;links&#8217; with a symlink pointing to each .rb
983
- file in directory &#8216;lib&#8217; (including subdirectories)
984
-
985
- <pre>
986
- lib = rio('lib')
987
- links = rio('links').delete!.mkdir
988
- lib.all.files(&quot;*.rb&quot;) do |f|
989
- f.symlink( f.dirname.sub(/^#{lib}/,links).mkdir )
990
- end
991
- </pre>
992
- </li>
993
- </ul>
994
- <hr size="2"></hr><p>
995
- Suggested Reading
996
- </p>
997
- <ul>
998
- <li><a href="SYNOPSIS.html">RIO::Doc::SYNOPSIS</a>
999
-
1000
- </li>
1001
- <li><a href="INTRO.html">RIO::Doc::INTRO</a>
1002
-
1003
- </li>
1004
- <li><a href="../Rio.html">RIO::Rio</a>
1005
-
1006
- </li>
1007
- </ul>
1008
-
1009
- </div>
1010
-
1011
-
1012
- </div>
1013
-
1014
-
1015
- </div>
1016
-
1017
-
1018
- <!-- if includes -->
1019
-
1020
- <div id="section">
1021
-
1022
-
1023
-
1024
-
1025
-
1026
-
1027
-
1028
-
1029
- <!-- if method_list -->
1030
-
1031
-
1032
- </div>
1033
-
1034
-
1035
- <div id="validator-badges">
1036
- <p><small>Copyright &copy; 2005 Christopher Kleckner. <a href="http://www.gnu.org/licenses/gpl.html">All rights reserved</a>.</small></p>
1037
- </div>
1038
-
1039
- </body>
1040
- </html>