title: Canonical File Path in Ruby
body: <p>Is there an easy way in Ruby to find a canonical file path out of a messy file path?</p>
  
  <p>For example:</p>
  
  <ul>
  <li><code>a/b/../c/x</code> is the same as <code>a/c/x</code></li>
  <li><code>a/./b/c/x</code> is the same as <code>a/b/c/x</code></li>
  <li><code>a/./b/../../c/x</code> is the same as <code>c/x</code></li>
  </ul>
  
  <p>Any simple way to do this?</p>