Method: Psych.unsafe_load_file
- Defined in:
- lib/psych.rb
.unsafe_load_file(filename, **kwargs) ⇒ Object
Load 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
.
NOTE: This method *should not* be used to parse untrusted documents, such as YAML documents that are supplied via user input. Instead, please use the safe_load_file method.
665 666 667 668 669 |
# File 'lib/psych.rb', line 665 def self.unsafe_load_file filename, **kwargs File.open(filename, 'r:bom|utf-8') { |f| self.unsafe_load f, filename: filename, **kwargs } end |