summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlamont-granquist <lamont@scriptkiddie.org>2014-01-08 10:28:03 -0800
committerlamont-granquist <lamont@scriptkiddie.org>2014-01-08 10:28:03 -0800
commit6c773447d1bd9f89f81ccfbeeb277ae14bdd25e4 (patch)
treef122867679ff785872871c5bf19b3669a45fd2f5
parent6919643a4b825fe70014f0e30fa73d649227daf6 (diff)
parent13eaf3d1924b56c80c4509398fd7d099a78da0cc (diff)
downloadchef-6c773447d1bd9f89f81ccfbeeb277ae14bdd25e4.tar.gz
Merge pull request #1161 from deployable/CHEF-4850
CHEF-4850 Close file in Chef::Util::FileEdit after reading contents
-rw-r--r--lib/chef/util/file_edit.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/util/file_edit.rb b/lib/chef/util/file_edit.rb
index ea0a523baa..3f354124b3 100644
--- a/lib/chef/util/file_edit.rb
+++ b/lib/chef/util/file_edit.rb
@@ -33,7 +33,7 @@ class Chef
@file_edited = false
raise ArgumentError, "File doesn't exist" unless File.exist? @original_pathname
- @contents = File.new(@original_pathname).readlines
+ @contents = File.new(@original_pathname){ |f| f.readlines }
end
#search the file line by line and match each line with the given regex