Sha256: 7603de3a3c23bd43eeb0ac8704c068e78f84bca4c37ea991ff22bcb3de251006

Contents?: true

Size: 825 Bytes

Versions: 1

Compression:

Stored size: 825 Bytes

Contents

require 'gruff'
module MetricFu
  
  class FlogGrapher
    
    attr_accessor :flog_total, :flog_average, :labels
    
    def initialize
      self.flog_total = []
      self.flog_average = []
      self.labels = {}
    end
    
    def get_metrics(metrics, date)
      self.flog_total.push(metrics[:flog][:total])
      self.flog_average.push(metrics[:flog][:average])
      self.labels.update( { self.labels.size => date })
    end
    
    def graph!
      g = Gruff::Line.new(MetricFu.graph_size)
      g.title = "Flog: code complexity"
      g.theme = MetricFu.graph_theme
      g.font = MetricFu.graph_font
      g.data('flog total', self.flog_total)
      g.data('flog average', self.flog_average)
      g.labels = self.labels
      g.write(File.join(MetricFu.output_directory, 'flog.png'))
    end
    
  end
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
edouard-metric_fu-1.0.4.3 lib/graphs/flog_grapher.rb