From 1f2eb4b7b968f0f1f7083f167d3e35a1fe254cdc Mon Sep 17 00:00:00 2001 From: Marcus Stollsteimer Date: Tue, 19 Dec 2017 23:02:11 +0100 Subject: Add more test cases for fallback of Psych.load_file Add more test cases for the fallback keyword argument of Psych.load_file; additionally, fix an error in the docs. --- lib/psych.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/psych.rb') diff --git a/lib/psych.rb b/lib/psych.rb index a4d5a96..ad87ece 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -492,7 +492,7 @@ module Psych ### # 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 default return value, which defaults to an empty Hash + # the specified +fallback+ return value, which defaults to +false+. def self.load_file filename, fallback: false File.open(filename, 'r:bom|utf-8') { |f| self.load f, filename, fallback: FALLBACK.new(fallback) -- cgit v1.2.1