rio 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (580) hide show
  1. data/COPYING +0 -0
  2. data/ChangeLog +3122 -0
  3. data/README +2 -2
  4. data/Rakefile +1 -1
  5. data/VERSION +1 -0
  6. data/build_doc.rb +28 -3
  7. data/doc/ANNOUNCE +1 -1
  8. data/doc/RELEASE_NOTES +0 -0
  9. data/doc/RIOIS +1 -1
  10. data/doc/generators/template/html/rio.css +1 -1
  11. data/doc/generators/template/html/rio.rb +2 -2
  12. data/doc/generators/template/html/ugly.rb +1 -1
  13. data/doc/pkg_def.rb +1 -1
  14. data/doc/rdoc/classes/Kernel.html +133 -0
  15. data/doc/rdoc/classes/Kernel.src/M000234.html +18 -0
  16. data/doc/rdoc/classes/RIO.html +625 -0
  17. data/doc/rdoc/classes/RIO.src/M000001.html +18 -0
  18. data/doc/rdoc/classes/RIO.src/M000002.html +18 -0
  19. data/doc/rdoc/classes/RIO.src/M000003.html +18 -0
  20. data/doc/rdoc/classes/RIO/Doc.html +149 -0
  21. data/doc/rdoc/classes/RIO/Doc/EXAMPLES.html +432 -0
  22. data/doc/rdoc/classes/RIO/Doc/HOWTO.html +1084 -0
  23. data/doc/rdoc/classes/RIO/Doc/INDEX.html +368 -0
  24. data/doc/rdoc/classes/RIO/Doc/INTRO.html +1529 -0
  25. data/doc/rdoc/classes/RIO/Doc/OPTIONAL.html +221 -0
  26. data/doc/rdoc/classes/RIO/Doc/SYNOPSIS.html +336 -0
  27. data/doc/rdoc/classes/RIO/IF.html +165 -0
  28. data/doc/rdoc/classes/RIO/IF/CSV.html +203 -0
  29. data/doc/rdoc/classes/RIO/IF/CSV.src/M000129.html +19 -0
  30. data/doc/rdoc/classes/RIO/IF/CSV.src/M000130.html +16 -0
  31. data/doc/rdoc/classes/RIO/IF/CSV.src/M000131.html +16 -0
  32. data/doc/rdoc/classes/RIO/IF/Dir.html +343 -0
  33. data/doc/rdoc/classes/RIO/IF/Dir.src/M000045.html +16 -0
  34. data/doc/rdoc/classes/RIO/IF/Dir.src/M000046.html +16 -0
  35. data/doc/rdoc/classes/RIO/IF/Dir.src/M000047.html +16 -0
  36. data/doc/rdoc/classes/RIO/IF/Dir.src/M000048.html +16 -0
  37. data/doc/rdoc/classes/RIO/IF/Dir.src/M000049.html +16 -0
  38. data/doc/rdoc/classes/RIO/IF/Dir.src/M000050.html +16 -0
  39. data/doc/rdoc/classes/RIO/IF/Dir.src/M000051.html +16 -0
  40. data/doc/rdoc/classes/RIO/IF/File.html +223 -0
  41. data/doc/rdoc/classes/RIO/IF/File.src/M000216.html +16 -0
  42. data/doc/rdoc/classes/RIO/IF/File.src/M000217.html +16 -0
  43. data/doc/rdoc/classes/RIO/IF/File.src/M000218.html +16 -0
  44. data/doc/rdoc/classes/RIO/IF/File.src/M000219.html +16 -0
  45. data/doc/rdoc/classes/RIO/IF/FileOrDir.html +572 -0
  46. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000117.html +16 -0
  47. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000118.html +16 -0
  48. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000119.html +16 -0
  49. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000120.html +16 -0
  50. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000121.html +16 -0
  51. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000122.html +16 -0
  52. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000123.html +16 -0
  53. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000124.html +16 -0
  54. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000125.html +16 -0
  55. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000126.html +16 -0
  56. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000127.html +16 -0
  57. data/doc/rdoc/classes/RIO/IF/FileOrDir.src/M000128.html +16 -0
  58. data/doc/rdoc/classes/RIO/IF/Grande.html +1376 -0
  59. data/doc/rdoc/classes/RIO/IF/Grande.src/M000052.html +16 -0
  60. data/doc/rdoc/classes/RIO/IF/Grande.src/M000053.html +16 -0
  61. data/doc/rdoc/classes/RIO/IF/Grande.src/M000054.html +16 -0
  62. data/doc/rdoc/classes/RIO/IF/Grande.src/M000055.html +16 -0
  63. data/doc/rdoc/classes/RIO/IF/Grande.src/M000056.html +16 -0
  64. data/doc/rdoc/classes/RIO/IF/Grande.src/M000057.html +16 -0
  65. data/doc/rdoc/classes/RIO/IF/Grande.src/M000058.html +21 -0
  66. data/doc/rdoc/classes/RIO/IF/Grande.src/M000059.html +16 -0
  67. data/doc/rdoc/classes/RIO/IF/Grande.src/M000060.html +16 -0
  68. data/doc/rdoc/classes/RIO/IF/Grande.src/M000061.html +16 -0
  69. data/doc/rdoc/classes/RIO/IF/Grande.src/M000062.html +16 -0
  70. data/doc/rdoc/classes/RIO/IF/Grande.src/M000063.html +16 -0
  71. data/doc/rdoc/classes/RIO/IF/Grande.src/M000064.html +16 -0
  72. data/doc/rdoc/classes/RIO/IF/Grande.src/M000065.html +21 -0
  73. data/doc/rdoc/classes/RIO/IF/Grande.src/M000066.html +16 -0
  74. data/doc/rdoc/classes/RIO/IF/Grande.src/M000067.html +16 -0
  75. data/doc/rdoc/classes/RIO/IF/Grande.src/M000068.html +16 -0
  76. data/doc/rdoc/classes/RIO/IF/Grande.src/M000069.html +16 -0
  77. data/doc/rdoc/classes/RIO/IF/Grande.src/M000070.html +16 -0
  78. data/doc/rdoc/classes/RIO/IF/GrandeEntry.html +810 -0
  79. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000107.html +16 -0
  80. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000108.html +16 -0
  81. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000109.html +16 -0
  82. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000110.html +16 -0
  83. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000111.html +16 -0
  84. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000112.html +16 -0
  85. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000113.html +16 -0
  86. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000114.html +16 -0
  87. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000115.html +16 -0
  88. data/doc/rdoc/classes/RIO/IF/GrandeEntry.src/M000116.html +16 -0
  89. data/doc/rdoc/classes/RIO/IF/GrandeStream.html +1513 -0
  90. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000071.html +16 -0
  91. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000072.html +16 -0
  92. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000073.html +16 -0
  93. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000074.html +16 -0
  94. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000075.html +16 -0
  95. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000076.html +16 -0
  96. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000077.html +16 -0
  97. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000078.html +16 -0
  98. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000079.html +16 -0
  99. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000080.html +16 -0
  100. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000081.html +16 -0
  101. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000082.html +16 -0
  102. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000083.html +16 -0
  103. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000084.html +16 -0
  104. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000085.html +16 -0
  105. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000086.html +16 -0
  106. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000087.html +19 -0
  107. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000088.html +16 -0
  108. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000089.html +16 -0
  109. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000090.html +16 -0
  110. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000091.html +16 -0
  111. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000092.html +16 -0
  112. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000093.html +16 -0
  113. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000094.html +16 -0
  114. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000095.html +16 -0
  115. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000096.html +16 -0
  116. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000097.html +16 -0
  117. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000098.html +16 -0
  118. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000099.html +16 -0
  119. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000100.html +16 -0
  120. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000101.html +16 -0
  121. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000102.html +16 -0
  122. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000103.html +16 -0
  123. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000104.html +16 -0
  124. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000105.html +16 -0
  125. data/doc/rdoc/classes/RIO/IF/GrandeStream.src/M000106.html +16 -0
  126. data/doc/rdoc/classes/RIO/IF/Path.html +999 -0
  127. data/doc/rdoc/classes/RIO/IF/Path.src/M000132.html +16 -0
  128. data/doc/rdoc/classes/RIO/IF/Path.src/M000133.html +16 -0
  129. data/doc/rdoc/classes/RIO/IF/Path.src/M000134.html +16 -0
  130. data/doc/rdoc/classes/RIO/IF/Path.src/M000135.html +16 -0
  131. data/doc/rdoc/classes/RIO/IF/Path.src/M000136.html +16 -0
  132. data/doc/rdoc/classes/RIO/IF/Path.src/M000137.html +16 -0
  133. data/doc/rdoc/classes/RIO/IF/Path.src/M000138.html +16 -0
  134. data/doc/rdoc/classes/RIO/IF/Path.src/M000139.html +16 -0
  135. data/doc/rdoc/classes/RIO/IF/Path.src/M000140.html +16 -0
  136. data/doc/rdoc/classes/RIO/IF/Path.src/M000141.html +16 -0
  137. data/doc/rdoc/classes/RIO/IF/Path.src/M000142.html +16 -0
  138. data/doc/rdoc/classes/RIO/IF/Path.src/M000143.html +16 -0
  139. data/doc/rdoc/classes/RIO/IF/Path.src/M000144.html +16 -0
  140. data/doc/rdoc/classes/RIO/IF/Path.src/M000145.html +16 -0
  141. data/doc/rdoc/classes/RIO/IF/Path.src/M000146.html +16 -0
  142. data/doc/rdoc/classes/RIO/IF/Path.src/M000147.html +16 -0
  143. data/doc/rdoc/classes/RIO/IF/Path.src/M000148.html +16 -0
  144. data/doc/rdoc/classes/RIO/IF/Path.src/M000149.html +16 -0
  145. data/doc/rdoc/classes/RIO/IF/Path.src/M000150.html +16 -0
  146. data/doc/rdoc/classes/RIO/IF/Path.src/M000151.html +16 -0
  147. data/doc/rdoc/classes/RIO/IF/Path.src/M000152.html +16 -0
  148. data/doc/rdoc/classes/RIO/IF/Path.src/M000153.html +16 -0
  149. data/doc/rdoc/classes/RIO/IF/Path.src/M000154.html +18 -0
  150. data/doc/rdoc/classes/RIO/IF/Path.src/M000155.html +16 -0
  151. data/doc/rdoc/classes/RIO/IF/Path.src/M000156.html +16 -0
  152. data/doc/rdoc/classes/RIO/IF/Path.src/M000157.html +16 -0
  153. data/doc/rdoc/classes/RIO/IF/Path.src/M000158.html +16 -0
  154. data/doc/rdoc/classes/RIO/IF/Path.src/M000159.html +16 -0
  155. data/doc/rdoc/classes/RIO/IF/Path.src/M000160.html +16 -0
  156. data/doc/rdoc/classes/RIO/IF/Path.src/M000161.html +16 -0
  157. data/doc/rdoc/classes/RIO/IF/Path.src/M000162.html +16 -0
  158. data/doc/rdoc/classes/RIO/IF/Path.src/M000163.html +16 -0
  159. data/doc/rdoc/classes/RIO/IF/RubyIO.html +1416 -0
  160. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000004.html +16 -0
  161. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000005.html +16 -0
  162. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000006.html +16 -0
  163. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000007.html +16 -0
  164. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000008.html +16 -0
  165. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000009.html +16 -0
  166. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000010.html +16 -0
  167. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000011.html +16 -0
  168. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000012.html +16 -0
  169. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000013.html +16 -0
  170. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000014.html +16 -0
  171. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000015.html +16 -0
  172. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000016.html +16 -0
  173. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000017.html +16 -0
  174. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000018.html +16 -0
  175. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000019.html +16 -0
  176. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000020.html +16 -0
  177. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000021.html +16 -0
  178. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000022.html +16 -0
  179. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000023.html +16 -0
  180. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000024.html +16 -0
  181. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000025.html +16 -0
  182. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000026.html +16 -0
  183. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000027.html +16 -0
  184. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000028.html +16 -0
  185. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000029.html +16 -0
  186. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000030.html +16 -0
  187. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000031.html +16 -0
  188. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000032.html +16 -0
  189. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000033.html +16 -0
  190. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000034.html +16 -0
  191. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000035.html +16 -0
  192. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000036.html +16 -0
  193. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000037.html +16 -0
  194. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000038.html +16 -0
  195. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000039.html +16 -0
  196. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000040.html +16 -0
  197. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000041.html +16 -0
  198. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000042.html +16 -0
  199. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000043.html +16 -0
  200. data/doc/rdoc/classes/RIO/IF/RubyIO.src/M000044.html +16 -0
  201. data/doc/rdoc/classes/RIO/IF/String.html +203 -0
  202. data/doc/rdoc/classes/RIO/IF/String.src/M000213.html +16 -0
  203. data/doc/rdoc/classes/RIO/IF/String.src/M000214.html +16 -0
  204. data/doc/rdoc/classes/RIO/IF/String.src/M000215.html +16 -0
  205. data/doc/rdoc/classes/RIO/IF/Test.html +990 -0
  206. data/doc/rdoc/classes/RIO/IF/Test.src/M000177.html +16 -0
  207. data/doc/rdoc/classes/RIO/IF/Test.src/M000178.html +16 -0
  208. data/doc/rdoc/classes/RIO/IF/Test.src/M000179.html +16 -0
  209. data/doc/rdoc/classes/RIO/IF/Test.src/M000180.html +16 -0
  210. data/doc/rdoc/classes/RIO/IF/Test.src/M000181.html +16 -0
  211. data/doc/rdoc/classes/RIO/IF/Test.src/M000182.html +16 -0
  212. data/doc/rdoc/classes/RIO/IF/Test.src/M000183.html +16 -0
  213. data/doc/rdoc/classes/RIO/IF/Test.src/M000184.html +16 -0
  214. data/doc/rdoc/classes/RIO/IF/Test.src/M000185.html +16 -0
  215. data/doc/rdoc/classes/RIO/IF/Test.src/M000186.html +16 -0
  216. data/doc/rdoc/classes/RIO/IF/Test.src/M000187.html +16 -0
  217. data/doc/rdoc/classes/RIO/IF/Test.src/M000188.html +16 -0
  218. data/doc/rdoc/classes/RIO/IF/Test.src/M000189.html +16 -0
  219. data/doc/rdoc/classes/RIO/IF/Test.src/M000190.html +16 -0
  220. data/doc/rdoc/classes/RIO/IF/Test.src/M000191.html +16 -0
  221. data/doc/rdoc/classes/RIO/IF/Test.src/M000192.html +16 -0
  222. data/doc/rdoc/classes/RIO/IF/Test.src/M000193.html +16 -0
  223. data/doc/rdoc/classes/RIO/IF/Test.src/M000194.html +16 -0
  224. data/doc/rdoc/classes/RIO/IF/Test.src/M000195.html +16 -0
  225. data/doc/rdoc/classes/RIO/IF/Test.src/M000196.html +16 -0
  226. data/doc/rdoc/classes/RIO/IF/Test.src/M000197.html +16 -0
  227. data/doc/rdoc/classes/RIO/IF/Test.src/M000198.html +16 -0
  228. data/doc/rdoc/classes/RIO/IF/Test.src/M000199.html +16 -0
  229. data/doc/rdoc/classes/RIO/IF/Test.src/M000200.html +16 -0
  230. data/doc/rdoc/classes/RIO/IF/Test.src/M000201.html +16 -0
  231. data/doc/rdoc/classes/RIO/IF/Test.src/M000202.html +16 -0
  232. data/doc/rdoc/classes/RIO/IF/Test.src/M000203.html +16 -0
  233. data/doc/rdoc/classes/RIO/IF/Test.src/M000204.html +16 -0
  234. data/doc/rdoc/classes/RIO/IF/Test.src/M000205.html +16 -0
  235. data/doc/rdoc/classes/RIO/IF/Test.src/M000206.html +16 -0
  236. data/doc/rdoc/classes/RIO/IF/Test.src/M000207.html +16 -0
  237. data/doc/rdoc/classes/RIO/IF/Test.src/M000208.html +16 -0
  238. data/doc/rdoc/classes/RIO/IF/Test.src/M000209.html +16 -0
  239. data/doc/rdoc/classes/RIO/IF/Test.src/M000210.html +16 -0
  240. data/doc/rdoc/classes/RIO/IF/Test.src/M000211.html +16 -0
  241. data/doc/rdoc/classes/RIO/IF/Test.src/M000212.html +16 -0
  242. data/doc/rdoc/classes/RIO/IF/YAML.html +517 -0
  243. data/doc/rdoc/classes/RIO/IF/YAML.src/M000164.html +19 -0
  244. data/doc/rdoc/classes/RIO/IF/YAML.src/M000165.html +16 -0
  245. data/doc/rdoc/classes/RIO/IF/YAML.src/M000166.html +16 -0
  246. data/doc/rdoc/classes/RIO/IF/YAML.src/M000167.html +16 -0
  247. data/doc/rdoc/classes/RIO/IF/YAML.src/M000168.html +16 -0
  248. data/doc/rdoc/classes/RIO/IF/YAML.src/M000169.html +16 -0
  249. data/doc/rdoc/classes/RIO/IF/YAML.src/M000170.html +16 -0
  250. data/doc/rdoc/classes/RIO/IF/YAML.src/M000171.html +16 -0
  251. data/doc/rdoc/classes/RIO/IF/YAML.src/M000172.html +16 -0
  252. data/doc/rdoc/classes/RIO/IF/YAML.src/M000173.html +16 -0
  253. data/doc/rdoc/classes/RIO/IF/YAML.src/M000174.html +16 -0
  254. data/doc/rdoc/classes/RIO/IF/YAML.src/M000175.html +16 -0
  255. data/doc/rdoc/classes/RIO/IF/YAML.src/M000176.html +16 -0
  256. data/doc/rdoc/classes/RIO/Rio.html +508 -0
  257. data/doc/rdoc/classes/RIO/Rio.src/M000220.html +18 -0
  258. data/doc/rdoc/classes/RIO/Rio.src/M000221.html +20 -0
  259. data/doc/rdoc/classes/RIO/Rio.src/M000222.html +27 -0
  260. data/doc/rdoc/classes/RIO/Rio.src/M000223.html +16 -0
  261. data/doc/rdoc/classes/RIO/Rio.src/M000225.html +19 -0
  262. data/doc/rdoc/classes/RIO/Rio.src/M000226.html +20 -0
  263. data/doc/rdoc/classes/RIO/Rio.src/M000227.html +16 -0
  264. data/doc/rdoc/classes/RIO/Rio.src/M000228.html +16 -0
  265. data/doc/rdoc/classes/RIO/Rio.src/M000229.html +16 -0
  266. data/doc/rdoc/classes/RIO/Rio.src/M000230.html +16 -0
  267. data/doc/rdoc/classes/RIO/Rio.src/M000231.html +16 -0
  268. data/doc/rdoc/classes/RIO/Rio.src/M000232.html +16 -0
  269. data/doc/rdoc/classes/RIO/Rio.src/M000233.html +16 -0
  270. data/doc/rdoc/created.rid +1 -0
  271. data/doc/rdoc/files/README.html +232 -0
  272. data/doc/rdoc/files/lib/rio/constructor_rb.html +141 -0
  273. data/doc/rdoc/files/lib/rio/doc/EXAMPLES_rb.html +134 -0
  274. data/doc/rdoc/files/lib/rio/doc/HOWTO_rb.html +134 -0
  275. data/doc/rdoc/files/lib/rio/doc/INDEX_rb.html +134 -0
  276. data/doc/rdoc/files/lib/rio/doc/INTRO_rb.html +134 -0
  277. data/doc/rdoc/files/lib/rio/doc/OPTIONAL_rb.html +134 -0
  278. data/doc/rdoc/files/lib/rio/doc/SYNOPSIS_rb.html +134 -0
  279. data/doc/rdoc/files/lib/rio/if/basic_rb.html +134 -0
  280. data/doc/rdoc/files/lib/rio/if/csv_rb.html +134 -0
  281. data/doc/rdoc/files/lib/rio/if/dir_rb.html +134 -0
  282. data/doc/rdoc/files/lib/rio/if/file_rb.html +134 -0
  283. data/doc/rdoc/files/lib/rio/if/fileordir_rb.html +134 -0
  284. data/doc/rdoc/files/lib/rio/if/grande_entry_rb.html +134 -0
  285. data/doc/rdoc/files/lib/rio/if/grande_rb.html +141 -0
  286. data/doc/rdoc/files/lib/rio/if/grande_stream_rb.html +134 -0
  287. data/doc/rdoc/files/lib/rio/if/internal_rb.html +134 -0
  288. data/doc/rdoc/files/lib/rio/if/path_rb.html +134 -0
  289. data/doc/rdoc/files/lib/rio/if/rubyio_rb.html +134 -0
  290. data/doc/rdoc/files/lib/rio/if/string_rb.html +134 -0
  291. data/doc/rdoc/files/lib/rio/if/temp_rb.html +134 -0
  292. data/doc/rdoc/files/lib/rio/if/test_rb.html +134 -0
  293. data/doc/rdoc/files/lib/rio/if/yaml_rb.html +134 -0
  294. data/doc/rdoc/files/lib/rio/kernel_rb.html +142 -0
  295. data/doc/rdoc/files/lib/rio_rb.html +153 -0
  296. data/doc/rdoc/fr_class_index.html +49 -0
  297. data/doc/rdoc/fr_file_index.html +51 -0
  298. data/doc/rdoc/fr_method_index.html +260 -0
  299. data/doc/rdoc/index.html +30 -0
  300. data/doc/rdoc/rdoc-style.css +428 -0
  301. data/doc/rfc1738.txt +0 -0
  302. data/doc/rfc959.txt +0 -0
  303. data/ex/catcsv.rb +0 -0
  304. data/ex/colx.rb +0 -0
  305. data/ex/findinruby +0 -0
  306. data/ex/findruby +0 -0
  307. data/ex/passwd_report.rb +0 -0
  308. data/ex/prompt.rb +0 -0
  309. data/ex/rgb.txt.gz +0 -0
  310. data/ex/riocat +0 -0
  311. data/ex/riogunzip +0 -0
  312. data/ex/riogzip +0 -0
  313. data/ex/rioprompt.rb +0 -0
  314. data/ex/targz2zip +0 -0
  315. data/ex/tonl +0 -0
  316. data/lib/rio.rb +1 -1
  317. data/lib/rio/abstract_method.rb +1 -1
  318. data/lib/rio/argv.rb +1 -1
  319. data/lib/rio/arycopy.rb +1 -1
  320. data/lib/rio/assert.rb +1 -1
  321. data/lib/rio/base.rb +1 -1
  322. data/lib/rio/callstr.rb +1 -1
  323. data/lib/rio/const.rb +1 -1
  324. data/lib/rio/construct.rb +1 -1
  325. data/lib/rio/constructor.rb +1 -1
  326. data/lib/rio/context.rb +1 -1
  327. data/lib/rio/context/autoclose.rb +1 -1
  328. data/lib/rio/context/copying.rb +1 -1
  329. data/lib/rio/context/cxx.rb +1 -1
  330. data/lib/rio/context/dir.rb +1 -1
  331. data/lib/rio/context/gzip.rb +1 -1
  332. data/lib/rio/context/methods.rb +1 -1
  333. data/lib/rio/context/skip.rb +1 -1
  334. data/lib/rio/context/stream.rb +1 -1
  335. data/lib/rio/cp.rb +1 -1
  336. data/lib/rio/def.rb +1 -1
  337. data/lib/rio/dir.rb +1 -1
  338. data/lib/rio/doc.rb +5 -4
  339. data/lib/rio/doc/EXAMPLES.rb +1 -1
  340. data/lib/rio/doc/HOWTO.rb +8 -2
  341. data/lib/rio/doc/INDEX.rb +1 -1
  342. data/lib/rio/doc/INTRO.rb +2 -2
  343. data/lib/rio/doc/OPTIONAL.rb +1 -1
  344. data/lib/rio/doc/SYNOPSIS.rb +2 -2
  345. data/lib/rio/entrysel.rb +1 -1
  346. data/lib/rio/exception.rb +1 -1
  347. data/lib/rio/exception/copy.rb +1 -1
  348. data/lib/rio/exception/notimplemented.rb +1 -1
  349. data/lib/rio/exception/notsupported.rb +1 -1
  350. data/lib/rio/exception/open.rb +1 -1
  351. data/lib/rio/exception/state.rb +1 -1
  352. data/lib/rio/ext.rb +1 -1
  353. data/lib/rio/ext/csv.rb +1 -1
  354. data/lib/rio/ext/if.rb +1 -1
  355. data/lib/rio/ext/mp3info.rb +1 -1
  356. data/lib/rio/ext/splitlines.rb +1 -1
  357. data/lib/rio/ext/yaml.rb +1 -1
  358. data/lib/rio/ext/yaml/doc.rb +1 -1
  359. data/lib/rio/ext/yaml/tie.rb +1 -1
  360. data/lib/rio/ext/zipfile.rb +1 -1
  361. data/lib/rio/ext/zipfile/fs.rb +1 -1
  362. data/lib/rio/ext/zipfile/rl.rb +1 -1
  363. data/lib/rio/ext/zipfile/rootdir.rb +1 -1
  364. data/lib/rio/ext/zipfile/state.rb +1 -1
  365. data/lib/rio/ext/zipfile/wrap.rb +1 -1
  366. data/lib/rio/factory.rb +1 -1
  367. data/lib/rio/file.rb +1 -1
  368. data/lib/rio/filter.rb +1 -1
  369. data/lib/rio/filter/closeoneof.rb +1 -1
  370. data/lib/rio/filter/gzip.rb +1 -1
  371. data/lib/rio/fs/base.rb +1 -1
  372. data/lib/rio/fs/impl.rb +1 -1
  373. data/lib/rio/fs/native.rb +1 -1
  374. data/lib/rio/fs/stream.rb +1 -1
  375. data/lib/rio/fs/url.rb +1 -1
  376. data/lib/rio/ftp/conncache.rb +1 -1
  377. data/lib/rio/ftp/dir.rb +1 -1
  378. data/lib/rio/ftp/fs.rb +1 -1
  379. data/lib/rio/ftp/ftpfile.rb +0 -0
  380. data/lib/rio/grande.rb +1 -1
  381. data/lib/rio/handle.rb +1 -1
  382. data/lib/rio/if.rb +1 -1
  383. data/lib/rio/if/basic.rb +1 -1
  384. data/lib/rio/if/csv.rb +1 -1
  385. data/lib/rio/if/dir.rb +1 -1
  386. data/lib/rio/if/file.rb +1 -1
  387. data/lib/rio/if/fileordir.rb +1 -1
  388. data/lib/rio/if/grande.rb +20 -11
  389. data/lib/rio/if/grande_entry.rb +2 -2
  390. data/lib/rio/if/grande_stream.rb +1 -1
  391. data/lib/rio/if/internal.rb +1 -1
  392. data/lib/rio/if/path.rb +1 -1
  393. data/lib/rio/if/rubyio.rb +3 -3
  394. data/lib/rio/if/string.rb +1 -1
  395. data/lib/rio/if/temp.rb +1 -1
  396. data/lib/rio/if/test.rb +1 -1
  397. data/lib/rio/if/yaml.rb +1 -1
  398. data/lib/rio/ioh.rb +1 -1
  399. data/lib/rio/iomode.rb +1 -1
  400. data/lib/rio/ios/fail.rb +1 -1
  401. data/lib/rio/ios/generic.rb +1 -1
  402. data/lib/rio/ios/mode.rb +1 -1
  403. data/lib/rio/ios/null.rb +1 -1
  404. data/lib/rio/iowrap.rb +1 -1
  405. data/lib/rio/kernel.rb +1 -1
  406. data/lib/rio/local.rb +1 -1
  407. data/lib/rio/match.rb +1 -1
  408. data/lib/rio/matchrecord.rb +1 -1
  409. data/lib/rio/no_warn.rb +1 -1
  410. data/lib/rio/nullio.rb +1 -1
  411. data/lib/rio/open3.rb +2 -2
  412. data/lib/rio/ops/construct.rb +1 -1
  413. data/lib/rio/ops/create.rb +1 -1
  414. data/lib/rio/ops/dir.rb +4 -3
  415. data/lib/rio/ops/either.rb +1 -1
  416. data/lib/rio/ops/file.rb +3 -1
  417. data/lib/rio/ops/path.rb +1 -1
  418. data/lib/rio/ops/stream.rb +1 -1
  419. data/lib/rio/ops/stream/input.rb +1 -1
  420. data/lib/rio/ops/stream/output.rb +1 -1
  421. data/lib/rio/ops/stream/read.rb +1 -1
  422. data/lib/rio/ops/stream/write.rb +1 -1
  423. data/lib/rio/ops/symlink.rb +10 -1
  424. data/lib/rio/path.rb +1 -1
  425. data/lib/rio/path/reset.rb +1 -1
  426. data/lib/rio/piper.rb +1 -1
  427. data/lib/rio/piper/cp.rb +1 -1
  428. data/lib/rio/prompt.rb +6 -2
  429. data/lib/rio/rectype.rb +1 -1
  430. data/lib/rio/rl/base.rb +1 -1
  431. data/lib/rio/rl/builder.rb +1 -1
  432. data/lib/rio/rl/chmap.rb +1 -1
  433. data/lib/rio/rl/fs2url.rb +1 -1
  434. data/lib/rio/rl/ioi.rb +1 -1
  435. data/lib/rio/rl/path.rb +1 -1
  436. data/lib/rio/rl/pathmethods.rb +1 -1
  437. data/lib/rio/rl/uri.rb +1 -1
  438. data/lib/rio/rl/withpath.rb +1 -1
  439. data/lib/rio/scheme/aryio.rb +1 -1
  440. data/lib/rio/scheme/cmdio.rb +1 -1
  441. data/lib/rio/scheme/cmdpipe.rb +1 -1
  442. data/lib/rio/scheme/fd.rb +1 -1
  443. data/lib/rio/scheme/ftp.rb +1 -1
  444. data/lib/rio/scheme/http.rb +1 -1
  445. data/lib/rio/scheme/null.rb +1 -1
  446. data/lib/rio/scheme/path.rb +5 -5
  447. data/lib/rio/scheme/stderr.rb +1 -1
  448. data/lib/rio/scheme/stdio.rb +1 -1
  449. data/lib/rio/scheme/strio.rb +1 -1
  450. data/lib/rio/scheme/sysio.rb +1 -1
  451. data/lib/rio/scheme/tcp.rb +1 -1
  452. data/lib/rio/scheme/temp.rb +1 -1
  453. data/lib/rio/state.rb +2 -9
  454. data/lib/rio/state/error.rb +1 -1
  455. data/lib/rio/stream.rb +1 -1
  456. data/lib/rio/stream/base.rb +1 -1
  457. data/lib/rio/stream/duplex.rb +1 -1
  458. data/lib/rio/stream/open.rb +1 -1
  459. data/lib/rio/symantics.rb +1 -1
  460. data/lib/rio/tempdir.rb +0 -0
  461. data/lib/rio/to_rio.rb +1 -1
  462. data/lib/rio/to_rio/all.rb +1 -1
  463. data/lib/rio/to_rio/array.rb +1 -1
  464. data/lib/rio/to_rio/io.rb +1 -1
  465. data/lib/rio/to_rio/object.rb +1 -1
  466. data/lib/rio/to_rio/string.rb +1 -1
  467. data/lib/rio/uri/file.rb +1 -1
  468. data/lib/rio/util.rb +1 -1
  469. data/lib/rio/version.rb +2 -2
  470. data/test/bin/count_lines.rb +0 -0
  471. data/test/bin/find_lines.rb +0 -0
  472. data/test/bin/list_dir.rb +0 -0
  473. data/test/ftp/all.rb +0 -0
  474. data/test/ftp/anon_misc.rb +0 -0
  475. data/test/ftp/anon_read.rb +0 -0
  476. data/test/ftp/anon_special.rb +0 -0
  477. data/test/ftp/anon_write.rb +0 -0
  478. data/test/ftp/ftp2ftp.rb +0 -0
  479. data/test/ftp/initftpfiles.rb +0 -0
  480. data/test/ftp/testdef.rb +0 -0
  481. data/test/gem_runtests.rb +0 -0
  482. data/test/http/all.rb +0 -0
  483. data/test/http/copy-from-http.rb +0 -0
  484. data/test/runalltests.rb +0 -0
  485. data/test/runftptests.rb +0 -0
  486. data/test/runhttptests.rb +0 -0
  487. data/test/runtests.rb +0 -0
  488. data/test/tc/abs.rb +0 -0
  489. data/test/tc/all.rb +1 -1
  490. data/test/tc/base.rb +0 -0
  491. data/test/tc/base2.rb +0 -0
  492. data/test/tc/cd1.rb +0 -0
  493. data/test/tc/clearsel.rb +0 -0
  494. data/test/tc/clone.rb +0 -0
  495. data/test/tc/closeoncopy.rb +0 -0
  496. data/test/tc/closeoneof.rb +0 -0
  497. data/test/tc/cmdpipe.rb +0 -0
  498. data/test/tc/copy-dir-samevar.rb +0 -0
  499. data/test/tc/copy-from.rb +0 -0
  500. data/test/tc/copy-to.rb +0 -0
  501. data/test/tc/copy.rb +0 -0
  502. data/test/tc/copyarray.rb +0 -0
  503. data/test/tc/copydest.rb +0 -0
  504. data/test/tc/copydir.rb +0 -0
  505. data/test/tc/copydirlines.rb +0 -0
  506. data/test/tc/copylines.rb +0 -0
  507. data/test/tc/copynonex.rb +0 -0
  508. data/test/tc/copysymlink.rb +0 -0
  509. data/test/tc/create.rb +0 -0
  510. data/test/tc/csv.rb +0 -0
  511. data/test/tc/csv2.rb +0 -0
  512. data/test/tc/csv_columns.rb +0 -0
  513. data/test/tc/csvutil.rb +0 -0
  514. data/test/tc/dir.rb +0 -0
  515. data/test/tc/dir_iter.rb +0 -0
  516. data/test/tc/dirautoclose.rb +0 -0
  517. data/test/tc/dirent.rb +0 -0
  518. data/test/tc/dirss.rb +0 -0
  519. data/test/tc/each.rb +0 -0
  520. data/test/tc/each_break.rb +0 -0
  521. data/test/tc/edf.rb +0 -0
  522. data/test/tc/empty.rb +0 -0
  523. data/test/tc/emptyriodir.rb +0 -0
  524. data/test/tc/entary.rb +0 -0
  525. data/test/tc/entsel.rb +0 -0
  526. data/test/tc/eq.rb +0 -0
  527. data/test/tc/expand_path.rb +0 -0
  528. data/test/tc/ext.rb +0 -0
  529. data/test/tc/fileno.rb +0 -0
  530. data/test/tc/files_select.rb +0 -0
  531. data/test/tc/get.rb +0 -0
  532. data/test/tc/getrec.rb +0 -0
  533. data/test/tc/gzip.rb +0 -0
  534. data/test/tc/io_each_byte.rb +0 -0
  535. data/test/tc/io_read.rb +0 -0
  536. data/test/tc/iometh.rb +0 -0
  537. data/test/tc/likeio.rb +0 -0
  538. data/test/tc/line_record_row.rb +0 -0
  539. data/test/tc/lineno.rb +0 -0
  540. data/test/tc/lines.rb +0 -0
  541. data/test/tc/misc.rb +0 -0
  542. data/test/tc/nolines.rb +0 -0
  543. data/test/tc/noqae.rb +0 -0
  544. data/test/tc/null.rb +0 -0
  545. data/test/tc/once.rb +0 -0
  546. data/test/tc/overload.rb +0 -0
  547. data/test/tc/pa.rb +0 -0
  548. data/test/tc/path_parts.rb +2 -1
  549. data/test/tc/pathop.rb +0 -0
  550. data/test/tc/paths.rb +0 -0
  551. data/test/tc/pid.rb +0 -0
  552. data/test/tc/piper.rb +0 -0
  553. data/test/tc/programs_util.rb +0 -0
  554. data/test/tc/qae.rb +0 -0
  555. data/test/tc/qae_riovar.rb +0 -0
  556. data/test/tc/readline.rb +0 -0
  557. data/test/tc/records.rb +0 -0
  558. data/test/tc/rename.rb +0 -0
  559. data/test/tc/rename_assign.rb +0 -0
  560. data/test/tc/riorl.rb +1 -1
  561. data/test/tc/route.rb +0 -0
  562. data/test/tc/selnosel.rb +0 -0
  563. data/test/tc/skip.rb +0 -0
  564. data/test/tc/skiplines.rb +0 -0
  565. data/test/tc/split.rb +0 -0
  566. data/test/tc/splitlines.rb +0 -0
  567. data/test/tc/splitpath.rb +0 -0
  568. data/test/tc/sub.rb +0 -0
  569. data/test/tc/symlink.rb +0 -0
  570. data/test/tc/symlink0.rb +56 -5
  571. data/test/tc/symlink1.rb +0 -0
  572. data/test/tc/temp.rb +0 -0
  573. data/test/tc/tempdir.rb +0 -0
  574. data/test/tc/tempfile.rb +0 -0
  575. data/test/tc/testcase.rb +0 -0
  576. data/test/tc/tonl.rb +0 -0
  577. data/test/tc/truncate.rb +0 -0
  578. data/test/tc/yaml.rb +0 -0
  579. metadata +593 -274
  580. data/doc/#RIOIS# +0 -216
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,16 @@
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>
@@ -0,0 +1,1376 @@
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>