From 312965d9bc36bcff748745b6d19a57d6cf4d0ecc Mon Sep 17 00:00:00 2001 From: Aaron Patterson Date: Wed, 16 Nov 2011 17:38:48 -0800 Subject: * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are also closed. [ruby-core:41088] --- lib/psych.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/psych.rb b/lib/psych.rb index d1dc0f0..497f595 100644 --- a/lib/psych.rb +++ b/lib/psych.rb @@ -229,7 +229,7 @@ module Psych # Load the document contained in +filename+. Returns the yaml contained in # +filename+ as a ruby object def self.load_file filename - self.load File.open(filename) + File.open(filename) { |f| self.load f } end # :stopdoc: -- cgit v1.2.3