As Ruby pro David Copeland explains, writing a command-line application that is self-documenting, robust, adaptable and forever useful is easier than you might think. Ruby is particularly suited to this task, since it combines high-level abstractions with "close to the metal" system interaction wrapped up in a concise, readable syntax. Moreover, Ruby has the support of a rich ecosystem of open-source tools and libraries.
Ten insightful chapters each explain and demonstrate a command-line best practice. You'll see how to use these tools to elevate the lowliest automation script to a maintainable, polished application.
You'll learn how to use free, open source parsers to create user-friendly command-line interfaces as well as command suites. You'll see how to use defaults to keep options simple for everyday users, while giving advanced users options for more complex tasks.
There's no reason a command-line application should lack documentation, whether it's part of a help command or a man page; you'll find out when and how to use both. Your journey from command-line novice to pro ends with a look at valuable approaches to testing your apps, and includes some fun techniques for outside-the-box, colorful interfaces that will delight your users.
With Ruby, the command line is not dead. Long live the command line.
What You Need:
All you'll need is Ruby, and the ability to install a few gems along the way. Examples written for Ruby 1.9.2, but 1.8.7 should work just as well.
Structural Analysis with Finite Elements
Structural Analysis with Finite Elements, 2nd Edition provides a solid introduction to the foundation and the application of the finite element method in structural analysis. It offers new theoretical insight and practical advice on why finite element results are 'wrong,' why support reactions are relatively accurate, why stresses at...
Microsoft Windows PowerShell 2.0 Programming for the Absolute Beginner
Microsoft? Windows? PowerShell is a helpful scripting technology that enables the automation of system management tasks and the creation of system management tools. PowerShell runs on Windows XP, 2003, 2008, and Vista. Unlike traditional Windows shell scripting, PowerShell scripting is object-based and is designed to work with the .NET...
Graphics of Large Datasets: Visualizing a Million (Statistics and Computing) Graphics are great for exploring data, but how can they be used for looking at the large datasets that are commonplace to-day? This book shows how to look at ways of visualizing large datasets, whether large in numbers of cases or large in numbers of variables or large in both. Data visualization is useful for data cleaning, exploring data,...
New Algorithms, Architectures and Applications for Reconfigurable Computing New Algorithms, Architectures and Applications for Reconfigurable Computing consists of a collection of contributions from the authors of some of the best papers from the Field Programmable Logic conference (FPL’03) and the Design and Test Europe conference (DATE’03). In all, seventy-nine authors, from research teams from all... NHibernate 3.0 Cookbook
NHibernate is an innovative, flexible, scalable, and feature-complete open source project for data access. Although it sounds like an easy task to build and maintain database applications, it can be challenging to get beyond the basics and develop applications that meet your needs perfectly.
The NHibernate Cookbook explains each...