title: Why is .gemspec using so complicated code to get the lib directory (Ruby)?
body: <p>I've tried to create a Ruby gem by doing 'bundle gem [gem_name]' and all went well (there is a main folder and inside there is lib and spec folders). In the .gemspec file I saw this:</p>
  
  <pre><code>lib = File.expand_path('../lib', __FILE__)
  </code></pre>
  
  <p>while produces an absolute path to the /lib. However, the same result can be accomplished with:</p>
  
  <pre><code>File.expand_path('lib')
  </code></pre>
  
  <p>There was some explanation in this post <a href="https://stackoverflow.com/questions/4474918/file-expand-path-gemfile-file-how-does-this-work-where-is-the-fil">File.expand_path(&quot;../../Gemfile&quot;, __FILE__) How does this work? Where is the file?</a> on how complicated the first approach is, so I was wondering, does it really have an advantage relative to the second and simpler approach?</p>