Maintenance Ruby 3.3 gets fixes, but no new features. 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-3.3.0/ext/psych/lib/psych.rb, line 410
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.