[Rubygems-developers] Duplicated files in gem

Jamis Buck jgb3 at email.byu.edu
Thu Jul 1 11:38:39 EDT 2004

Forgive me in advance if this issue has already been discussed and fixed...

I'm tinkering with a new gem file for sqlite-ruby, and I'm playing with 
the rdoc stuff. It looks like when I add a file to be rdoc'd (using 
"extra_rdoc_files"), those files will be added to the packaged gem as 
well. That's a good thing. However, all the files I want to be rdoc'd 
are already being packaged in the gem (i.e., they are specified in the 
"files" property). That doesn't necessarily break anything, but it does 
make the gem file larger than it needs to be.

It seems like this could be fixed by calling #uniq! on the @files array 
in the Gem::Specification#extra_rdoc_files=(extra_rdoc_files) method:

     def extra_rdoc_files=(extra_rdoc_files)
-     @files.concat(extra_rdoc_files)
+     @files.concat(extra_rdoc_files).uniq!
       @extra_rdoc_files = extra_rdoc_files

Also, should this method append to the @extra_rdoc_files variable if it 
already contains file names, rather than replacing them?

Jamis Buck
jgb3 at email.byu.edu

ruby -ropenssl 

More information about the Rubygems-developers mailing list