class Puppet::Util::IniConfig::FileCollection

Attributes

files[R]

Public Instance Methods

[](name) click to toggle source
Alias for: get_section
add_section(name, file) click to toggle source
# File lib/puppet/util/inifile.rb, line 312
def add_section(name, file)
  get_physical_file(file).add_section(name)
end
each_file() { |path| ... } click to toggle source
# File lib/puppet/util/inifile.rb, line 291
def each_file(&block)
  @files.keys.each do |path|
    yield path
  end
end
each_section() { |section| ... } click to toggle source
# File lib/puppet/util/inifile.rb, line 283
def each_section(&block)
  @files.values.each do |file|
    file.sections.each do |section|
      yield section
    end
  end
end
get_section(name) click to toggle source
# File lib/puppet/util/inifile.rb, line 297
def get_section(name)
  sect = nil
  @files.values.each do |file|
    if (current = file.get_section(name))
      sect = current
    end
  end
  sect
end
Also aliased as: []
include?(name) click to toggle source
# File lib/puppet/util/inifile.rb, line 308
def include?(name)
  !! get_section(name)
end
read(file) click to toggle source

Read and parse a file and store it in the collection. If the file has already been read it will be destroyed and re-read.

# File lib/puppet/util/inifile.rb, line 273
def read(file)
  new_physical_file(file).read
end
store() click to toggle source
# File lib/puppet/util/inifile.rb, line 277
def store
  @files.values.each do |file|
    file.store
  end
end

Public Class Methods

new() click to toggle source
# File lib/puppet/util/inifile.rb, line 267
def initialize
  @files = {}
end