diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2014-02-10 17:01:11 -0800 |
---|---|---|
committer | Lamont Granquist <lamont@scriptkiddie.org> | 2014-02-11 18:21:31 -0800 |
commit | 9e99c4bb73ba0c4b34991f2db352241016bf3976 (patch) | |
tree | daa410867770fcf7ac4d8f2e9c7edefebfe2c088 | |
parent | 17307a586520481ea5481ecbe357c19e20fbe7b2 (diff) | |
download | chef-9e99c4bb73ba0c4b34991f2db352241016bf3976.tar.gz |
CHEF-5018: fix File.new does not take a block
-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 3f354124b3..bb19435a12 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){ |f| f.readlines } + @contents = File.open(@original_pathname) { |f| f.readlines } end #search the file line by line and match each line with the given regex |