Class: MetricFu::RcovGrapher
- Defined in:
- lib/graphs/rcov_grapher.rb
Instance Attribute Summary collapse
-
#labels ⇒ Object
Returns the value of attribute labels.
-
#rcov_percent ⇒ Object
Returns the value of attribute rcov_percent.
Instance Method Summary collapse
- #get_metrics(metrics, date) ⇒ Object
- #graph! ⇒ Object
-
#initialize ⇒ RcovGrapher
constructor
A new instance of RcovGrapher.
Methods inherited from Grapher
Constructor Details
#initialize ⇒ RcovGrapher
Returns a new instance of RcovGrapher.
7 8 9 10 11 |
# File 'lib/graphs/rcov_grapher.rb', line 7 def initialize super self.rcov_percent = [] self.labels = {} end |
Instance Attribute Details
#labels ⇒ Object
Returns the value of attribute labels.
5 6 7 |
# File 'lib/graphs/rcov_grapher.rb', line 5 def labels @labels end |
#rcov_percent ⇒ Object
Returns the value of attribute rcov_percent.
5 6 7 |
# File 'lib/graphs/rcov_grapher.rb', line 5 def rcov_percent @rcov_percent end |
Instance Method Details
#get_metrics(metrics, date) ⇒ Object
13 14 15 16 |
# File 'lib/graphs/rcov_grapher.rb', line 13 def get_metrics(metrics, date) self.rcov_percent.push(metrics[:rcov][:global_percent_run]) self.labels.update( { self.labels.size => date }) end |
#graph! ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/graphs/rcov_grapher.rb', line 18 def graph! g = Gruff::Line.new(MetricFu.graph_size) g.title = "Rcov: code coverage" g.theme = MetricFu.graph_theme g.font = MetricFu.graph_font g.data('rcov', self.rcov_percent) g.labels = self.labels g.title_font_size = MetricFu.graph_title_font_size g.legend_box_size = MetricFu.graph_legend_box_size g.legend_font_size = MetricFu.graph_legend_font_size g.marker_font_size = MetricFu.graph_marker_font_size g.write(File.join(MetricFu.output_directory, 'rcov.png')) end |