class PackageConfig
def parse_pc
def parse_pc raise NotFoundError, ".pc doesn't exist: <#{@name}>" unless exist? @variables = {} @declarations = {} File.open(pc_path) do |input| input.each_line do |line| if line.dup.force_encoding("UTF-8").valid_encoding? line.force_encoding("UTF-8") end line = line.gsub(/#.*/, "").strip next if line.empty? case line when /^(#{IDENTIFIER_RE})\s*=\s*/ @variables[$1] = $POSTMATCH.strip when /^(#{IDENTIFIER_RE})\s*:\s*/ @declarations[$1] = $POSTMATCH.strip end end end end