diff options
author | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-17 01:38:16 +0000 |
---|---|---|
committer | tenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-11-17 01:38:16 +0000 |
commit | 07636686da3b93120a1f56e79bdf5ab9ad1f6f8d (patch) | |
tree | ae995cae421aa8bfeca253aa1e3f93749599b61e /ext/psych | |
parent | 1f86c08fdf8a4280eb321ad8732bc85f46f4ee6f (diff) | |
download | ruby-07636686da3b93120a1f56e79bdf5ab9ad1f6f8d.tar.gz |
* 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
Diffstat (limited to 'ext/psych')
-rw-r--r-- | ext/psych/lib/psych.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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: |