# File lib/FileCache.rb, line 94 def random_file_system_image(collection_type=nil) all_image_urls=file_system_image_urls_in_cache all_image_urls.length.times do begin index=rand(all_image_urls.length) image=get_file_system_image(all_image_urls[index%all_image_urls.length]) return image if ((collection_type==nil) || (image.send(collection_type).length>0)) rescue #silently swallow any exception end end raise 'no suitable image found in cache' end