From 07636686da3b93120a1f56e79bdf5ab9ad1f6f8d Mon Sep 17 00:00:00 2001 From: tenderlove Date: Thu, 17 Nov 2011 01:38:16 +0000 Subject: [PATCH] * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are also closed. [ruby-core:41088] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33775 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ ext/psych/lib/psych.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 81ac159405..30e79400a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Nov 17 10:36:46 2011 Aaron Patterson + + * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are + also closed. [ruby-core:41088] + Wed Nov 16 18:13:52 2011 Nobuyoshi Nakada * Makefile.in (LIBRUBY_A): check if generated linked library is diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb index d1dc0f0af7..497f5952a3 100644 --- a/ext/psych/lib/psych.rb +++ b/ext/psych/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: