title: ruby way - relative path
body: <p>I am using <code>File.read('file.txt')</code> in a ruby script. But I don't know what is the best way to create a correct relative path, I can do</p>
  
  <pre><code>File.read(File.dirname(__FILE__) + '/file.txt)
  </code></pre>
  
  <p>but I wonder if there a more beautiful way in ruby?</p>