Bug #7636 ยป psych-doc.patch
| 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.
|
||