# Directory structure best practice?

**URL:** <https://www.ruby-forum.com/t/directory-structure-best-practice/192242>\
**Category:** Ruby\
**Created:** [July 26, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/directory-structure-best-practice/192242 "2010-07-26T21:30:51Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MrZombie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@MrZombie](https://www.ruby-forum.com/u/MrZombie)\
**Post date:** [July 26, 2010, 9:30pm UTC](https://www.ruby-forum.com/t/directory-structure-best-practice/192242/1 "2010-07-26T21:30:51Z")

</div>

Hi all!

What are the best practices concerning directory structures for Ruby  
programs?

I want to run tests using Cucumber and RSpec, so referring to the RSpec  
book I created a features/ and spec/ folders for the tests, a lib/  
folder for my code, and a bin/ folder for all that shall be executed.

What do I need to roll out my own Gem, if needed? What is the expected  
distribution format of a gem?

Also, is there a way to pack the app for distribution for Linux,  
Windows, and Mac?

---

<div class="post-metadata">

**Author:** ![MrZombie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@MrZombie](https://www.ruby-forum.com/u/MrZombie)\
**Post date:** [July 27, 2010, 8:14pm UTC](https://www.ruby-forum.com/t/directory-structure-best-practice/192242/2 "2010-07-27T20:14:29Z")

</div>

MrZombie wrote:

> Hi all!
> 
> What are the best practices concerning directory structures for Ruby  
> programs?
> 
> I want to run tests using Cucumber and RSpec, so referring to the RSpec  
> book I created a features/ and spec/ folders for the tests, a lib/  
> folder for my code, and a bin/ folder for all that shall be executed.
> 
> What do I need to roll out my own Gem, if needed? What is the expected  
> distribution format of a gem?
> 
> Also, is there a way to pack the app for distribution for Linux,  
> Windows, and Mac?

You can , if you’re feeling lazy, install a gem called “jem” which  
creates a typical structure the same as the one already mentioned.

---

<div class="post-metadata">

**Author:** ![MrZombie](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/258eb7/32.png) [@MrZombie](https://www.ruby-forum.com/u/MrZombie)\
**Post date:** [July 26, 2010, 9:59pm UTC](https://www.ruby-forum.com/t/directory-structure-best-practice/192242/3 "2010-07-26T21:59:31Z")

</div>

This should be really helpful to you:  
[http://www.jamievandyke.com/building-a-gem-using-bdd](http://www.jamievandyke.com/building-a-gem-using-bdd)

Also, look in gems you have installed.

Below here is what you asked for, typical and simple:

MyGem/  
README  
implDemo.rb  
lib/  
MyGem.rb  
MyGem/  
gemthis.rb  
gemthat.rb  
test/  
unit.rb
