lib/stats_formatter.rb in continuous4r-0.0.3 vs lib/stats_formatter.rb in continuous4r-0.0.4

- old
+ new

@@ -2,11 +2,12 @@ # Classe de formatage des resultats renvoyes par rake stats # Author: Vincent Dubois # ========================================================= class StatsFormatter attr_accessor :result - + attr_reader :percent + # Constructeur def initialize result self.result = result end @@ -42,9 +43,10 @@ end html = html + "</tr>" html = html + "</tbody></table>" extra = results[bottom + 3] elements = extra.split(/:| /) + @percent = (elements[3].strip.to_f * 100.0) / elements[1].strip.to_f html = html + "<p><strong>#{elements[0]} : </strong>#{elements[1]}&#160;&#160;&#160;&#160;&#160;&#160;" html = html + "<strong>#{elements[2]} : </strong>#{elements[3]}&#160;&#160;&#160;&#160;&#160;&#160;" html = html + "<strong>#{elements[4]} : </strong>#{elements[5]}:#{elements[6]}</p><br/>" end end