process_sections

in itchef/cookbooks/cpe_chrome/scripts/windows_policy_gen.rb [22:55]


def process_sections(settings, ini)
  ini.sections.each do |s|
    is_iterable_setting = ini[s].
                          keys.
                          map { |x| /^"\d+"$/.match?(x) }.
                          all?

    if is_iterable_setting
      setting = s.split('\\').last
      settings[setting] = WindowsChromeIterableSetting.new(
        s,
        nil,
        :string,
        true,
      )
      next
    end

    ini[s].map do |k, v|
      
      
      type = if v =~ /dword:.*/
               :dword
             else
               :string
             end
      setting = k.tr('"', '')
      settings[setting] = WindowsChromeFlatSetting.new(
        s, setting, type, false
      )
    end
  end
end