title: Dir.glob with sort issue
body: <p>As in "<a href="https://stackoverflow.com/questions/4814340/alphabetize-results-of-dir-glob?answer-4814365">Alphabetize results of Dir.glob</a>", I use <code>sort</code> to get file list in alphabetical order:</p>
  
  <pre><code>Dir.glob("#{options[:path]}/**/*.jpg", File::FNM_CASEFOLD).sort { |file|
  
    dir, filename = file.match(/.+\/(.+)\/(.+)/).captures
  
    # ---cut---
  
  }
  </code></pre>
  
  <p>Without the <code>sort</code> it works good, but with it fails with error:</p>
  
  <pre><code>$ rake slides:import -- --user foo --path /bar/baz
  (in /home/user/app_folder)
  "baz/ - /bar/baz/DSC_4120.JPG - saved"
  rake aborted!
  ArgumentError: comparison of String with 0 failed
  /home/footoo/footoo/lib/tasks/slides.rake:41:in `&gt;'
  /home/footoo/footoo/lib/tasks/slides.rake:41:in `sort'
  /home/footoo/footoo/lib/tasks/slides.rake:41:in `block (2 levels) in &lt;top (required)&gt;'
  /usr/local/rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
  /usr/local/rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `&lt;main&gt;'
  Tasks: TOP =&gt; slides:import
  </code></pre>
  
  <p>Any idea what's wrong ?</p>
  
  <p>Full code available on <a href="https://github.com/pawel7318/footoo/blob/cc4fadcb393f18a8f26d7643a637b1822eedb4b8/lib/tasks/slides.rake" rel="nofollow noreferrer">Github</a>.</p>