a work on process

Viewing posts tagged: ruby

Practical Reporting with Ruby and Rails is primarily a book about the presentation of reports. Having gone in expecting a mixture of presentation and production techniques I was a little surprised to find that the vast majority of the reader’s time is spent looking at various GUI and graphing toolkits, export to MS Office and the like, and there’s not much space given to managing large volumes of data, warehousing, and other such topics.

That’s not a criticism of the book so much as a caution to potential readers. After a little time spent looking at ActiveRecord, particularly focussing on using its calculation methods to save processor time, David Berube provides a pretty thorough coverage of a variety of ways to present reports. A few options for delivering data as PDFs, through a GUI, or directly into office are offered and a straightforward walkthrough is provided for each. The Rails content is minimal, and while the sample code could do with some refactoring and there’d be a case for using something more lightweight like merb it does the job.

But I must confess to being a little disappointed that there wasn’t more time spent on the data processing side of the equation. Having been building a lot of graphs lately and needing to write some new reporting code in the near future it was helpful to have some analysis of tools I might use, but I never felt like the book ever really dove into the complexities of reporting. There’s space in a book of this sort for serious consideration of both data processing and of visualisation techniques, but neither is really offered. Each chapter simply answers a very tightly defined request rather than delving into the full problem domain, and that feels like a missed opportunity.

If you’re evaluating output options for your ruby application’s reporting layer, this may be a handy book to have. It’ll provide you with a sense of what tools are appropriate for which problems and more detailed sample code than is easily found on the web. But if you’re looking to really grapple with reporting and visualisation you might be better off seeking out a good SQL reference and some of Tufte’s books.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at apress, amazon US, amazon UK and all sorts of other places.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Sleeve of Design Patterns in RubyFor many the idea of bringing design patterns to ruby is a terrifying one. Having taken refuge from over-engineered java projects (or for that matter, attempts to apply java engineering approaches to a somewhat dynamic language like PHP) the baggage that often goes along with design patterns isn’t what a recent convert is looking for. But as I mentioned in my last review of a design patterns volume, and series editor Obie Fernandez highlights in his foreword, design patterns don’t have to be used that way and maintain merit when used as a source of collective experience and shared language.

Russ Olsen’s book does a good job of stepping through the key patterns from the Gang of Four’s initial offering, showing how they can be applied to and simplified with Ruby, introducing along the way various uses of blocks, mix-ins, and other powerful features of the language that may be unfamiliar to newcomers. Each chapter highlights how the pattern can be used or abused, sounding a note of caution to dissuade unthinking embrace of every pattern between its covers. It’s clearly written with a nice balance of code to prose.

Towards the end of the book a couple of “new” patterns are offered, particularly “internal DSLs”, “meta-programming” and “convention over configuration.” Opinions differ over whether of those can really be considered patterns in the general sense of the term. Certainly those concepts are examples of a community gradually refining its approaches to common problems, but at least two of them are considerably more conceptual and abstract than most of the other patterns in the book. Perhaps the best way to understand them is as giving an insight into the working patterns of the ruby community approaches problems, and pointers to topics worthy of more exploration.

That usage of the final few chapters gives some indication of the probable audience for this book. It seems best suited to those who have dabbled with ruby but don’t yet have much experience. A general sense of syntax is all you’ll need going in, but you’ll come away with a much stronger sense of the language’s features than that. Similarly it’ll work well for those with a general sense of the major patterns but who could do with a refresher, maybe while transitioning from java or other “enterprisey” development to ruby.

While it won’t have the same general appeal of other titles in the series like The Ruby Way and The Rails Way, this is a handy volume in a series that is making strong contributions to the ruby book market.

Disclaimer: I was sent a copy of this book for review by the publisher. There were a few pages missing due to a printing defect so I wan’t able to read parts of chapters 13 or 14. You can find it at amazon US, amazon UK and all sorts of other places.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Is it time to upgrade drupal yet?

27 March 2008 (11:52 am)

By James Stewart
Filed under: Notes, Snippets
Tagged: , , , , ,

Working with a number of non-profits I frequently find myself tasked with extending or upgrading drupal. Each new version of drupal has been a significant step forward and I’m usually keen to get up to date but there’s the small matter of the suite of modules most sites use that need to catch up with changing APIs. With the release of Drupal 6 a few weeks back I found myself wanting a tool that would help me check if my chosen modules were ready for the upgrade yet.

The quick solution I came up was a screen-scraper that will take a YAML file listing the relevant modules and their URLs and check to see if a Drupal 6 version has been released as yet. I wrote it in ruby, because after all that PHP work it’s nice to slip back into a language that feels so comfortable. (and hpricot is delightful for quick scraping solutions).

In case it’s helpful for anyone I’ve popped the ruby code and a sample yaml file up as pasties. Currently it’s invoked from the command line (providing you have ruby and hpricot set up) with:

./drupal-modules.rb my-file.yaml

A couple of nice enhancements would be to either grab the list of modules from an existing drupal database, or to set this up as a little web service where people input the modules they use and can check a web page or receive an email when there’s a status update. It could even lead into some discussion of where certain older modules should be considered redundant and/or replaced with newer options. Time’s not likely to let me build that, but I’d love to hear if someone else does.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

Book Review: Practical Ruby Gems

14 January 2008 (3:18 pm)

By James Stewart
Filed under: Book Reviews
Tagged: , , , , , ,

Practical Ruby Gems sleeveFor those who aren’t aware, ruby gems refers a way of packaging up code so it can be easily distributed for other developers to use, and a tool to help with the distributing and/or installing that code. Find out more at wikipedia.

On first glancing at this book, I wondered how you could fill a full-length book on the topic of gems. While getting the tools installed on some systems requires care, and there’s space for a couple of chapters on packaging your own libraries as gems, both topics have been covered alongside other topics in numerous volumes. What I’d missed was that contents not only covers both of those topics, but also looks at 26 different gems and explains how you might use them in your projects.

The coverage of setting up and using ruby gems at the start of the book, and on packaging and distributing your own gems at the end of the book are brief but cover the basics well enough. It might have been helpful had the latter included a little information on how to include other libraries that need to be compiled and managing the cross-platform issues that raises. Chances are anyone planning to do that is well capable of reverse-engineering a gem spec file to work out what’s needed, but it would have added some weight and helped these chapters stand out from their equivalents in other volumes.

The gems profiled cover a wide range of uses: databases, certain web services, parsing HTML, web frameworks, recurring events, PDF generation, and more. Most of them are pretty well known libraries, but few of us will have had a chance to try them all out and newcomers to the ruby community looking for some support in their projects may well find some useful tips within.

For each gem there is an introduction, some basic code samples, a lengthier code sample (with commentary) and conclusion. That repetition means this isn’t a book many will want to wade through in one go. I found that after a while I needed a break, and if reading the book it may be best to pick out a gem that particularly interests you, read the relevant section and then write some code of your own before moving on to another.

A number of times I wondered if it would be preferable to drop some of the best known gems (there are plenty of ActiveRecord examples floating around) in favour of a little more depth. In particular it would have been interesting to see a dissection of how a few of the gems work, as a sign that anyone can contribute, to see what can be learned from techniques used, and to better understand how the gems in question can be used. Such explorations might serve to break up the text a bit, as well as providing useful insights into ruby development and perhaps broadening the appeal of the book a little.

Overall, Practical Ruby Gems was a helpful read and there are a few new gems I’m going to be exploring as a result of my reading, but you may well want to take a close look before investing in a copy. You may broaden your ruby knowledge in the reading, but you’re unlikely to deepen it significantly.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at apress, amazon US, amazon UK and all sorts of other places.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 

book sleeve for Practical Ruby for System AdministrationIf you’ve encountered Ruby primarily through Rails and know it chiefly as an elegant tool for writing web applications it’s easy to miss its longer history as a tool for systems administration. Before Rails made Ruby the language-du-jour sysadmins bore much of the responsibility for keeping it alive, with the result that it has a suite of libraries helpful for server monitoring and a range of other administrative tasks.

Author André Ben Hamou is clear that his book is not an exhaustive guide to using Ruby for systems administration. Rather than try to cover every possible context he provides an introduction to the language and some of its key libraries intended to give a feel for how it might be used and why it leads to succinct and expressive solutions. A number of the more important libraries for working with network protocols and files are covered, and there’s a good introduction to rubygems and how they can be used and created.

Having not done much work with Ruby on the command line I found the first couple of chapters, which cover command-line switches that can help with one-liners for file processing, particularly informative, though I suspect I’ll be referring back to them for a while until the different options take hold. As with the book as a whole those chapters are clear and to-the-point, helped by a presumption that the reader has a good understanding of the problem space and some experience with using scripting languages to simplify their life.

Don’t go into this book expecting to come away ready to work as a sysadmin. That’s not its intention. Nor is it a comprehensive guide to ruby, and you’ll probably still want a good language reference to go with it. But it provides a number of helpful hints and a good sense of how robust scripts can be built quickly and simply with ruby, and there are likely to be a few helpful tricks for most readers.

Disclaimer: I was sent a copy of this book for review by the publisher. You can find it at apress, amazon US, amazon UK and all sorts of other places.

Recommend this post:

[Slashdot] [Digg] [Reddit] [del.icio.us] [Facebook] [Technorati] [Google] [StumbleUpon]

 
Next Page »