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.
Frommer's New Orleans 2011 (Frommer's Complete Guides)
New Orleans should come with a warning label. No,
no, not about hurricanes. Forget that. That’s like
solely identifying San Francisco and Los Angeles
with earthquakes. No, this is about the city itself. See,
there’s this group of residents whom locals call the “never
lefts.” They are the people who... Windows 8 For Dummies
The bestselling tech book of all time, now updated for Windows 8
Microsoft Windows is the operating system that runs nearly 90 percent of the world's computers. Windows 8 will offer new interface updates, cloud-based services, and much more. This update of Andy Rathbone's bestselling Windows guide covers all the...
Credit Risk Modeling using Excel and VBA (The Wiley Finance Series) In today's increasingly competitive financial world, successful risk management, portfolio management, and financial structuring demand more than up-to-date financial know-how. They also call for quantitative expertise, including the ability to effectively apply mathematical modeling tools and techniques, in this case credit.
Bricklin on Technology In a world that divides us, technology creates connection. Cell phones, e-mail, digital cameras, personal Web sites—they all join us, however tenuously, to what we value. Is connectivity what we’re willing to pay for? Should technology be our servant or a tool that helps us do other things? What can we really learn from Napster? What...