diff options
author | Matt <code@deployable.org> | 2013-12-04 15:50:46 +0000 |
---|---|---|
committer | Matt <code@deployable.org> | 2013-12-04 15:50:46 +0000 |
commit | 13eaf3d1924b56c80c4509398fd7d099a78da0cc (patch) | |
tree | 802d697ed5de432c58caf46ef9d4fb66fd3bdda5 /lib/chef/util | |
parent | ecbc917ac5496f3138b798332ea66f477c33f8ba (diff) | |
download | chef-13eaf3d1924b56c80c4509398fd7d099a78da0cc.tar.gz |
CHEF-4850 Close file in Chef::File::Edit after reading contents
Diffstat (limited to 'lib/chef/util')
-rw-r--r-- | lib/chef/util/file_edit.rb | 2 |
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 |