# File lib/smart_proxy_abrt/abrt_lib.rb, line 107 def initialize(fname) contents = IO.read(fname) json = JSON.parse(contents) [:report, :reported_at, :host].each do |field| if !json.has_key?(field.to_s) raise AbrtProxy::Error::SyntaxError, "Report #{fname} missing field #{field}" end end report = json["report"] hash = HostReport.duphash report ar = AggregatedReport.new(json["report"], 1, hash, json["reported_at"]) @reports = [ar] # index the array elements by duphash, if they have one @by_hash = {} @by_hash[hash] = ar unless hash.nil? @files = [fname] @host = json["host"] end