Class: ErrorReport
Instance Method Summary
collapse
#colorize, #initialize, #pctg_of, #round
Constructor Details
This class inherits a constructor from GenericReport
Instance Method Details
#applicable ⇒ Object
1116
1117
1118
|
# File 'lib/pqa.rb', line 1116
def applicable
!@log.errors.empty?
end
|
#html ⇒ Object
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
|
#text ⇒ Object
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
|
#title ⇒ Object
1112
1113
1114
|
# File 'lib/pqa.rb', line 1112
def title
"Errors"
end
|