We try to keep our books accurate, but sometimes mistakes creep
in. This page lists the errors submitted by our astute readers.
If you've found a new error, please
submit it.
The latest version of the book is P1.0,
released over 6 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.
| PDF |
Paper |
Description |
Found in |
Fixed in |
| all |
|
#42579: 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 before they purchase this book.--Michael Shea #42579: 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 alerti ...more...
|
P1.0
30-Mar-10
|
|
| 0 |
|
#26932: Download section on the website refers to "Scripting for Testers" instead of the actual title.--brandon
|
P1.0
04-Feb-07
|
|
| 15 |
|
#26964: > The third project visits to a website, --Dan Tripp
|
P1.0
09-Feb-07
|
|
| 17 |
|
#27045: 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 questions.
I"m even willing to setup a site for this, but can't find a way to contact the author to discuss.
I can be reached at: theopensourceguy _aatt_ gmail _ddoott_ com
(I'm no Ruby expert and yet I feel this is a perfect way to become one)--John Bateman #27045: 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 discu ...more...
|
P1.0
28-Feb-07
|
|
| 19 |
|
#26983: Instead of suggesting WinZip as a zip program for Windows (shareware), I recommend suggesting the open source zip program from SourceForge called 7-Zip (7-zip.org).--Steve Kim #26983: Instead of suggesting WinZip as a zip program for Windows (shareware), I recommend suggesting the open source zip program from SourceForge cal ...more...
|
P1.0
13-Feb-07
|
|
| 20 |
|
#26880: 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 ...". The word "compiler" should be "computer".--Kim Shrier #26880: 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...
|
P1.0
25-Jan-07
|
|
| 21 |
|
#26965: > The twiddle (~) means your home folder.
I like that you call it a "twiddle" but it's formally known as a "tilde."--Dan Tripp
|
P1.0
09-Feb-07
|
|
|
23 |
#27089: In the footnote 3, first sentence: Change "...message send here ..." to "...message sent here.."--ichael Kernaghan
|
P1.0
03-Mar-07
|
|
| 24 |
|
#26881: 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 command line ...".--Kim Shrier #26881: 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 ...more...
|
P1.0
25-Jan-07
|
|
|
25 |
#30621: 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 becomes ingrained. The first instance would be under 3.7 on page 25. The book does a good job warning about the difference between typing at the prompt and at irb, but the idea that there is a third "typing venue" is rather glossed over.--jkm #30621: 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 ...more...
|
P1.0
28-Jan-08
|
|
|
27 |
#28149: 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 3 to read: "and (the trickiest one) how many files are in both the new and the old inventories."--Colin Godfrey #28149: 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 ...more...
|
P1.0
28-Mar-07
|
|
|
32 |
#26967: "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 been introduced yet at this point in the book, or if it has, not recently or memorably. My suggestion is to introduce or reintroduce the "method" here.--Eeby #26967: "I encourage you to play around with these methods."
Possibly confusing for those new to programming, because I don't think the term "metho ...more...
|
P1.0
09-Feb-07
|
|
|
32 |
#41971: 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
|
P1.0
01-Jan-10
|
|
| 35 |
|
#26984: For technical readers, Ruby treats all lower-cased "names" as variables and capitalized "names" as constants.
The reason why the interpreter is complaining on changing values for MyShip is because it's a constant (note: capitalized name). Constants are meant to be initialized with a value and left alone. It is good practice to use lowercased alphanumeric words for variables and capitalized alphanumeric words for constants.--Steve Kim #26984: For technical readers, Ruby treats all lower-cased "names" as variables and capitalized "names" as constants.
The reason why the interprete ...more...
|
P1.0
13-Feb-07
|
|
| 36 |
|
#26986: 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 should read "...; puts would do the same for arrays without them.)"--Raj Sahae #26986: In the last paragraph of section 3.6, "...; puts would do the same for strings without them.)" when talking about how puts displays output fro ...more...
|
P1.0
14-Feb-07
|
|
| 38 |
|
#26882: 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 case insensitive. It is not possible to have two or more files in the same directory whose names differ only by the case of the letters. UNIX based systems other than MACOSX have file systems that are case sensitive. It is possible to have two file names that differ only in case. I think there should be at least a footnote mentioning that it is possible for the inventory.rb program to mis-report the file names which would cause the array subtraction to get erronious results. Or perhaps you should have a UNIX version of inventory.rb that does not invoke downcase on the file name.--Kim Shrier #26882: 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 ...more...
|
P1.0
26-Jan-07
|
|
|
38 |
#41315: .readlines is no longer used in the code examples, but there is no explanation why it was dropped.--Mitch Goldman
|
P1.0
11-Nov-09
|
|
| 38 |
|
#42110: old-inventory.txt is not sorted alphabetically, financial-records.xls is listed after old-inventory.txt--Tom G
|
P1.0
19-Jan-10
|
|
|
40 |
#30750: 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 message? If it does in fact define a message, then the references to method on the rest of this page should be changed to match. (I think; correct me if I'm wrong.)--Michael Yacavone #30750: Following the code example, the following sentence appears: "The new message is defined at #1." Doesn't this code example define a "method," n ...more...
|
P1.0
13-Feb-08
|
|
| 40 |
|
#50471: In the example a = ['zero' , 'un' ,'dos' , 'tre' ] should say 'tres' is 3 in Spanish.
a = ['zero' , 'un' ,'dos' , 'tres' ]--Matias Mascazzini
|
P1.0
16-Jan-13
|
|
| 40 |
|
#47038: 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 parentheses.)" is not true. "a.delete_at 0" works just fine.--Bruce Hobbs #47038: At the end of the last sentence of the explanation accompanying the fourth example from the bottom of the page "…message arguments are always ...more...
|
P1.0
09-May-11
|
|
| 46 |
|
#29939: ...new_inventory = File.open(ARGV[1]).readlines... should read ... new_inventory = File.open(ARGV[1].readlines
|
P1.0
01-Dec-07
|
|
| 58 |
|
#36152: The code
"'new-inventory.txt')"
is blue when it should be orange-red.--Andrew Grimm
|
P1.0
27-Nov-08
|
|
| 59 |
|
#26888: In exercise 4, in the second sentence after the irb output, you need a space between "any" and "deposit".--Kim Shrier
|
P1.0
26-Jan-07
|
|
| 60 |
|
#26885: 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 again, I think that you should mention that this "improvement" which works on Windows and MACOSX does not work on UNIX.--Kim Shrier #26885: 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 o ...more...
|
P1.0
26-Jan-07
|
|
|
60 |
#28321: 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 are not correctly justified.--Damian leGassick #28321: 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 ...more...
|
P1.0
04-Apr-07
|
|
|
60 |
#50401: svn: Network connection closed unexpectedly
tl;dr - root = "ht tp://churn-demo.rubyforge.org/svn"
(delete the space between ht and tp)
when running:
prompt> svn log --revision 'HEAD:{2005-07-30}' svn://rubyforge.org/var/svn/churn-demo/inventory
or even just running the command: svn log svn://rubyforge.org/var/svn/churn-demo
So running churn.rb would result in:
salman@saleheen:~/everyday_scripting/churn$ ruby churn.rb
Changes between 2005-07-07 and 2005-08-04:
svn: Network connection closed unexpectedly
svn: Network connection closed unexpectedly
svn: Network connection closed unexpectedly
svn: Network connection closed unexpectedly
svn: Network connection closed unexpectedly
svn: Network connection closed unexpectedly
util (-1 changes) *
ui (-1 changes) *
persistence (-1 changes) *
inventory (-1 changes) *
fulfillment (-1 changes) *
audit (-1 changes) *
According to the rubyforge FAQ:
Anonymous cvs/svn checkouts and exports keep failing
Sometimes you'll see a svn: Connection closed unexpectedly error message when you try to export or check out a Subversion repository using anonymous Subversion - e.g., svn co svn://rubyforge.org/var/svn/rspec/trunk/rspec rspec. Or with CVS, the message will be something like cvs [checkout aborted]: end of file from server (consult above messages if any). This is probably happening because we throttle anonymous connections based on server load (using xinetd). You may instead want to use HTTP for anonymous Subversion checkouts instead -e.g., svn co ht tp://rspec.rubyforge.org/svn/trunk/rspec rspec.
(ht tp://rubyforge.org/docman/view.php/5/460/faq.html#anon_svn_failure)
Now if you run the command with the corrected http vs svn address you would get correct output:
$ svn log --revision 'HEAD:{2005-05-05}' ht tp://churn-demo.rubyforge.org/svn/audit
------------------------------------------------------------------------
r10 | marick | 2006-08-08 19:36:28 -0500 (Tue, 08 Aug 2006) | 1 line
------------------------------------------------------------------------
r9 | marick | 2006-08-08 19:35:36 -0500 (Tue, 08 Aug 2006) | 1 line
------------------------------------------------------------------------
r7 | marick | 2006-08-08 19:32:47 -0500 (Tue, 08 Aug 2006) | 1 line
------------------------------------------------------------------------
r3 | marick | 2006-08-07 23:22:26 -0500 (Mon, 07 Aug 2006) | 1 line
reversal story
------------------------------------------------------------------------
r1 | marick | 2006-08-07 14:21:47 -0500 (Mon, 07 Aug 2006) | 1 line
first touches
------------------------------------------------------------------------
Thus, in order to correct the output of churn, change your svn_log definition to have this definition of root:
root = "ht tp://churn-demo.rubyforge.org/svn"--Salman Ansari #50401: svn: Network connection closed unexpectedly
tl;dr - root = "ht tp://churn-demo.rubyforge.org/svn"
(delete the space between ht and tp)
...more...
|
P1.0
20-Dec-12
|
|
|
60 |
#29180: 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 did was right or wrong. Why not just put the svn output in a text file so everyone can play?--Mike #29180: 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 wh ...more...
|
P1.0
01-Jun-07
|
|
|
66 |
#27451: "... let's define month_before wrong: ..."
should be
"... let's define month_before wrongly: ..."
--Michael Kernaghan
|
P1.0
08-Mar-07
|
|
|
66 |
#47934: 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/rubygems/custom_require.rb:36:in `require': cannot load such file -- churn (LoadError)
from C:/Ruby193/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require' from churn-tests.rb:7:in `<main>'
C:\Ruby193\code\churn>
Is it because I use a different version of Ruby?--Nina Jareke #47934: 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 ...more...
|
P1.0
10-Nov-11
|
|
|
66 |
#27034: 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 require churn.rb.'--P.J. Lynch #27034: 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 ...more...
|
P1.0
25-Feb-07
|
|
| 72 |
|
#26886: 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 that is that the letter X would be replaced by the same string in all three places. I know that you mention in the discussion that X is just a placeholder to indicate where you would want to substitute your own text, but, maybe it would be better to use a different letter in each place, like X, Y, and Z. --Kim Shrier #26886: 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 wh ...more...
|
P1.0
26-Jan-07
|
|
| 72 |
|
#26891: 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 parameters must be optional. If that is not the case, the unit test code will raise an invalid_test exception.--Kim Shrier #26891: In bullet item number 4, you state that test methods start with "test_". Another requirement is that the method must have no parameters or th ...more...
|
P1.0
26-Jan-07
|
|
| 74 |
|
#26887: 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
|
P1.0
26-Jan-07
|
|
| 74 |
|
#49243: 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 so running
$ ruby churn-tests.rb
will result in an error
churn not found.
Users need to use either
require_relative
or some other method of loading files from the same directory as the running script.--Dave Baker #49243: 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 curre ...more...
|
P1.0
01-May-12
|
|
|
75 |
#44554: 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 --name=/asterisks/
should be
prompt> ruby churn-tests.rb --name /asterisks/
- just leave out the '=' after --name--Ben Cawrse #44554: Half way through the page, the churn-tests.rb example that shows how to select specific tests has a technical error.
prompt> ruby churn-tes ...more...
|
P1.0
10-Aug-10
|
|
|
76 |
#27531: 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 dashes from an svn log (in the second printed line of the test definition.)--Michael Kernaghan #27531: 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 li ...more...
|
P1.0
10-Mar-07
|
|
| 76 |
|
#31892: Paragraph : "Suppose that I later change month_before and
break it. Then both the direct test_header_format and [...]"
I disagree that the 'direct' test fails; the 'bootstrap' test_header_format
and the test_month_before_is_28_days will both fail.
--John H Simmonds #31892: Paragraph : "Suppose that I later change month_before and
break it. Then both the direct test_header_format and [...]"
I disagree that the ...more...
|
P1.0
06-May-08
|
|
|
77 |
#29749: In the string being assigned to the variable "root" the svn path should only have one "/" before "var" --Brad Potts
|
P1.0
05-Oct-07
|
|
|
81 |
#28386: 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 that you have people hard-code the start date to Time.local(2006, 7, 11), since that's a time when meaningful changes had been made.
Of course, this means that your suggested fix for Exercise 1 is invalid. I would recommend:
def header (inTime)
endTime = Time.local(inTime.split('-')[0], inTime.split('-')[1], inTime.split('-')[2])
endTime += 60 * 60 * 24 * 28
"Changes between #{inTime} and #{svn_date(endTime)}"
end
--a sharp old jewel #28386: 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 sugge ...more...
|
P1.0
07-Apr-07
|
|
|
82 |
#44635: In the grayed out "Bugs in Tested Code" section, three lines from the bottom, the sentence states
"beginning on page Chapter 21, When Scripts..."
instead this sentence should have a page number instead of restating the chapter and the chapters title.--Ben Cawrse #44635: In the grayed out "Bugs in Tested Code" section, three lines from the bottom, the sentence states
"beginning on page Chapter 21, When Scripts ...more...
|
P1.0
16-Aug-10
|
|
|
82 |
#27532: Last sentence of the highlight box called "Bigs in Tested Code":
The text reads "...beginning on Chapter 21, ..."
instead of
"...beginning on page 199 ..." (if 199 is intended).--Michael Kernaghan #27532: Last sentence of the highlight box called "Bigs in Tested Code":
The text reads "...beginning on Chapter 21, ..."
instead of
"...beginning ...more...
|
P1.0
10-Mar-07
|
|
|
82 |
#28320: 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 asterisks and a count of zero. maybe you could cron some changes for us?--Damian leGassick #28320: 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 ze ...more...
|
P1.0
04-Apr-07
|
|
| 84 |
|
#49809: 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 referenced later in the book.--Josh Evleth #49809: 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 ...more...
|
P1.0
15-Sep-12
|
|
| 85 |
|
#26890: 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 but technically speaking, there should only be one "/" there. The same error is in the source in snapshots/churn.v7.rb and all later versions.--Kim Shrier #26890: 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 ...more...
|
P1.0
26-Jan-07
|
|
| 85 |
|
#26892: 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 impossible to have a result that ends in .5. The only way to get a value that ends in .5 is to pass a floating point number into asterisks_for. This seems to me to not be a good example to talk about testing rounding.--Kim Shrier #26892: 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, ...more...
|
P1.0
26-Jan-07
|
|
| 85 |
|
#26897: 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 section as
timespan = "--revision 'HEAD:{#{start_date}}'"
the 2 dashes are needed.--Jacob Tomaw #26897: The method definition of svn_long is missing a '-'. It is printed as
timespan = "-revision 'HEAD:{#{start_date}}'"
on this page and in the ...more...
|
P1.0
29-Jan-07
|
|
| 85 |
|
#31528: In this def, at the second line, it should be --revision and not -revision:
def svn_log(subsystem, start_date)
timespan = "-revision 'HEAD:{#{start_date}}'"
root = "svn://rubyforge.org//var/svn/churn-demo"
‘svn log #{timespan} #{root}/#{subsystem}‘
end
Thanx for your great books!--Jonathan #31528: In this def, at the second line, it should be --revision and not -revision:
def svn_log(subsystem, start_date)
timespan = "-revision 'HE ...more...
|
P1.0
30-Mar-08
|
|
| 85 |
|
#50482: In the las line of svn_log says ‘svn log #{timespan} #{root}/#{subsystem}‘
The correct form is with "svn log #{timespan} #{root}/#{subsystem}" becose you use #{} for print values.--Matias Mascazzini #50482: In the las line of svn_log says ‘svn log #{timespan} #{root}/#{subsystem}‘
The correct form is with "svn log #{timespan} #{root}/#{subsystem ...more...
|
P1.0
18-Jan-13
|
|
|
85 |
#27535: in "My Story of Shame" ...
8th line:
reads "...using conference ..."
should read "...using a conference..."
--Michael Kernaghan
|
P1.0
10-Mar-07
|
|
|
85 |
#27027: 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 repository though. I am very light on SVN, but I am wonder if the syntax is correct for my setup. I am running these scripts from the cmd line in Windows XP.--Bill #27027: 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 f ...more...
|
P1.0
23-Feb-07
|
|
| 86 |
|
#31560: 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 number 2.
Thanx for your great book! #31560: 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) ...more...
|
P1.0
01-Apr-08
|
|
| 89 |
|
#30025: In these code examples, the line
svn log #{timespan} #{root}/#{subsystem}
appears to be surrounded by single-quotes. But they are actually back-ticks. If someone (like me) is following along with the printed examples & uses the single-quotes the script won't work.
Looking at the downloadable code revealed the problem. But the presence of back-tics should be obvious looking at the printed code in the book as well.--Ian #30025: In these code examples, the line
svn log #{timespan} #{root}/#{subsystem}
appears to be surrounded by single-quotes. But they are actua ...more...
|
P1.0
17-Dec-07
|
|
| 89 |
|
#30026: 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 dashes. The line should read:
timespan = "--revision 'HEAD:{#{start_date}}'"--Ian #30026: 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 ...more...
|
P1.0
17-Dec-07
|
|
| 89 |
|
#34183: timespan = "-revision 'HEAD:{#{start_date}}'"
not only require 2 dashes, but enclosing the revision range in single quotes gives a syntax error from svn.--Garold L Johnson #34183: timespan = "-revision 'HEAD:{#{start_date}}'"
not only require 2 dashes, but enclosing the revision range in single quotes gives a syntax er ...more...
|
P1.0
22-Aug-08
|
|
| 90 |
|
#26898: 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 Problems, beginning on page Chapter 21, When Scripts Run into Problems--but it's certainly not unknown for people to do it by accident."
Instead of a page number is says "Chapter 21, When Scripts Run into Problems" again after "on page".--Jacob Tomaw #26898: 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 ...more...
|
P1.0
29-Jan-07
|
|
| 90 |
|
#29208: The sidebar box is crowding the main copy.--Bil Kleb
|
P1.0
11-Jun-07
|
|
| 90 |
|
#41670: "I'm doing that on purpose - ..." that sentence needs to be cleaned up.--Daniel Frank
|
P1.0
01-Dec-09
|
|
| 90 |
|
#49637: 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 force it to work, I took out the single quotes around HEAD{#{start_date}} and instead of Time.now, I put Time.local(2005, 7, 30) (without those changes we couldn't follow along the book).
def month_before(a_time)
a_time - 28 * 24 * 60 * 60
end
def svn_date(a_time)
a_time.strftime("%Y-%m-%d")
end
def header(an_svn_date)
"Changes since #{an_svn_date}:"
end
def subsystem_line(subsystem_name, change_count)
asterisks = asterisks_for(change_count)
"#{subsystem_name.rjust(14)} #{asterisks} (#{change_count})"
end
def asterisks_for(an_integer)
'*' * (an_integer / 5.0).round
end
def change_count_for(name, start_date)
extract_change_count_from(svn_log(name, start_date))
end
def extract_change_count_from(log_text)
lines = log_text.split("\n")
dashed_lines = lines.find_all do | line |
line.include?('--------')
end
dashed_lines.length - 1
end
def svn_log(subsystem, start_date)
timespan = "--revision HEAD:{#{start_date}}"
root = "svn://rubyforge.org/var/svn/churn-demo"
`svn log #{timespan} #{root}/#{subsystem}`
end
if $0 == __FILE__
subsystem_names = ['audit', 'fulfillment', 'persistence',
'ui', 'util', 'inventory']
start_date = svn_date(month_before(Time.local(2005, 7, 30)))
puts header(start_date)
subsystem_names.each do | name |
puts subsystem_line(name, change_count_for(name, start_date))
end
end
besides that: Great book!! Thanks!!--Celso de Sá Lopes #49637: 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 ...more...
|
P1.0
10-Aug-12
|
|
|
92 |
#32550: Sentence "The special character + says that the preceding character must be repeated one or more times to match:"
Should read, "The special character + says that the preceding character MAY be repeated one or more times to match:"
(As it is currently stated, the example'abc' should not match since the b is not repeated)--Dan G #32550: Sentence "The special character + says that the preceding character must be repeated one or more times to match:"
Should read, "The special c ...more...
|
P1.0
30-Jun-08
|
|
| 93 |
|
#34182: in paragraph 1:
"I had the task of using conference attendee spreadsheet" -- 'a' or 'the' conference spreadsheet--Garold L Johnson
|
P1.0
22-Aug-08
|
|
|
93 |
#28360: "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 confused with the right-justification amount for the subsystem name.
An output pasted from churn would be something like
" ui2**(13)" - i.e 11 spaces before ui2.
Given any real churn output, the first irb example on the page will always yield => 16 when applied to it.--Damian leGassick #28360: "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 b ...more...
|
P1.0
05-Apr-07
|
|
| 94 |
|
#50483: With my poor English, it is unclear what operation is evaluated first, apparently contradicts a page later. Something that should be reviewed for a future edition.--Matias Mascazzini #50483: With my poor English, it is unclear what operation is evaluated first, apparently contradicts a page later. Something that should be reviewed ...more...
|
P1.0
18-Jan-13
|
|
|
96 |
#27381: 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 first in the sorted list, which will happen if the block returns 1.
The second bullet should read:
The value of 3 <=> 5 is -1, meaning that 5 comes after 3 in the built-in ordering.
The third bullet should read:
If the block returned that -1...
The last bullet should read:
So we negate the result of <=> to convert the -1 into 1...--Evan A. Zacks #27381: 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 c ...more...
|
P1.0
07-Mar-07
|
|
|
100 |
#43818: 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):001:0> /a.b/ =~ "a\nb"
=> nil
irb(main):002:0> /a.b/m =~ "a\nb"
=> 0
I use the single-line mode flag (i.e. 'm') in the second case. This feature is sometimes called dot-matches-newline or dot-all.--Staffan Nöteberg #43818: 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( ...more...
|
P1.0
15-Jun-10
|
|
|
109 |
#29755: The snv path being assigned to the "root" variable has an extra forward slash ("/")before the word "var"--Brad Potts
|
P1.0
07-Oct-07
|
|
|
110 |
#27814: 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.blah')
should read
irb(main):045:0 SubversionRepository.new('svn://blah.blah.blah')--Michael Kernaghan #27814: page 110: line 8th from top of page (including blank line)
There is a single quote missing
irb(main):045:0 SubversionRepository.new(svn://b ...more...
|
P1.0
17-Mar-07
|
|
|
110 |
#28362: 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 ~/.irbrc file
IRB.conf[:AUTO_INDENT] = true
see [TH01], p.190--Damian leGassick #28362: 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 ...more...
|
P1.0
05-Apr-07
|
|
|
117 |
#27454: #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 A. Zacks
|
P1.0
08-Mar-07
|
|
| 117 |
|
#32209: The argument string on the following line is missing it's opening quote:
irb(main):045:0> SubversionRepository.new(svn://blah.blah.blah')
|
P1.0
29-May-08
|
|
|
117 |
#27382: 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 (rather than a string), you'll want to know about join...--Evan A. Zacks #27382: 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 ...more...
|
P1.0
07-Mar-07
|
|
| 120 |
|
#26925: The formatting appears to have turned another -- into -.--Jacob Tomaw
|
P1.0
31-Jan-07
|
|
|
122 |
#28052: The first code example on page 122 appears to be missing its first line, which would be something like:
irb(main):029:0> class ReverseCredentialsClass --Michael Kernaghan #28052: The first code example on page 122 appears to be missing its first line, which would be something like:
irb(main):029:0> class ReverseCredent ...more...
|
P1.0
25-Mar-07
|
|
|
136 |
#29707: The irb example about mid-page suggests text.scan(/Customer.*also/)
Surprise! Amazon now capitalizes 'Also'.
I suggest adding 'i' after the regexp.
text.scan(/Customer.*also/i)--Kevin Corbett #29707: The irb example about mid-page suggests text.scan(/Customer.*also/)
Surprise! Amazon now capitalizes 'Also'.
I suggest adding 'i' after ...more...
|
P1.0
28-Sep-07
|
|
|
138 |
#31570: 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 suppose one could also use a greedy operator to find the second ">" before the group.--Ransom #31570: 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*>/
...more...
|
P1.0
03-Apr-08
|
|
|
139 |
#29304: scrape_author does not work with string "field-author-exact", but "field-author" appears to work.--Mark Lynn
|
P1.0
05-Jul-07
|
|
|
143 |
#27843: 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 extension:
"...you may want to model your scripts after isbn-to-affinity-list and..."
--Evan A. Zacks #27843: In the first sentence of the second paragraph under section 13.6 "Exercise Yourself", the script "isbn-to-affinity-list.rb" is missing its fil ...more...
|
P1.0
18-Mar-07
|
|
|
145 |
#29783: In the last sentence "File.glob" should be "Dir.glob"--Brad Potts
|
P1.0
23-Oct-07
|
|
| 148 |
|
#49990: "I suggest you require affinity-list.rb"
Should this be affinity-trip.rb?--Josh Eveleth
|
P1.0
24-Oct-12
|
|
| 151 |
|
#29138: ri File.glob should be ri Dir.glob--Tom Krouper
|
P1.0
26-May-07
|
|
| 154 |
|
#26982: In the staement:
"There--Carl Graff
|
P1.0
13-Feb-07
|
|
| 156 |
|
#50505: The site www.testing.com don't exist any more =(--Matias Mascazzini
|
P1.0
22-Jan-13
|
|
|
178 |
#28074: 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 examples of this in tests that requiredtest/unit."
It also may be worth considering if "required" should either be changed to the standard text font or changed to "require".
--Evan A. Zacks #28074: In the second to last paragraph in section 19.1, the last sentence (in parentheses) needs a space between "required" and "test/unit":
"You' ...more...
|
P1.0
26-Mar-07
|
|
| 181 |
|
#34135: 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 folder. I'm on Mac OS X. I don't seem to have any site_local folder which is unfortunate since it is mentioned repeatedly. Files seems to installed in /System/Library/Ruby.framework... In Mac OS X Leopard ruby has been framwork'ized could this have something to do with my problems? --Johan Bjørn #34135: 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 ar ...more...
|
P1.0
20-Aug-08
|
|
| 184 |
|
#27020: 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 (after running setup.rb). I am using Mac OSX 10.4 with ruby 1.8.5 (2006-12-25 patchlevel 12) [i686-darwin8.8.1].
/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require': no such file to load -- s4t-utils/capturing-globals (LoadError)--Simon #27020: 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 folde ...more...
|
P1.0
22-Feb-07
|
|
|
186 |
#26933: 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 directory containing a space its path. The tests pass from the same directory, when I change my path to use the "short format" names, which contain no spaces.--Marc Paterno #26933: 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 r ...more...
|
P1.0
04-Feb-07
|
|
|
186 |
#28114: 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 annoying things about the universe is that a net long-term benefit often has a net short-term costs."
--Evan A. Zacks #28114: In the first paragraph of the "Your Own Utility Library" sidebar, the last word of the first sentence should be singular ("cost"):
"One of ...more...
|
P1.0
27-Mar-07
|
|
|
187 |
#28115: 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 the first slot..."
--Evan A. Zacks #28115: In the second paragraph under "rake increment-version", the first sentence has two zeros (in different fonts) where only one is needed:
"A ...more...
|
P1.0
27-Mar-07
|
|
|
189 |
#28245: In the first sentence of the last paragraph on the page, a space is needed between "included" and "S4tUtils":
"...including them whenever you includedS4tUtils would lead..."
--Evan A. Zacks #28245: In the first sentence of the last paragraph on the page, a space is needed between "included" and "S4tUtils":
"...including them whenever y ...more...
|
P1.0
02-Apr-07
|
|
|
195 |
#28246: In figure 20.2, in the InnerModule definition, "def SomeClass" should be changed to "class SomeClass". This corresponds to line 44 of module-facts/some-module.rb.
--Evan A. Zacks #28246: In figure 20.2, in the InnerModule definition, "def SomeClass" should be changed to "class SomeClass". This corresponds to line 44 of module-f ...more...
|
P1.0
02-Apr-07
|
|
|
199 |
#28247: 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 "no-such-file":
"...leaving only the line that tries to openno-such-file."
--Evan A. Zacks #28247: In the paragraph beginning "That's a reasonable error message" (towards the bottom of the page), the second sentence needs a space between "op ...more...
|
P1.0
02-Apr-07
|
|
|
209 |
#27041: 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 as follows:
class Reserver
def reserve(machine_name)
machine = Machine.new(machine_name)
yield machine
puts "Reserved #{machine.name}."
machine
rescue Exception => ex
puts "Test failure: #{ex.message}"
ensure
release(machine) if machine
end
def release(machine)
puts "Released #{machine.name}."
end
end
You need to reverse the order of the following two lines of code:
yield machine
puts "Reserved #{machine.name}."
It should be:
puts "Reserved #{machine.name}."
yield machine
Otherwise, your output will never begin with:
Reserved Mycroft.
Nice exercise though.--Bharat Ruparel #27041: The solution to Exercise 3 in file exercise-3.rb in folder exercise-solutions/error-handling has an error. Note that you define your Reserve ...more...
|
P1.0
27-Feb-07
|
|
|
258 |
#29835: 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 files; 2 deleted files; 5 files in common"--Eduard Seifert #29835: 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 ...more...
|
P1.0
05-Nov-07
|
|
|
260 |
#30625: 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 common.--jkm #30625: 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 fi ...more...
|
P1.0
28-Jan-08
|
|
|
260 |
#27044: 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 Meisenzahl
|
P1.0
28-Feb-07
|
|
|
260 |
#49382: "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. But in the solution you repeatedly refer to "messages", which is confusing.
Further, the exercise asked for: "how many files were unchanged", *NOT* how many elements in common they two lists have.
My solution was: puts old_inventory.length - deleted_files.length
I ended up with the 13, the same result as "files in common" (as other errata reporters found, as the numbers in the text are completely wrong), but my way makes more sense to me, as it more directly answers the original question.--Darryl Lee #49382: "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 mes ...more...
|
P1.0
27-May-12
|
|
| 261 |
|
#27351: 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 undergo so it can work in Unix would be made in the 'compare_inventory_files' method. But the way I see it, they would have to be made in the 'inventory_from' method since this is where the downcasing occurs and where we are entering the list of words that we want to exclude.--Ana Eva Lopez #27351: In the solution to exercise number 5, the last paragraph states that for the first solution of the exercise, the changes 'differences.rb' will ...more...
|
P1.0
06-Mar-07
|
|
|
270 |
#27613: Line four of the first test set on the page, has 'util' instead of "util". --Michael Kernaghan
|
P1.0
13-Mar-07
|
|
|
270 |
#27615: 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.--Michael Kernaghan
|
P1.0
13-Mar-07
|
|
|
281 |
#27858: In the last code snippet of exercise 7 the method "lines_ordered ... _count" is missing
end
end
--Michael Kernaghan
|
P1.0
18-Mar-07
|
|
|
283 |
#27455: Under the Exercise 9 header, in the first paragraph, the second sentence needs a space between "churn.rb" and "requires". Currently it reads "churn.rbrequires the other two files".--Evan A. Zacks #27455: Under the Exercise 9 header, in the first paragraph, the second sentence needs a space between "churn.rb" and "requires". Currently it reads " ...more...
|
P1.0
08-Mar-07
|
|
|
283 |
#27866: 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 is installed automatically on the path, making it so that calling a different file formatter.rb results in the code not working. In the one-click-installer v1.8.6-25, this is no longer a problem and the file can be named formatter.rb again. It might be good to add a footnote or something indicating this.--Andy Tinkham #27866: 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 format ...more...
|
P1.0
19-Mar-07
|
|
|
284 |
#27456: 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 "tests.rb" as follows:
So as long as I follow the naming convention of ending all test files (and no others) with tests.rb...
--Evan A. Zacks #27456: 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 ...more...
|
P1.0
08-Mar-07
|
|
|
286 |
#27638: In the third paragraph (starts with "There's a simple solution"), the second sentence should refer to Counter.count, not Counter.value. It currently reads:
Suppose every method that needs the count gets it through Counter.value.
--Evan A. Zacks #27638: In the third paragraph (starts with "There's a simple solution"), the second sentence should refer to Counter.count, not Counter.value. It cur ...more...
|
P1.0
14-Mar-07
|
|
| 2006 |
YfRFC |
#50321: suitcaseofcourage April 6th, 2009 6:14 am I strongly dgaisree with the Skype website being held up as any type of best practice. As good as the service is, the website is equally bad. Nearly impossible to find your way around, and actually sign up for the services you want. And whenever I click on shop, for some reason it takes me to the Japanese version. Has been that way for a few years. Am I the only one who sees that? That site is terrible, although it looks pretty if you aren't actually trying to accomplish anything.--GIdDhCcy #50321: suitcaseofcourage April 6th, 2009 6:14 am I strongly dgaisree with the Skype website being held up a ...more...
|
P1.0
07-Dec-12
|
|
| 2006 |
jtCIx |
#50328: Thinking like that is really imprseisve--oOoBGRFjMc
|
P1.0
07-Dec-12
|
|