# Rake question - what is the best way to package multiple thi

**URL:** <https://www.ruby-forum.com/t/rake-question-what-is-the-best-way-to-package-multiple-thi/58220>\
**Category:** Ruby\
**Created:** [April 19, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/rake-question-what-is-the-best-way-to-package-multiple-thi/58220 "2006-04-19T18:58:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbell38](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/edb3f5/32.png) [@jbell38](https://www.ruby-forum.com/u/jbell38)\
**Post date:** [April 19, 2006, 6:58pm UTC](https://www.ruby-forum.com/t/rake-question-what-is-the-best-way-to-package-multiple-thi/58220/1 "2006-04-19T18:58:05Z")

</div>

I would like to make my Rakefile be able to create multiple packages and  
for  
these packages I need them to be created relative to a subdirectory so  
that  
the zip, tgz, and gem contain everything at the right level. See my  
example  
below.

I have considered two ways to do this but am looking for the best way.

1. change directory before packaging (but then one has to reset the  
directory and build the file lists in the right dir, etc.)
2. use multiple rake files and have the main one call them

So here is an example

foo/  
foo/bar  
foo/bar/cat.txt  
foo/baz  
foo/baz/dog.txt

I want to build something out of foo and I want to build something out  
of  
bar and baz such that the files in the zip, tgz, and gem are relative to  
bar  
or baz. So that in the gem cat.txt would be stored at the main level  
(root)  
of the bar.gem. Same thing for dog.txt it would be stored in baz gem at  
the  
root of that gem.

Or if anyone has a better idea.

Thanks,

Jeff
