Hello,
According to ri, Dir.glob returns false when invoked with a block:
-------------------------------------------------------------- Dir::glob
Dir.glob( string, [flags] ) => array
Dir.glob( string, [flags] ) {| filename | block } => false
------------------------------------------------------------------------
My observation is that it would be much more useful if the block form
also returned an array, consisting of each filename modified by the
block. I ran into this today and found I had to use the non-block form
with Array#collect.
Is there a good reason for this method being the way it is?
Ian
--
Ian Macdonald | You must've hit the wrong anykey.
System Administrator |
ian / caliban.org |
http://www.caliban.org |
|