Subject: Re: Add files to array matching pattern
From: Leon Bogaert <leon tim-online.nl>
Date: Fri, 5 Oct 2007 08:35:34 +0900
References: 272638272641
In-reply-to: 272641
This would work:
i = 0; dir = "/home/leon/"; test = Array.new; test =
Dir.new(dir).entries.map! { |x| x =~ /filezilla$/ ? x : next };
test.compact
Is the .compact needed? Can't I get rid of that?
--
Posted via http://www.ruby-forum.com/.