Problems in the documnt of psych
I found some mistakes in the comment of psych library.
The following is the comment of Psych.load:
# Psych.load("--- a") # => 'a'
# Psych.load("---\n - a\n - b") # => ['a', 'b']
# Psych.load("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
# ex.message # => "(foo.txt): found character that cannot start any token"
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.
Updated by zzak (Zachary Scott) over 8 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r38680.
Ippei, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- ext/psych/lib/psych.rb (Psych.load): Return value of Psych::SyntaxError.message should be same as example. Patch by Ippei Obayashi [ruby-core:51193] [Bug #7636]