SAMS Teach Yourself Ruby in 21 DaysNumbered source listings

Source code is available here for numbered listings, such as Listing 13.3 which is printed on page 279.  Code that is not assigned a listing number, such as the FIFO/Stack example on page 62, is not available in electronic form.  Unlabeled material is common in the first half of the book, since most code there is in conversational snippet form; the substantial scripts are found mostly in the second half of the book.

Listings may be downloaded below in either zipped or tar/gzipped format.  When you have unpacked the archive, you will find the source files arranged in separate folders by chapter; so for example, Listing 14.1 is found as ty_ruby_21_listings/14/1.  Some of these files will have to be copied or renamed before you can use them, for example, Listing 12.4 is used by Listing 12.3, which expects it to be named peg.rb.

All files have DOS-style line termination (CRLF) for the convenience of Windows users.

These listings should be identical to their counterparts in the book, except to fix errata that are listed on the misprints page.  Reports of other discrepancies are welcome. (email here)


Back