Method: Chef::Util::FileEdit#insert_line_if_no_match

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

#insert_line_if_no_match(regex, newline) ⇒ Object

search the file line by line and match each line with the given regex if not matched, insert newline at the end of the file



76
77
78
# File 'lib/chef/util/file_edit.rb', line 76

def insert_line_if_no_match(regex, newline)
  @changes = (editor.append_line_if_missing(regex, newline) > 0) || @changes
end