# File lib/chef/util/editor.rb, line 28 def append_line_after(search, line_to_append) lines = [] @lines.each do |line| lines << line lines << line_to_append if line.match(search) end (lines.length - @lines.length).tap { @lines = lines } end
# File lib/chef/util/editor.rb, line 39 def append_line_if_missing(search, line_to_append) count = 0 unless @lines.find { |line| line.match(search) } count = 1 @lines << line_to_append end count end
# File lib/chef/util/editor.rb, line 50 def remove_lines(search) count = 0 @lines.delete_if do |line| count += 1 if line.match(search) end count end
Generated with the Darkfish Rdoc Generator 2.