tag:help.rubygems.org,2010-01-19:/discussions/questions/40-gemspec-example-on-httpdocsrubygemsorgreadchapter20filesRubyGems.org: Discussion 2011-04-07T20:59:31Ztag:help.rubygems.org,2010-01-19:Comment/25757542010-08-14T08:09:18Z2010-08-14T08:09:19Zgemspec example on http://docs.rubygems.org/read/chapter/20#files<div><p>Hi,</p>
<p>I just ran into problems with a gemspec that is very similar to what can be found here:<br />
<a href="http://docs.rubygems.org/read/chapter/20#files">http://docs.rubygems.org/read/chapter/20#files</a><br />
</p>
<pre><code>spec.files = Dir['lib/**/*.rb'] + Dir['bin/*']
spec.files << Dir['[A-Z]*'] + Dir['test/**/*']</code></pre>
<p>The code I was working with was:<br />
</p>
<pre><code>s.files = %w[LICENSE README.textile Rakefile SYNTAX_REFERENCE greencloth.gemspec]`
s.files << Dir['lib/*.rb'] + Dir['test/*.rb']`</code></pre>
<p>The last line would add an array as the last item of the array which would then be removed. I was able to work around this by using<br />
<code>+=</code> instead of <code><<</code>. I am not sure this is an issue just for me but it feels like the documentation is suggesting sth. that does not work here.</p>
<p>I am using rubygems 1.3.6</p></div>Azultag:help.rubygems.org,2010-01-19:Comment/25757542010-08-14T16:21:27Z2010-08-14T16:21:27Zgemspec example on http://docs.rubygems.org/read/chapter/20#files<div><p>Yeah, that's a pretty crappy example...a lot of the RG docs need to be revisited. Thanks for pointing this out.</p></div>Nick Quarantotag:help.rubygems.org,2010-01-19:Comment/25757542010-08-14T18:53:45Z2010-08-14T18:53:45Zgemspec example on http://docs.rubygems.org/read/chapter/20#files<div><p>Azul, I've updated the example to use <code>+=</code> instead of <code><<</code>. Thanks!</p></div>Josh Nichols