Class: ErrorReport

Inherits:
GenericReport show all
Defined in:
lib/pqa.rb

Instance Method Summary collapse

Methods inherited from GenericReport

#colorize, #initialize, #pctg_of, #round

Constructor Details

This class inherits a constructor from GenericReport

Instance Method Details

#applicableObject



1116
1117
1118
# File 'lib/pqa.rb', line 1116

def applicable
  !@log.errors.empty?
end

#htmlObject



1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
# File 'lib/pqa.rb', line 1126

def html
  rpt = "<h3>#{title}</h3>\n"
  rpt << "<table><tr><th>Error</th><th>Offending query</th>\n"
  @log.errors.each {|x|
      message = "<p>#{x.error}</p>" + (x.detail.size > 0 ? "<p>DETAIL : #{x.detail}</p>" : '') + \
             (x.hint.size > 0 ? "<p>HINT : #{x.hint}</p>" : '')
      rpt << "<tr><td>#{message}</td><td>#{colorize(x.text)}</td></tr>\n" 
  }
  rpt << "</table>\n"
end

#textObject



1120
1121
1122
1123
1124
# File 'lib/pqa.rb', line 1120

def text
  rpt = "######## #{title}\n"
  @log.errors.each {|x| rpt << "#{x.error} : #{x.text}\n" }
  rpt
end

#titleObject



1112
1113
1114
# File 'lib/pqa.rb', line 1112

def title  
  "Errors"
end