summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-30 00:21:27 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-11-30 00:21:27 +0000
commit58398d5106d2f56e30d112fdbafe472a1beaf387 (patch)
treeb715faa266f8cbfc11171b4f7365cdfe43484fe4 /ext
parent72fba5701c8637de918b4a55de87dbb2652c202f (diff)
merge revision(s) 33775:
* 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/branches/ruby_1_9_3@33903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r--ext/psych/lib/psych.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index cf17eaaa27..9507bbb53b 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -226,7 +226,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: