Class: StatsBuilder

Inherits:
Object
  • Object
show all
Includes:
Utils
Defined in:
lib/stats_builder.rb

Overview

Construction de la tache stats (statistiques du code Ruby)
author: Vincent Dubois
date: 06 fevrier 2009

Instance Method Summary collapse

Methods included from Utils

build_name, erb_run, flog_caracteristics, flog_score_to_css_style, percent_to_css_style, run_command, verify_gem_presence

Instance Method Details

#build(project_name, auto_install, proxy_option) ⇒ Object

Implementation de la construction de la tache



10
11
12
13
14
15
16
17
18
19
# File 'lib/stats_builder.rb', line 10

def build(project_name, auto_install, proxy_option)
  # On lance la generation
  puts " Building stats report..."
  stats_result = Utils.run_command("rake stats")
  stats_report = File.open("#{Continuous4r::WORK_DIR}/stats_body.html", "w")
  stats_formatter = StatsFormatter.new(stats_result)
  stats_report.write(stats_formatter.to_html)
  stats_report.close
  @percent = stats_formatter.percent
end

#quality_indicator_nameObject

Nom de l’indicateur de qualité



27
28
29
# File 'lib/stats_builder.rb', line 27

def quality_indicator_name
  "code-to-test ratio"
end

#quality_percentageObject

Methode qui permet d’extraire le pourcentage de qualité extrait d’un builder



22
23
24
# File 'lib/stats_builder.rb', line 22

def quality_percentage
  @percent
end