title: Check if there is any file or directory matching pattern using ruby
body: <p>I want to check if pattern with wildcards, e.g. <code>/var/data/**/*.xml</code> is matching to any file or directory on the disk.</p>
  
  <p>Obviously I could use <code>Dir.glob</code> but it is very slow when there are millions of files because it is too eager - it returns all files matching the pattern while I only need to know if there is any.</p>
  
  <p>Is there any way I could check that?</p>