Skip to content
Source Code for Programming Ruby (2nd edition)
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

Source Code for Programming Ruby (2nd edition)

Build Status

This is a collection of Ruby scripts from the "Programming Ruby" book. This might be the single biggest collection of Ruby scripts around, since it's 1600+ scripts in one archive. Each script seems to be self-contained, and is thus good for testing and education. Some of them try to run Tk programs, so not everything is runnable on server such as Travis without taking more effort (submit patches for headless X11!)

I have written a simple infrastructure for running all of the tests together, as an experiment with Ruby and Travis. I wanted to use the scripts to see how much stuff I can run in Ruby's 1.8, 1.9, 2.x as well as to see whether differences between Ruby and Rubinius exist.

How to run



By default ruby interpreter is invoked in the 'syntax check only' mode for each of the scripts. If you want to run all the scripts, use:

make MODE=run

Which will cause the scripts to be run. Be careful, as the local directory will be populated with all sorts of output files.

Because some scripts expect to read stuff from the standard output, I made all scripts to get input from data/stdin_data.i for convenience.


Look at for src/ copyright. Everything else is BSDv2 license.

Bitdeli Badge


You can’t perform that action at this time.