Summary

We've had a taste today of the powerful things that can be done when your scripts control the environment around them. Here's a brief recap.

The hash-like ENV object and the methods of File, Dir, and Find all provide a script with information about the situation within which it operates. Ruby scripts can run external programs either sequentially, optionally capturing their output for later use, or in parallel; they can also split themselves into separate processes. Processes running at the same time can communicate through IO objects called pipes, which are either created implicitly by IO.popen or explicitly by IO.pipe. Parent processes can and should keep track of what their children are doing. They can communicate with children not ...

Get Sams Teach Yourself Ruby in 21 Days 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.