Source code from the book Eloquent Ruby
Ruby Other
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
01 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
02 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
03 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
04 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
05 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
06 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
07 Remove and ignore generated files. Jan 12, 2017
08 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
09 Remove and ignore generated files. Jan 12, 2017
10 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
11 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
12 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
13 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
14 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
15 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
16 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
17 Sync up with new Enumerator API. Jan 12, 2017
18 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
19 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
20 Generated file. Jan 12, 2017
21 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
22 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
23 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
24 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
25 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
26 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
27 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
28 Remove and ignore generated files. Jan 12, 2017
29 Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
code Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
utils Add irb task for debugging. Jan 12, 2017
.gitignore Remove and ignore generated files. Jan 12, 2017
Gemfile Add test-unit because it is now a separate gem. Jan 12, 2017
Gemfile.lock Add test-unit because it is now a separate gem. Jan 12, 2017
README Note that code runs with version 2.3.3. Jan 12, 2017
Rakefile Updated to work with late model Ruby, a few changes to gems Jun 21, 2013
rvmrc.example Updated to work with late model Ruby, a few changes to gems Jun 21, 2013

README

Eloquent Ruby Source Code
=========================

This is the source code from Russ Olsen's book Eloquent Ruby.
In this repo you will find all of the source code from the
book, organized by chapters.

The code has been updated and tested with Ruby 2.3.3p222.

Because the code here was written to be included in a book,
it is organized a little differently than the garden variety
Ruby project:

* The code for each chapter is in a directory whose name
corresponds to that chapter. Thus the code for Chapter 7
is in a directory named `07`.

* In each chapter directory you will find one or more *_spec.rb
files. These are rspec file (See Chapter 9) which drive execution
of the code. To run all of the examples, make your current directory
the very top of the repo and run `rake`. To run the code in an
individual directory, `cd` into that directory and run `rake`.
To run an individual spec file, `cd` to the appropriate directory
and run:

    rspec -I . <the file>


* Note that the `Rakefile`s run `rspec` over and over, once
for each spec file. This is generally *not* what you would
do in a normal Ruby project - normally you would run everything
in a directory in one swoop: `rspec .`. The thing is that many
of the examples from the book will construct a class and then
change it and then change it again. This is great for explaining
but means that you have to carefully isolate each example.