Review of The Merb Way by Foy Savas
I've been reading the Merb Way by Foy Savas (Addison Wesley). I was a little sceptical about this book at first, because of the recent marriage of the Merb and Rails core teams and the announcement that the Merb codebase would be merged with Rails as part of the march towards Rails 3. As Yehuda Katz put it, "Merb 2 is Rails 3".
So, is this book now redundant? I don't think so. As Obie Fernandez explains in the foreword, knowing about Merb is still valuable as it is a fairly widely used framework, and it will probably continue to be seen in the wild for a good while after Rails 3 is released. Additionally, learning how Merb works and exploring the underpinning philosophies will aid your understanding of some of the changes happening in Rails.
The book itself is engaging and well written, and serves as a great reference guide for developing Merb applications. It's quite code-heavy, but this is by no means a criticism - Foy guides the reader through the Merb source, revealing how things are done in Merb, in order that the Ruby community can learn from it for developing our applications and future frameworks.
With under 300 pages of actual content, this is by no means a weighty tome, but it covers most things a Merb developer needs to know. Foy starts with the fundamentals, explaining how Merb apps are structured and configured, as well as providing an introduction to some of the internals of Merb. The first part of the book is concerned with routing and MVC, which will be familiar to Rails developers. It then moves onto more Merb-specific topics such as slices (self-contained mini-apps that can be packaged as gems) and parts (for reusable logic used in partials throughout your app). Sessions, authentication, and mailers are also covered, before the book concludes with a chapter on testing.