Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Psych.safe_load_file

safe_load_file(filename, **kwargs)

Safely loads the document contained in filename. Returns the yaml contained in filename as a Ruby object, or if the file is empty, it returns the specified fallback return value, which defaults to false. See safe_load for options.

See also .safe_load .to_json .safe_dump .unsafe_load also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0