Chapter 4Play Well with Others

In the previous two chapters, we learned how to write command-line applications that are easy to use and self-documenting. Such apps get their input via sophisticated and easy-to-create command-line interfaces and provide help text and documentation that let users get up to speed quickly. But the user at a terminal is only part of the story. Our app will be used by other apps, possibly even integrated into a sophisticated system. db_backup.rb is an example. We will probably want to run our database app nightly and we won’t want to log into our server at midnight to do it, so we’ll arrange for another app (such as cron) to run it for us. The fact is, we don’t know who will run our app or how it will be run. What ...

Get Build Awesome Command-Line Applications in Ruby 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.