summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG.rdoc5
-rw-r--r--lib/psych.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/CHANGELOG.rdoc b/CHANGELOG.rdoc
index baa7a72..0656670 100644
--- a/CHANGELOG.rdoc
+++ b/CHANGELOG.rdoc
@@ -1,3 +1,8 @@
+Thu Nov 17 10:36:46 2011 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb (load_file): make sure opened yaml files are
+ also closed. [ruby-core:41088]
+
Wed Nov 9 04:52:16 2011 Aaron Patterson <aaron@tenderlovemaking.com>
* ext/psych/lib/psych/tree_builder.rb: dump complex numbers,
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: