From: Austin Ziegler Date: 2004-08-09T00:00:23+09:00 Subject: Issue with Dir.glob documentation I noticed this because I'm working on some stuff and needed to do an "ri Dir.[]", which of course led me to "ri Dir.glob". Dir.glob is, unfortunately, incomplete, in that it doesn't talk about the recursive ("**") globbing capabilities of Dir at all. All of my Ruby projects (and a few other things that aren't yet there) are in "C:\home\Projects". If I do, from this directory: a = Dir["**/*.rb"] b = Dir["**/lib"] c = Dir["**/lib/**/*.rb"] d = Dir["**/lib/*.rb"] a.size # => 823 b.size # => 39 c.size # => 437 d.size # => 19 a[0..2] # => ["diff/install.rb", "diff/lib/diff/lcs.rb", "diff/lib/diff/lcs/array.rb"] b[0..2] # => ["diff/lib", "diff/[sources]/Text-Diff-0.35/lib", "diff/[sources]/Text-ParagaphDiff/lib"] c[0..2] # => ["diff/lib/diff/lcs.rb", "diff/lib/diff/lcs/array.rb", "diff/lib/diff/lcs/block.rb"] d[0..2] # => ["pdf-writer/lib/pdf.rb", "pdf-writer/[sources]/lib/pdf.rb", "pdf-writer/[sources]/ruby-pdf2/lib/pdf.rb"] I'm attaching a documentation patch for dir.c (from the stable snapshot) that would include this information. It also completes the File.fnmatch and Dir.glob documentation to include the allowed patterns. Note as well that the {p,q} form for File.fnmatch is not implemented on either 1.8.2 or 1.9.0, but it is implemented for Dir.glob. It would be good to see this in Ruby 1.8.2. Dave, I know that content changes are closed for pickaxe2, but this may be of value in any case, and I hope you can manage to put this in. -austin -- Austin Ziegler * halostatue@gmail.com * Alternate: austin@halostatue.ca