Project

General

Profile

Actions

Bug #7636

closed

Problems in the documnt of psych

Added by ohai (Ippei Obayashi) about 11 years ago. Updated about 11 years ago.

Status:
Closed
Assignee:
Target version:
ruby -v:
ruby 2.0.0dev (2012-12-01 trunk 38126) [x86_64-linux]
Backport:
[ruby-core:51193]

Description

I found some mistakes in the comment of psych library.

The following is the comment of Psych.load:

Example:

Psych.load("--- a") # => 'a'

Psych.load("---\n - a\n - b") # => ['a', 'b']

begin

Psych.load("--- `", "file.txt")

rescue Psych::SyntaxError => ex

ex.file # => 'file.txt'

ex.message # => "(foo.txt): found character that cannot start any token"

end

The return value of ex.message is not correct. "foo.txt" should be "file.txt".
We can find the same errros on some other methods.

The attached patch fixes this problem. The patch also update the message
for newer versions.


Files

psych-doc.patch (1.46 KB) psych-doc.patch ohai (Ippei Obayashi), 12/29/2012 11:38 PM
Actions

Also available in: Atom PDF

Like0
Like0Like0