title: Net::SFTP sort directory files?
body: <p>I'm currently doing the following to get a list of all the files in a directory:</p>
  
  <pre><code>Net::SFTP.start('host', 'username', :password =&gt; 'password') do |sftp|
    sftp.dir.foreach("/path") do |entry|
      puts entry.name
    end
  end
  </code></pre>
  
  <p>But that lists the files seemingly at random. I need to order the files by name.</p>
  
  <p>So, how can I sort the files by name?</p>