class Selenium::WebDriver::Firefox::ProfilesIni

def parse

def parse
  string      = File.read @ini_path
  name        = nil
  is_relative = nil
  path        = nil
  string.split("\n").each do |line|
    case line
    when /^\[Profile/
      name, path = nil if path_for(name, is_relative, path)
    when /^Name=(.+)$/
      name = Regexp.last_match(1).strip
    when /^IsRelative=(.+)$/
      is_relative = Regexp.last_match(1).strip == '1'
    when /^Path=(.+)$/
      path = Regexp.last_match(1).strip
      p = path_for(name, is_relative, path)
      @profile_paths[name] = p if p
    end
  end
end