On Mar 3, 2011, at 2:05 AM, Adam Prescott wrote:

> On Thu, Mar 3, 2011 at 1:03 AM, Adam Prescott <mentionuse / gmail.com> =
wrote:
>=20
>> Dir.entries(dir)[2..-1].reject { |e| e =3D=3D ".svn" }
>>=20
>=20
> And of course I forgot the .sort :)
>=20
> Dir.entries(dir).sort[2..-1].reject { |e| e =3D=3D ".svn" }

2..-1 is not correct. It's mostly correct, but what if valid files with=20=

name.ord < ".".ord (String#ord ruby19) exists?
p.e.

[sz@suessapfel:/tmp/foo]$ irb
irb:0> FileUtils.touch '-r'
=3D> ["-r"]
irb:0> Dir.entries(".").sort[-1..2]
=3D> [".."]
irb:0> ^D[sz@suessapfel:/tmp/foo]$ l
total 0
-rw-------   1 sz       wheel     0B Mar  3 15:30 -r
drwx------   3 sz       wheel   102B Mar  3 15:30 ./
drwxrwxrwt@ 11 root     wheel   374B Mar  3 15:30 ../


All the best, Sandor Sz=FCcs
--