Errata

MacRuby: The Definitive Guide

Errata for MacRuby: The Definitive Guide

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted By Date submitted Date corrected
Printed, PDF,
Page 39
Section "Strings and Attributed Strings"

The example

>> framework 'Foundation'
=> true
file_path = "~/Music/born_to_be_alive.m4a"
file_path.pathExtension
# => "m4a"
# similar to Ruby's
File.extname(path)
# => ".m4a"

the last command throws a error

# similar to Ruby's
File.extname(path)
NameError: undefined local variable or method `path' for main:TopLevel

The method parameter should be 'file_path'

# similar to Ruby's
File.extname(file_path)
# => ".m4a"

Note from the Author or Editor:
The line reading `File.extname(path)` should have instead read `File.extname(file_path)` since we used the variable named `file_path` and not `path`.

Anonymous  Nov 07, 2012