Sunday, May 13, 2007

Book Review - Everyday Scripting With Ruby: For Teams, Testers And You by Brian Marick

by T. Michael Testi (Blogcritics.org , PhotographyToday, ATAEE)

Everyday Scripting With Ruby is a book that is geared toward the computer user who is not afraid to scale new heights to try to improve their skills. The premise is that people who use computers routinely do many repetitive tasks that would be better offloaded for a computer to do. Often they think that programming it themselves is too hard, and they cannot justify hiring someone to write a program to handle their menial tasks. Using the Ruby language, anyone who is comfortable with a computer can now learn automate these tasks with a little training.

Ruby is an object-oriented scripting language that originated from Japan. It takes some of the best features from some of the best languages and combines them to make a simple and easy to use yet powerful system for processing tasks. It is freely available as open source software and is available on many platforms including Windows, Mac OS X and Linux.

Everyday Scripting With Ruby targets three audiences. First the "Tester," the person who is involved with the development of software but thinks that programming is too hard. The second target audience is the "Analyst" or someone who manipulates a lot of data. With Ruby scripts, they can automate mundane tasks and free up more time for more rewarding things. Finally, this book is for the programmer who hates to use complex programming languages to accomplish these smaller tasks.

The book is divided into an introduction and five sections. The introduction and getting started section is an overview of what will be accomplished and the best method for success. It will also provides assistance for installing Ruby on a computer and making sure that everything is running correctly. The next sections build four separate projects with the purpose of enhancing the reader's skills and building his or her knowledge of Ruby.

"The Basics" is a project that will teach the reader how to create a system to compare two text file "inventories." The reader is given an old file and then needs to create a new file. The goal is to create a dynamic script, that when run, will note changes in the two files. While the program is somewhat trivial, it teaches a lot of important concepts within the Ruby language without getting bogged down on a complex project. The techniques would be handy for automatically comparing differences in many other files such as logs.

"Growing a Script" is about creating project that "reaches out to a version control system"; in this case the VCS is Subversion, an open source product that saves its files in text. While this would not work for the VCS that I use, it does a fine job of teaching the reader how to manipulate text files.

"Working in a World Full of People" introduces the reader to Ruby's power of Screen Scraping. That is, visiting a website and scraping the data and putting it into a comma separated value file (CSV) that can be used by a spreadsheet or to import into a preferred database program. The programmer can get into some real meaty issues of file manipulation and the use of regular expressions to parse data.

"The Accomplished Scripter" works on a project called "Watchdog" that monitors long running tests and programs. It will teach the reader how to install and configure Watchdog. In this project the reader will be learning how to work with frameworks and modify code to manipulated for custom uses. The project teaches the reader how to send text to instant messengers or email with the status of a project. Here the reader learns how to handle inheritance, working with superclass' as well as subclasses.

"The Back of the Book" contains the glossary, solutions to exercises, and the bibliography.

Everyday Scripting With Ruby is a well written introduction to the Ruby language. While it may be too simple for an experienced Ruby developer, an experienced programmer coming to Ruby would find it easy to read and a good place to learn Ruby incrementally. Some one who is not a programmer by avocation, but enjoys mucking around a computer, will find it a wonderful treat!

No comments: