title: Dir globbing not recursing fully
body: <pre><code>files = Dir[File.join(path, '**', '*.jpg')].each do |s| 
      puts s       
  end
  </code></pre>
  
  <p>I have a bunch of subfolders within a directory and this snippet seems to go into some of the subdirectories, but skips most of them. How can I make it so that it recurses into all directories?</p>
  
  <p>Also, should I be using <code>Find</code> instead? If so, could someone provide an example that does the same as above, namely finding .jpgs in all subdirectories? </p>
  
  <p><strong>EDIT -</strong></p>
  
  <p>Ok, so apparently when I do it with <code>.JPG</code> (capitalized) it finds all the files. Strange... How can I tell to find either of them?</p>