Project

General

Profile

Bug #7636 ยป psych-doc.patch

ohai (Ippei Obayashi), 12/29/2012 11:38 PM

View differences:

ext/psych/lib/psych.rb
# Psych.load("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
# ex.message # => "(foo.txt): found character that cannot start any token"
# ex.mssage # => "(file.txt): found character that cannot start any token while scanning for the next token at line 1 column 5"
# end
def self.load yaml, filename = nil
result = parse(yaml, filename)
......
# Psych.parse("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
# ex.message # => "(foo.txt): found character that cannot start any token"
# ex.mssage # => "(file.txt): found character that cannot start any token while scanning for the next token at line 1 column 5"
# end
#
# See Psych::Nodes for more information about YAML AST.
......
# Psych.parse_stream("--- `", "file.txt")
# rescue Psych::SyntaxError => ex
# ex.file # => 'file.txt'
# ex.message # => "(foo.txt): found character that cannot start any token"
# ex.mssage # => "(file.txt): found character that cannot start any token while scanning for the next token at line 1 column 5"
# end
#
# See Psych::Nodes for more information about YAML AST.
    (1-1/1)