tags:

views:

42

answers:

3

Hello,

The Ruby (and RoR) community publishes a large number of gems. But more often than not using these gems requires a good amount of effort, specially if one is new to Ruby. It would to be nice if Ruby experts (rockstars) share the best approaches to utilize inadequately documented gems.

Thanks --arsh

+3  A: 

As my manager likes to say:

The truth is in the code.

Francisco Soto
The truth may also be found in the tests/specs/scenarios."Use the source, Luke"
Bryan Ash
going through the specs do help a ot!
Arshad Syed
+2  A: 
  1. Look for examples of how others have used it, and modify as necessary.

    • There are frequently example directories in gems
    • Search the internet, people like to put this stuff in blogs
  2. Read the docs.

    • Maybe posted on github
    • Frequently a link from the rubygems page
    • If installed as a gem, you can host your own server with $ gem server then go to localhost:8808 to get a list of all your installed gems, and you click the one you are interested in to see its documentation.
  3. Look for tutorials that cover the gem

    • Railscasts are great for this
    • Many gems will have a wiki on github
    • Many of the more useful / cool / fun gems will be talked about in different books. You can get a lot of tutorials about how to deal with a given gem by getting a book that uses that gem to do something. The downside of this is that these kinds of books tend to go out of date pretty quickly.
  4. Look at the code

    • If the code base is small, or you have a specific question about how something works, or want the truly definitive source, go check out the code.
    • If the code is installed as a gem, you can type $ gem environment and it will tell you your rubygems dir. Go there, cd into the gem you are interested in, check out its code in the lib directory.
  5. Ask a mailing list

    • If a gem or project is large enough, it will have its own mailing list. You can usually find these by going to its homepage or reading its readme.
    • If not, try asking about the gem on the Ruby or the Ruby on Rails mailing lists.
Joshua Cheek
A: 

You can always give your own gems a rockstar promotion. Vimeo: Zombie-chaser version 0.1: Mutation testing ... with zombies!

Andrew Grimm