Programming Ruby 3.2 (5th Edition): B1.0 page 235, The code tag should not be here.?

@noelrappin

page 235, the second paragraph, option -i [extension], ends with “as below”, followed by :

The code tag should not be here.

In the previous version it was :

$ ruby -pi.bak -e "gsub(/Perl/, 'Ruby')" *.txt}

with an unmatched closing brace.

If I am in code directory, after copying tut_threads/testfile to code, I can run :

ruby -pi.bak -e "gsub(/This/, 'that')" testfile

testfile has changed :

that is line one
that is line two
that is line three
And so on...

and there is a new testfile.bak :

This is line one
This is line two
This is line three
And so on...

+++++ Same for option -s, which was :

$ ruby -s prog -opt=electric ./mydata

That’s a formatting error – the code sample should be there (minus the brace, not sure what that’s doing there, it’s not in my source file.

Thanks!