Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
Psych.parse_file
parse_file(filename, fallback: false)
ext/psych/lib/psych.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/ext/psych/lib/psych.rb, line 412
def self.parse_file filename, fallback: false
result = File.open filename, 'r:bom|utf-8' do |f|
parse f, filename: filename
end
result || fallback
end
Parse a file at filename. Returns the Psych::Nodes::Document.
Raises a Psych::SyntaxError when a YAML syntax error is detected.