zerosum dirt(nap)

evolution through a series of accidents

zerosum dirt(nap)

Book Review: Practical Ruby Gems

November 17, 2007 by nap · Comments

I’ve been meaning to start posting book reviews for some time now. I don’t really have a good excuse as to why I haven’t, so I’ll spare you the overly verbose excuses and get right to the good stuff.

The first book in my stack is David Berube’s Practical Ruby Gems. Before diving into it I should note that Dave is a friend of mine and that I’m currently working on a book with him for Apress. My opinions here are, of course, my own.

Practical Ruby Gems is a survey book, covering a number of 3rd party Ruby libraries as well as general usage of the Gems system itself. Although it’s a bit short on details in some places, the breadth over depth approach is really quite useful in that the book will doubtlessly introduce you to some libraries that you weren’t aware of before. This is particularly true if the majority of your Ruby experience has been within the context of Rails. A number of the chapters do make use of Rails (hey, it is a Gem after all), a few use the Camping web framework, but the majority of the examples are constructed as simple command line utilities.

The more popular Gems, such as hrpicot and rmagick are of course covered here, but the real (ahem) gems are the lesser known libraries such as multi, memoize, runt and cmdparse. Dave’s examples cover a wide variety of topics and use each Gem in an interesting way, going beyond the rdocs to show you how to combine and use these libraries in real applications. Using Fxruby and the YahooFinance Gem to create a graphical stock ticker is a good example of this. Another example is an RSS news archiving service built using ActiveRecord and FeedTools. Both practical and well-dissected in the text, this sort of thing is sure to help new Ruby developers grasp the concepts for re-use in their own developments.

The chapters on creating and distributing gems (with Rubyforge, gem_server, etc) are short and to the point. The one omission, from my point of view, is that Dr Nic’s New Gem Generator isn’t mentioned as a resource for bootstrapping gem structure. This is an invaluable tool for creating new gems.

In any case, if you’re looking to broaden your Ruby tool belt, Practical Ruby Gems is sure to give you exposure to a few new tools. It would be a particularly good ‘bridge book’ for Rails developers who are looking to explore the world of Ruby possibilities outside of the web framework.

blog comments powered by Disqus