small medium large xlarge

Errata for Everyday Scripting with Ruby

 

The latest version of the book is P1.0, released about 9 years ago. If you've bought a PDF of the book and would like to upgrade it to this version (for free), visit your home page.

By default this page displays the errata for the latest version of the book. If you have a previous version, select it here:

If you've found a new error, please submit it.

  • Typo
  • Tech. error
  • Suggestion
  • Maybe next edition
  • Not a problem
  • Reported in: P1.0 (30-Mar-10)
#42579
PDF page: all
I now realize that most of the examples as published are no longer current. It would have been helpful to note this on the website and alerting folks...more...
  • Reported in: P1.0 (04-Feb-07)
#26932
PDF page: 0

Download section on the website refers to "Scripting for Testers" instead of the actual title.--brandon

  • Reported in: P1.0 (09-Feb-07)
#26964
PDF page: 15

> The third project visits to a website, --Dan Tripp

  • Reported in: P1.0 (28-Feb-07)
#27045
PDF page: 17
Hi I am trying to find a site/forum dedicated to the excercises in this book. A place where people can talk about their solutions and discuss the q...more...
  • Reported in: P1.0 (13-Feb-07)
#26983
PDF page: 19
Instead of suggesting WinZip as a zip program for Windows (shareware), I recommend suggesting the open source zip program from SourceForge called 7-Zi...more...
  • Reported in: P1.0 (25-Jan-07)
#26880
PDF page: 20
In the first paragraph of section 2.2, second sentence, you have, "The comand-line interpreter is a program that lets you command the compiler ...". ...more...
  • Reported in: P1.0 (09-Feb-07)
#26965
PDF page: 21

> The twiddle (~) means your home folder.

I like that you call it a "twiddle" but it's formally known as a "tilde."--Dan Tripp

  • Reported in: P1.0 (03-Mar-07)
#27089
Paper page: 23

In the footnote 3, first sentence: Change "...message send here ..." to "...message sent here.."--ichael Kernaghan

  • Reported in: P1.0 (25-Jan-07)
#26881
PDF page: 24
In the second to the last sentence on the page, you have, "If you're typing the command line ...". It should probably say, "If you're typing at the c...more...
  • Reported in: P1.0 (28-Jan-08)
#30621
Paper page: 25
For us real neophytes, it would be helpful if the text said "open your text editor" when applicable, at least for the first few chapters until it beco...more...
  • Reported in: P1.0 (14-Jul-15)
#78634
Paper page: 27

In exercise 3.9.3 do you mean the first paragraph to say "the number of files added in new-inventory.txt"--Helen Spurgeon

  • Reported in: P1.0 (28-Mar-07)
#28149
Paper page: 27
ref. exercise 3.9.2. When you say a file is unchanged you usually mean the contents of the file remain the same. Thus I'd recommend changing problem...more...
  • Reported in: P1.0 (09-Feb-07)
#26967
Paper page: 32
"I encourage you to play around with these methods." Possibly confusing for those new to programming, because I don't think the term "method" has b...more...
  • Reported in: P1.0 (01-Jan-10)
#41971
Paper page: 32

The last sentence on page 32 refers to "the sidebar on page 111" for more info on ri. In my edition, the sidebar is on page 112.--Anna Baik

  • Reported in: P1.0 (13-Feb-07)
#26984
PDF page: 35
For technical readers, Ruby treats all lower-cased "names" as variables and capitalized "names" as constants. The reason why the interpreter is com...more...
  • Reported in: P1.0 (14-Feb-07)
#26986
PDF page: 36
In the last paragraph of section 3.6, "...; puts would do the same for strings without them.)" when talking about how puts displays output from arrays...more...
  • Reported in: P1.0 (26-Jan-07)
#26882
PDF page: 38
When looking at the source for inventory.rb, it appears that it will work on Windows and MACOSX because their file systems are case preserving but cas...more...
  • Reported in: P1.0 (11-Nov-09)
#41315
Paper page: 38

.readlines is no longer used in the code examples, but there is no explanation why it was dropped.--Mitch Goldman

  • Reported in: P1.0 (19-Jan-10)
#42110
PDF page: 38

old-inventory.txt is not sorted alphabetically, financial-records.xls is listed after old-inventory.txt--Tom G

  • Reported in: P1.0 (13-Feb-08)
#30750
Paper page: 40
Following the code example, the following sentence appears: "The new message is defined at #1." Doesn't this code example define a "method," not a mes...more...
  • Reported in: P1.0 (16-Jan-13)
#50471
PDF page: 40

In the example a = ['zero' , 'un' ,'dos' , 'tre' ] should say 'tres' is 3 in Spanish.

a = ['zero' , 'un' ,'dos' , 'tres' ]--Matias Mascazzini

  • Reported in: P1.0 (09-May-11)
#47038
PDF page: 40
At the end of the last sentence of the explanation accompanying the fourth example from the bottom of the page "…message arguments are always in paren...more...
  • Reported in: P1.0 (01-Dec-07)
#29939
PDF page: 46

...new_inventory = File.open(ARGV[1]).readlines... should read ... new_inventory = File.open(ARGV[1].readlines

  • Reported in: P1.0 (27-Nov-08)
#36152
PDF page: 58

The code
"'new-inventory.txt')"
is blue when it should be orange-red.--Andrew Grimm

  • Reported in: P1.0 (26-Jan-07)
#26888
PDF page: 59

In exercise 4, in the second sentence after the irb output, you need a space between "any" and "deposit".--Kim Shrier

  • Reported in: P1.0 (26-Jan-07)
#26885
PDF page: 60
I am somewhat confused by the intent of adding downcase to differences.rb since inventory.rb has already downcase'd all the file names. And once agai...more...
  • Reported in: P1.0 (04-Apr-07)
#28321
Paper page: 60
A successful build of churn will (as expected) right-justify the subsystems to 14 characters, but the 'prompt-displays' shown at figs 7.2 and similar ...more...
  • Reported in: P1.0 (20-Dec-12)
#50401
Paper page: 60
svn: Network connection closed unexpectedly tl;dr - root = "ht tp://churn-demo.rubyforge.org/svn" (delete the space between ht and tp) when r...more...
  • Reported in: P1.0 (01-Jun-07)
#29180
Paper page: 60
You say that subversion is not required to work on this project...yet you will get different results than the book and you won't be sure if what you d...more...
  • Reported in: P1.0 (08-Mar-07)
#27451
Paper page: 66

"... let's define month_before wrong: ..."
should be
"... let's define month_before wrongly: ..."
--Michael Kernaghan

  • Reported in: P1.0 (10-Nov-11)
#47934
Paper page: 66
I use Ruby 1.9.3 and when I try to run churn-tests.rb I get the error: C:\Ruby193\code\churn>ruby churn-tests.rb C:/Ruby193/lib/ruby/1.9.1/rubyg...more...
  • Reported in: P1.0 (25-Feb-07)
#27034
Paper page: 66
The printed text is: 'The test will requirechurn.rb.' The typo is there is no space between require and churn. The test should be: 'The test will re...more...
  • Reported in: P1.0 (26-Jan-07)
#26886
PDF page: 72
In the test template in figure 7.3, you use the letter X to stand for something to be replaced and it occurs three times. My first thought when I saw...more...
  • Reported in: P1.0 (26-Jan-07)
#26891
PDF page: 72
In bullet item number 4, you state that test methods start with "test_". Another requirement is that the method must have no parameters or that all p...more...
  • Reported in: P1.0 (26-Jan-07)
#26887
PDF page: 74

In the second paragraph after the running of churn.tests.rb, first sentence, you should have a space between "require" and "churn.rb".--Kim Shrier

  • Reported in: P1.0 (01-May-12)
#49243
PDF page: 74
When running the test scripts in the Churn example it should be noted that users running with Ruby >=1.9.2 cannot use the require on the current dir s...more...
  • Reported in: P1.0 (10-Aug-10)
#44554
Paper page: 75
Half way through the page, the churn-tests.rb example that shows how to select specific tests has a technical error. prompt> ruby churn-tests.rb --...more...
  • Reported in: P1.0 (10-Mar-07)
#27531
Paper page: 76
in the second pice of testing code on the page: def test_subversion_log_with_changes there is an = among the -- in the represenation of a line of da...more...
  • Reported in: P1.0 (06-May-08)
#31892
PDF page: 76
Paragraph : "Suppose that I later change month_before and break it. Then both the direct test_header_format and [...]" I disagree that the 'direct...more...
  • Reported in: P1.0 (05-Oct-07)
#29749
Paper page: 77

In the string being assigned to the variable "root" the svn path should only have one "/" before "var" --Brad Potts

  • Reported in: P1.0 (07-Apr-07)
#28386
Paper page: 81
As others have noted, the svn repository has not been updated in quite a while, making this a boring script to test. I would make the suggestion th...more...
  • Reported in: P1.0 (16-Aug-10)
#44635
Paper page: 82
In the grayed out "Bugs in Tested Code" section, three lines from the bottom, the sentence states "beginning on page Chapter 21, When Scripts..." i...more...
  • Reported in: P1.0 (10-Mar-07)
#27532
Paper page: 82
Last sentence of the highlight box called "Bigs in Tested Code": The text reads "...beginning on Chapter 21, ..." instead of "...beginning on page...more...
  • Reported in: P1.0 (04-Apr-07)
#28320
Paper page: 82
There don't seem to have been any changes in the churn-demo subversion repertory recently, so when running churn.rb all the subsystems show zero aster...more...
  • Reported in: P1.0 (15-Sep-12)
#49809
PDF page: 84
The penultimate line of code in extract_change_count_from [ i.e., "dashed_lines.length - 1"] is marked with a (4), yet this (4) doesn't appear to be r...more...
  • Reported in: P1.0 (26-Jan-07)
#26890
PDF page: 85
In the svn_log method, the URL "svn://rubyforge.org//var/svn/churn_demo" should have only one "/" after rubyforge.org. The correct thing will happen ...more...
  • Reported in: P1.0 (26-Jan-07)
#26892
PDF page: 85
In the box that talks about "What to Test", you mention testing the case where the value to be rounded is 3.5. When dividing an integer by 5, it is i...more...
  • Reported in: P1.0 (29-Jan-07)
#26897
PDF page: 85
The method definition of svn_long is missing a '-'. It is printed as timespan = "-revision 'HEAD:{#{start_date}}'" on this page and in the next se...more...
  • Reported in: P1.0 (30-Mar-08)
#31528
PDF page: 85
In this def, at the second line, it should be --revision and not -revision: def svn_log(subsystem, start_date) timespan = "-revision 'HEAD:{#{st...more...
  • Reported in: P1.0 (18-Jan-13)
#50482
PDF page: 85
In the las line of svn_log says ‘svn log #{timespan} #{root}/#{subsystem}‘ The correct form is with "svn log #{timespan} #{root}/#{subsystem}" becos...more...
  • Reported in: P1.0 (10-Mar-07)
#27535
Paper page: 85

in "My Story of Shame" ...
8th line:
reads "...using conference ..."
should read "...using a conference..."
--Michael Kernaghan

  • Reported in: P1.0 (23-Feb-07)
#27027
Paper page: 85
It seems I always get a svn syntax error unless I take off the single quotes around 'HEAD:{2005-01-26}'. This only returns a line of dashes from the ...more...
  • Reported in: P1.0 (01-Apr-08)
#31560
PDF page: 86
Actually, on page 69, where you make reference to in the last part of page 86, the line : start_date = month_before(Time.now) is at number (3), not nu...more...
  • Reported in: P1.0 (17-Dec-07)
#30025
PDF page: 89
In these code examples, the line svn log #{timespan} #{root}/#{subsystem} appears to be surrounded by single-quotes. But they are actually back...more...
  • Reported in: P1.0 (17-Dec-07)
#30026
PDF page: 89
In my system (OS X 10.4, SVN 1.3.1) the line: timespan = "-revision 'HEAD:{#{start_date}}'" does not work. Revision must be preceeded by two das...more...
  • Reported in: P1.0 (22-Aug-08)
#34183
PDF page: 89
timespan = "-revision 'HEAD:{#{start_date}}'" not only require 2 dashes, but enclosing the revision range in single quotes gives a syntax error from...more...
  • Reported in: P1.0 (29-Jan-07)
#26898
PDF page: 90
The last sentence of the "Bugs in Tested Code" box says "I'm doing that on purpose--error handling is deferred to Chapter 21, When Scripts Run into Pr...more...
  • Reported in: P1.0 (11-Jun-07)
#29208
PDF page: 90

The sidebar box is crowding the main copy.--Bil Kleb

  • Reported in: P1.0 (01-Dec-09)
#41670
PDF page: 90

"I'm doing that on purpose - ..." that sentence needs to be cleaned up.--Daniel Frank

  • Reported in: P1.0 (10-Aug-12)
#49637
PDF page: 90
The autor didn't mention that we would need subvertion installed. After getting the last version of that SVN (subvertion) I changed a bit the code to ...more...
  • Reported in: P1.0 (30-Jun-08)
#32550
Paper page: 92
Sentence "The special character + says that the preceding character must be repeated one or more times to match:" Should read, "The special character...more...
  • Reported in: P1.0 (22-Aug-08)
#34182
PDF page: 93

in paragraph 1:
"I had the task of using conference attendee spreadsheet" -- 'a' or 'the' conference spreadsheet--Garold L Johnson

  • Reported in: P1.0 (05-Apr-07)
#28360
Paper page: 93
"We know that this line's change count starts at character 14." A number other than 14 would be better as (when counting spaces) this could be confus...more...
  • Reported in: P1.0 (18-Jan-13)
#50483
PDF page: 94
With my poor English, it is unclear what operation is evaluated first, apparently contradicts a page later. Something that should be reviewed for a fu...more...
  • Reported in: P1.0 (07-Mar-07)
#27381
Paper page: 96
The bulleted list at the bottom of the page mixes up 1 and -1. The last sentence of the first bullet should read: We'll want another to come firs...more...
  • Reported in: P1.0 (15-Jun-10)
#43818
Paper page: 100
It's written twice that dot matches any character. This is not true, since it doesn't match newline. Compare the two following: ~>irb irb(main):00...more...
  • Reported in: P1.0 (07-Oct-07)
#29755
Paper page: 109

The snv path being assigned to the "root" variable has an extra forward slash ("/")before the word "var"--Brad Potts

  • Reported in: P1.0 (17-Mar-07)
#27814
Paper page: 110
page 110: line 8th from top of page (including blank line) There is a single quote missing irb(main):045:0 SubversionRepository.new(svn://blah.blah...more...
  • Reported in: P1.0 (05-Apr-07)
#28362
Paper page: 110
irb might not indent as shown here. if not, within an irb session, type: conf.auto_indent_mode = true or (better) add this line to your ~/.irbr...more...
  • Reported in: P1.0 (08-Mar-07)
#27454
Paper page: 117
#6768 is faulty -- sorry about that, it was me who was confused. The question mentions join as it is meant to be used inside the output method.--Evan ...more...
  • Reported in: P1.0 (29-May-08)
#32209
PDF page: 117

The argument string on the following line is missing it's opening quote:

irb(main):045:0> SubversionRepository.new(svn://blah.blah.blah')

  • Reported in: P1.0 (07-Mar-07)
#27382
Paper page: 117
Question 7 confuses a string and an array of strings. The question should read: If you chose to have output's return value be an array of strings...more...
  • Reported in: P1.0 (31-Jan-07)
#26925
PDF page: 120

The formatting appears to have turned another -- into -.--Jacob Tomaw

  • Reported in: P1.0 (25-Mar-07)
#28052
Paper page: 122
The first code example on page 122 appears to be missing its first line, which would be something like: irb(main):029:0> class ReverseCredentialsClas...more...
  • Reported in: P1.0 (28-Sep-07)
#29707
Paper page: 136
The irb example about mid-page suggests text.scan(/Customer.*also/) Surprise! Amazon now capitalizes 'Also'. I suggest adding 'i' after the rege...more...
  • Reported in: P1.0 (03-Apr-08)
#31570
Paper page: 138
Amazon seems to have added some style sheets here. I had to modify the regex to include "span" like so: /<b.*?><span\sid.*?>(.*?)</span\s*>/ I supp...more...
  • Reported in: P1.0 (05-Jul-07)
#29304
Paper page: 139

scrape_author does not work with string "field-author-exact", but "field-author" appears to work.--Mark Lynn

  • Reported in: P1.0 (18-Mar-07)
#27843
Paper page: 143
In the first sentence of the second paragraph under section 13.6 "Exercise Yourself", the script "isbn-to-affinity-list.rb" is missing its file extens...more...
  • Reported in: P1.0 (23-Oct-07)
#29783
Paper page: 145

In the last sentence "File.glob" should be "Dir.glob"--Brad Potts

  • Reported in: P1.0 (24-Oct-12)
#49990
PDF page: 148

"I suggest you require affinity-list.rb"

Should this be affinity-trip.rb?--Josh Eveleth

  • Reported in: P1.0 (26-May-07)
#29138
PDF page: 151

ri File.glob should be ri Dir.glob--Tom Krouper

  • Reported in: P1.0 (13-Feb-07)
#26982
PDF page: 154

In the staement:
"There--Carl Graff

  • Reported in: P1.0 (22-Jan-13)
#50505
PDF page: 156

The site www.testing.com don't exist any more =(--Matias Mascazzini

  • Reported in: P1.0 (26-Mar-07)
#28074
Paper page: 178
In the second to last paragraph in section 19.1, the last sentence (in parentheses) needs a space between "required" and "test/unit": "You've seen ...more...
  • Reported in: P1.0 (20-Aug-08)
#34135
PDF page: 181
I don't know if this is an error. I'm not able to use setup.rb. After I have run setup.rb I'm still not able to call clash-check.rb from an arbitrary ...more...
  • Reported in: P1.0 (22-Feb-07)
#27020
PDF page: 184
I tried to use the "make-s4t-project.rb" script and got an error when trying to execute the default-project.rb script from the site_ruby folder (afte...more...
  • Reported in: P1.0 (04-Feb-07)
#26933
Paper page: 186
There is a problem with the downloadable code described in this section. Two of the tests in s4t-utils fail on Windows (native Windows) when run in a ...more...
  • Reported in: P1.0 (27-Mar-07)
#28114
Paper page: 186
In the first paragraph of the "Your Own Utility Library" sidebar, the last word of the first sentence should be singular ("cost"): "One of the anno...more...
  • Reported in: P1.0 (27-Mar-07)
#28115
Paper page: 187
In the second paragraph under "rake increment-version", the first sentence has two zeros (in different fonts) where only one is needed: "A 00 in th...more...
  • Reported in: P1.0 (02-Apr-07)
#28245
Paper page: 189
In the first sentence of the last paragraph on the page, a space is needed between "included" and "S4tUtils": "...including them whenever you inclu...more...
  • Reported in: P1.0 (02-Apr-07)
#28246
Paper page: 195
In figure 20.2, in the InnerModule definition, "def SomeClass" should be changed to "class SomeClass". This corresponds to line 44 of module-facts/som...more...
  • Reported in: P1.0 (02-Apr-07)
#28247
Paper page: 199
In the paragraph beginning "That's a reasonable error message" (towards the bottom of the page), the second sentence needs a space between "open" and ...more...
  • Reported in: P1.0 (27-Feb-07)
#27041
Paper page: 209
The solution to Exercise 3 in file exercise-3.rb in folder exercise-solutions/error-handling has an error. Note that you define your Reserver class ...more...
  • Reported in: P1.0 (05-Nov-07)
#29835
Paper page: 258
I am not really sure but I think that you meant if you refer to the example "4 new files; 2 deleted files; 13 files in common" instead of "13 new fil...more...
  • Reported in: P1.0 (28-Jan-08)
#30625
Paper page: 260
The printout solution to Exercise 3, using the study files provided and running exercise-1.rb should read: 4 new files; 2 deleted files; 13 files in c...more...
  • Reported in: P1.0 (28-Feb-07)
#27044
Paper page: 260
Text is: "The number of messages in common is a little ..." I think it should be: "The number of elements in common is a little ..."--Chris Meisenz...more...
  • Reported in: P1.0 (27-May-12)
#49382
Paper page: 260
"Here is the number of new and deleted messages:" In the exercise you refer to the contents of the array as files or elements. Never as messages. B...more...
  • Reported in: P1.0 (06-Mar-07)
#27351
PDF page: 261
In the solution to exercise number 5, the last paragraph states that for the first solution of the exercise, the changes 'differences.rb' will have to...more...
  • Reported in: P1.0 (13-Mar-07)
#27613
Paper page: 270

Line four of the first test set on the page, has 'util' instead of "util". --Michael Kernaghan

  • Reported in: P1.0 (13-Mar-07)
#27615
Paper page: 270
P.S. to previous: Functionally there is no difference between 'util' and "util" in the context of the test but it looks odd and is not explained.--Mic...more...
  • Reported in: P1.0 (18-Mar-07)
#27858
Paper page: 281

In the last code snippet of exercise 7 the method "lines_ordered ... _count" is missing
end
end

--Michael Kernaghan

  • Reported in: P1.0 (08-Mar-07)
#27455
Paper page: 283
Under the Exercise 9 header, in the first paragraph, the second sentence needs a space between "churn.rb" and "requires". Currently it reads "churn.rb...more...
  • Reported in: P1.0 (19-Mar-07)
#27866
Paper page: 283
In the solution to Exercise 9, one of the class files referenced is formatter.rb. With the Ruby one-click installer v1.8.5-21, another formatter.rb i...more...
  • Reported in: P1.0 (08-Mar-07)
#27456
Paper page: 284
In the last paragraph before the "B.7" header at the bottom of the page, the test files suffix is written incorrectly as "test.rb". It should read "te...more...
  • Reported in: P1.0 (14-Mar-07)
#27638
Paper page: 286
In the third paragraph (starts with "There's a simple solution"), the second sentence should refer to Counter.count, not Counter.value. It currently r...more...