# "Support Files" in Rubygems

**URL:** https://rubytalk.org/t/support-files-in-rubygems/35442
**Category:** ruby-talk
**Created:** [16 February 2007 20:40 UTC](https://rubytalk.org/t/support-files-in-rubygems/35442 "2007-02-16T20:40:06Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![Manuel\_Holtgrewe](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Manuel\_Holtgrewe](https://rubytalk.org/u/Manuel_Holtgrewe)
#### Post date: [16 February 2007 20:40 UTC](https://rubytalk.org/t/support-files-in-rubygems/35442/1 "2007-02-16T20:40:06Z")

</div>

Hi

Is it possible to include files in rubygems that are neither .rb nor  
documentation files? I would like to publish Mozilla's cacert.pem in  
my gem but seemingly, rubygems does not include the pem file in the  
build gem.

You can find the Rakefile used to build the gem here:

&nbsp;&nbsp;[http://preview.tinyurl.com/yrce7b](http://preview.tinyurl.com/yrce7b)

Thanks in advance,

Manuel Holtgrewe

---

<div class="post-metadata">

### Author: ![Austin\_Ziegler5](https://yyz1.discourse-cdn.com/flex029/user_avatar/rubytalk.org/austin_ziegler5/32/1985_2.png) [@Austin\_Ziegler5](https://rubytalk.org/u/Austin_Ziegler5)
#### Post date: [16 February 2007 20:43 UTC](https://rubytalk.org/t/support-files-in-rubygems/35442/2 "2007-02-16T20:43:40Z")

</div>

Yes. See PDF::Writer and various others for how to do this.

RubyGems doesn't really care what you include; it just wants you to  
enumerate it.

-austin

> **···**
>
> On 2/16/07, Manuel Holtgrewe \<zyklenfrei@googlemail.com\> wrote:
> 
> > Is it possible to include files in rubygems that are neither .rb nor  
> > documentation files? I would like to publish Mozilla's cacert.pem in  
> > my gem but seemingly, rubygems does not include the pem file in the  
> > build gem.
> > 
> > You can find the Rakefile used to build the gem here:
> > 
> > &nbsp;&nbsp;[http://preview.tinyurl.com/yrce7b](http://preview.tinyurl.com/yrce7b)
> > 
> > Thanks in advance,
> 
> --  
> Austin Ziegler \* halostatue@gmail.com \* [http://www.halostatue.ca/](http://www.halostatue.ca/)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\* austin@halostatue.ca \* [You are in a maze of twisty little passages, all alike. // halo • statue](http://www.halostatue.ca/feed/)  
> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\* austin@zieglers.ca

---

<div class="post-metadata">

### Author: ![Jeremy\_Hinegardner](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jeremy\_Hinegardner](https://rubytalk.org/u/Jeremy_Hinegardner)
#### Post date: [16 February 2007 21:05 UTC](https://rubytalk.org/t/support-files-in-rubygems/35442/3 "2007-02-16T21:05:23Z")

</div>

Feel free to take a look at the Rakefile for keybox, I have a 'data'  
directory that gets included. FileList is your friend.

Here's a patch to google4r HEAD that I think does what you want.

You'll probably want to take advantage of spec.rdoc\_options to make sure  
that when the rdoc is generated from the gem that your 'README' is the  
main document.

Something like :

&nbsp;&nbsp;&nbsp;&nbsp;spec.rdoc\_options = ["--line-numbers",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"--inline-source",  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"--main","README"]

You can also add a task :debug\_gem (from hoe) which can help debug  
issues.

&nbsp;&nbsp;&nbsp;&nbsp;task :debug\_gem do  
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;puts spec.to\_ruby  
&nbsp;&nbsp;&nbsp;&nbsp;end

enjoy,

-jeremy

[google4r\_file\_list.patch](https://rubytalk.org/uploads/short-url/71NpqjT5uvhv4ZsO7wgyS4HoEoK.patch) (1.52 KB)

> **···**
>
> On Sat, Feb 17, 2007 at 05:40:06AM +0900, Manuel Holtgrewe wrote:
> 
> > Hi
> > 
> > Is it possible to include files in rubygems that are neither .rb nor  
> > documentation files? I would like to publish Mozilla's cacert.pem in  
> > my gem but seemingly, rubygems does not include the pem file in the  
> > build gem.
> > 
> > You can find the Rakefile used to build the gem here:
> > 
> > &nbsp;&nbsp;[http://preview.tinyurl.com/yrce7b](http://preview.tinyurl.com/yrce7b)
> 
> # --
> 
> Jeremy Hinegardner jeremy@hinegardner.org

---

<div class="post-metadata">

### Author: ![Eric\_Hodel1](https://avatars.discourse-cdn.com/v4/letter/e/a9adbd/32.png) [@Eric\_Hodel1](https://rubytalk.org/u/Eric_Hodel1)
#### Post date: [16 February 2007 21:12 UTC](https://rubytalk.org/t/support-files-in-rubygems/35442/4 "2007-02-16T21:12:02Z")

</div>

Or you could just use Hoe and let somebody else (me) take care of these things.

> **···**
>
> On Feb 16, 2007, at 13:05, Jeremy Hinegardner wrote:
> 
> > You'll probably want to take advantage of spec.rdoc\_options to make sure  
> > that when the rdoc is generated from the gem that your 'README' is the  
> > main document.
> > 
> > You can also add a task :debug\_gem (from hoe) which can help debug  
> > issues.

---

<div class="post-metadata">

### Author: ![Jeremy\_Hinegardner](https://avatars.discourse-cdn.com/v4/letter/j/65b543/32.png) [@Jeremy\_Hinegardner](https://rubytalk.org/u/Jeremy_Hinegardner)
#### Post date: [16 February 2007 21:26 UTC](https://rubytalk.org/t/support-files-in-rubygems/35442/5 "2007-02-16T21:26:16Z")

</div>

Yup, that would work too, hoe makes the common stuff pretty easy, and  
your publication to rubyforge and announcements and such.

-jeremy

> **···**
>
> On Sat, Feb 17, 2007 at 06:12:02AM +0900, Eric Hodel wrote:
> 
> > On Feb 16, 2007, at 13:05, Jeremy Hinegardner wrote:
> > 
> > \>You'll probably want to take advantage of spec.rdoc\_options to make  
> > \>sure  
> > \>that when the rdoc is generated from the gem that your 'README' is the  
> > \>main document.  
> > \>  
> > \>You can also add a task :debug\_gem (from hoe) which can help debug  
> > \>issues.
> > 
> > Or you could just use Hoe and let somebody else (me) take care of  
> > these things.
> 
> # --
> 
> Jeremy Hinegardner jeremy@hinegardner.org

---

<div class="post-metadata">

### Author: ![Manuel\_Holtgrewe](https://avatars.discourse-cdn.com/v4/letter/m/7cd45c/32.png) [@Manuel\_Holtgrewe](https://rubytalk.org/u/Manuel_Holtgrewe)
#### Post date: [17 February 2007 00:40 UTC](https://rubytalk.org/t/support-files-in-rubygems/35442/6 "2007-02-17T00:40:14Z")

</div>

Hi

Thank you all for your kind suggestions - they all solve my problem =)

I will certainly have a look at Hoe since it seems to be what I am  
trying to duplicate (although I could not find much documentation on  
it on the net).

Kind Regards,

Manuel
