# ================================================ # Classe de formatage de resultat renvoye par flog # Author: Vincent Dubois # ================================================ class FlogFormatter attr_accessor :results # Constructeur def initialize results self.results = results end # Methode qui permet de fabriquer le flux HTML a partir du flux console flog def to_html lines = self.results.split(/$/) total_score = lines[0].split(" = ")[1] html = "
Element | Score | " total_score = line.split(': ')[1] total_score = total_score.split(/\(|\)/) html = html + "
---|---|
#{line.split(': ')[0]} | #{total_score} |
#{line.split(': ')[1]} | #{line.split(': ')[0]} |