Method: Puppet::Settings::IniFile#insert_after

Defined in:
lib/puppet/settings/ini_file.rb

#insert_after(line, new_line) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



48
49
50
51
52
53
54
55
56
# File 'lib/puppet/settings/ini_file.rb', line 48

def insert_after(line, new_line)
  new_line.previous = line

  insertion_point = @lines.index(line)
  @lines.insert(insertion_point + 1, new_line)
  if @lines.length > insertion_point + 2
    @lines[insertion_point + 2].previous = new_line
  end
end