Method: Chef::Util::FileEdit#search_file_replace_line

Defined in:
lib/chef/util/file_edit.rb

#search_file_replace_line(regex, newline) ⇒ Object

search the file line by line and match each line with the given regex if matched, replace the whole line with newline.



46
47
48
# File 'lib/chef/util/file_edit.rb', line 46

def search_file_replace_line(regex, newline)
  @changes = (editor.replace_lines(regex, newline) > 0) || @changes
end