From: Stefano Crocco Date: 2007-08-23T05:31:02+09:00 Subject: Re: how to be cool with map Alle mercoled� 22 agosto 2007, Erik Veenstra ha scritto: > Faster, because it breaks the loop as soon as possible, and > less LOC: > > def check > for_every_app.values.find do |app_info| > not File.exists?(app_info[:root]) > end ? false : true > end > > You may want to skip the "? false : true" part, but that breaks > the encapsulation. > > gegroet, > Erik V. - http://www.erikveen.dds.nl/ This is shorter, and breaks as soon as a non-existing file is found def check !for_every_app.values.any?{|f| !File.exist?(f)} end Stefano