class SyntaxError
Extension to SyntaxError to extract line numbers from error messages.
Definitions
def lineno
Extract the line number from the error message.
Signature
-
returns
Integer, nil The line number if found in the message.
Implementation
def lineno
if message =~ /:(\d+):/
$1.to_i
end
end