# My first gem

**URL:** <https://www.ruby-forum.com/t/my-first-gem/193681>\
**Category:** Rails\
**Created:** [August 22, 2010, 1:34am UTC](https://www.ruby-forum.com/t/my-first-gem/193681 "2010-08-22T01:34:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PsiPro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ba8739/32.png) [@PsiPro](https://www.ruby-forum.com/u/PsiPro)\
**Post date:** [August 22, 2010, 1:34am UTC](https://www.ruby-forum.com/t/my-first-gem/193681/1 "2010-08-22T01:34:10Z")

</div>

Hello all,

I just published my first gem, I’ve extracted it out from a project  
I’m working on and just hope it would be useful to others, and get  
some community improvment/suggestions.

The code is located on github here [http://github.com/arjes/Cache-Column](http://github.com/arjes/Cache-Column)

Hopefully the README has enough details show what my inevitable goal  
was.

I have a few questions that I found poorly answered via google  
searches.

1. Whats the best/most accepted way to document the functions in the  
gem.

2. Whats the best way to write tests for the gem. Right now I have a  
test app since I usually use cucumber

Thanks for your time,  
Brian

---

<div class="post-metadata">

**Author:** ![PsiPro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ba8739/32.png) [@PsiPro](https://www.ruby-forum.com/u/PsiPro)\
**Post date:** [August 22, 2010, 2:39pm UTC](https://www.ruby-forum.com/t/my-first-gem/193681/2 "2010-08-22T14:39:29Z")

</div>

Hi Brian,

On Sat, Aug 21, 2010 at 6:33 PM, PsiPro [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello all,
> 
> I just published my first gem, I’ve extracted it out from a project  
> I’m working on and just hope it would be useful to others, and get  
> some community improvment/suggestions.

Congratulations!

> The code is located on github here [http://github.com/arjes/Cache-Column](http://github.com/arjes/Cache-Column)
> 
> Hopefully the README has enough details show what my inevitable goal  
> was.
> 
> I have a few questions that I found poorly answered via google  
> searches.
> 
> 1. Whats the best/most accepted way to document the functions in the  
> gem.

Rdoc

> 1. Whats the best way to write tests for the gem. Right now I have a  
> test app since I usually use cucumber

Test::Unit

Best regards,  
Bill

---

<div class="post-metadata">

**Author:** ![PsiPro](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/ba8739/32.png) [@PsiPro](https://www.ruby-forum.com/u/PsiPro)\
**Post date:** [August 23, 2010, 10:55am UTC](https://www.ruby-forum.com/t/my-first-gem/193681/3 "2010-08-23T10:55:15Z")

</div>

2010/8/22 PsiPro [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

> 

I visited your repository. I have already installed cache-column, and I  
would like to experiment with it. Congratulations!!![?][?][?]

> I have a few questions that I found poorly answered via google  
> searches.
> 
> 1. Whats the best/most accepted way to document the functions in the  
> gem.

Let me agree with Bill that RDoc is your friend. Most gems, if not all  
use  
it. So it has become not only an easy-to-use solution but also the  
standard  
way of documenting methods even within your “own” application.

I hope these links may be of benefit to you:

- [http://www.rubyfleebie.com/an-introduction-to-rdoc/](http://www.rubyfleebie.com/an-introduction-to-rdoc/)
- [http://stdlib.rubyonrails.org/](http://stdlib.rubyonrails.org/)

> 1. Whats the best way to write tests for the gem. Right now I have a  
> test app since I usually use cucumber
> 
> As Bill said, TEST::Unit is also your friend. It is easy to use, and “in  
> most cases” you may not need extra gems to be installed for you to run  
> Test::Unit. Cucumber is best suited for behavioural driven development.  
> i.e.  
> you are more interested in defining how your application should behave.  
> I’m  
> not saying Cucumber is bad. It nice when you are trying to create an  
> application from a “bird’s eye view”.In addition, it is “documentation”  
> oriented. You exploit most of its powers when you are trying to high  
> level  
> documentation. Myself, I use Cucumber Features mainly as tools for  
> bridging  
> myself (a developer) to the users/clients, but not necessarily for “unit  
> testing” of methods.

* * *

Edmond  
Software Developer | Baobab Health Trust ([http://www.baobabhealth.org/](http://www.baobabhealth.org/))  
|Malawi

Cell: +265 999 465 137 | +265 881 234 717  
Skype: ceekays

_“Many people doubt open source software and probably donâ€™t realize that  
there is an alternativeâ€¦ which is just as good…” – Kevin Scannell_
