Class Chef::Util::FileEdit
In: lib/chef/util/file_edit.rb
Parent: Object

Methods

Attributes

contents  [RW] 
file_edited  [RW] 
original_pathname  [RW] 

Public Class methods

Public Instance methods

search the file line by line and match each line with the given regex if matched, insert newline after each matching line

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

search the file line by line and match each line with the given regex if matched, delete the match (all occurances) from the line

search the file line by line and match each line with the given regex if matched, delete the line

search the file line by line and match each line with the given regex if matched, replace the match (all occurances) with the replace parameter

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

Make a copy of old_file and write new file out (only if file changed)

[Validate]