# File lib/git/lib.rb, line 343 def parse_config(file) hsh = {} file = File.expand_path(file) if File.file?(file) current_section = nil File.readlines(file).each do |line| if m = /\[(\w+)\]/.match(line) current_section = m[1] elsif m = /\[(\w+?) "(.*?)"\]/.match(line) current_section = "#{m[1]}.#{m[2]}" elsif m = /(\w+?) = (.*)/.match(line) key = "#{current_section}.#{m[1]}" hsh[key] = m[2] end end end hsh end