require_relative 'base_formatter'
class HTMLFormatter < BaseFormatter
def initialize(pReport)
super(pReport)
end
def process
puts ""
puts "
Checking Machines"
puts ""
puts ""
puts ''
@head.each do |key,value|
puts "- "+key.to_s+": "+value.to_s+"
" if key!=:title
end
puts '
'
puts ""
puts "Members | Grade | Fails |
"
puts ""
counter=0
@datagroups.each do |i|
counter+=1
puts ""+i.head[:members]+" | "
puts ""+i.tail[:grade].to_s+" | "
puts ""+i.tail[:fail_counter].to_s+" |
"
end
puts "
"
puts "Cases
"
counter=0
@datagroups.each do |i|
counter+=1
process_datagroup(i,counter)
end
puts ''
@tail.each do |key,value|
puts "- "+key.to_s+": "+value.to_s+"
"
end
puts '
'
puts ""
end
def process_datagroup(pGroup, pCounter)
puts ""
puts ""
puts "Params | Results |
"
puts ""
puts ""
pGroup.head.each do |key,value|
puts "- "+key.to_s+"= "+value.to_s+"
" if key!=:members
end
puts " | "
puts ''
pGroup.tail.each do |key,value|
puts "- "+key.to_s+"= "+value.to_s+"
"
end
puts ' | '
puts '
'
puts 'Test log
'
puts ''
pGroup.lines.each do |i|
if i.class.to_s=='Hash' then
value=0.0
value=i[:weight] if i[:check]
a="- "+i[:id].to_s+" ("+value.to_s+") [weight="+i[:weight].to_s+"] "
a+=""+i[:description]+": "+i[:command]+"
"
puts a
else
puts "- "+i.to_s+"
"
end
end
puts '
'
end
end