doc/rdoc/classes/RIO/Doc/HOWTO.html in rio-0.3.1 vs doc/rdoc/classes/RIO/Doc/HOWTO.html in rio-0.3.2
- old
+ new
@@ -159,11 +159,11 @@
<li>Read all lines starting with ‘require’ into an array, with each
line chomped
<pre>
# method 1
- array = ario.chomp.lines(/^\s*require/)
+ array = ario.chomp.lines[/^\s*require/]
# method 2
ario.chomp.lines(/^\s*require/) > array
</pre>
</li>
<li>Read a gzipped file into a string
@@ -264,11 +264,11 @@
# method 1
ario.puts(string)
# method 2
ario.print(string)
# method 3
- ario.noclose < string
+ ario.noautoclose < string
</pre>
</li>
<li>Write a string to a file and close the file
<pre>
@@ -286,11 +286,11 @@
# method 1
ario.a.puts(string)
# method 2
ario.a.print(string)
# method 3
- ario.noclose << string
+ ario.noautoclose << string
</pre>
</li>
<li>Append a string to a file and close the file
<pre>
@@ -307,11 +307,11 @@
<pre>
# method 1
ario = rio('afile').nocloseoncopy
ario << array
# method 2
- ario.noclose < array
+ ario.noautoclose < array
</pre>
</li>
<li>Write an array to a file and close the file
<pre>
@@ -439,15 +439,19 @@
array = ario.entries('*.txt').norecurse('.svn').to_a
# method 5
array = ario.norecurse('.svn')['*.txt']
</pre>
</li>
-<li>Iterate through all ruby files in a directory structure except those in the
-’.svn’ and ‘pkg’ directories
+<li>Iterate through ruby files in a directory and subdirectories skipping those
+in the ’.svn’, and ‘pkg’ directories
<pre>
# method 1
- ario.norecurse('.svn','pkg').files('*.rb',proc{ |f| f.executable? and f[0] =~ /^#!.+ruby/ }) { |f| ... }
+ is_ruby_exe = proc{ |f| f.executable? and f[0][0] =~ /^#!.+ruby/ }
+ ario.norecurse('.svn','pkg').files('*.rb',is_ruby_exe) { |f| ... }
+ # method 2
+ is_ruby_exe = proc{ |f| f.executable? and f.gets =~ /^#!.+ruby/ }
+ ario.norecurse('.svn','pkg').files('*.rb',is_ruby_exe) { |f| ... }
</pre>
</li>
<li>Put all files excluding those that are symlinks to files in an array
<pre>
\ No newline at end of file