Sha256: 81daca1e0509fe879b393fa833a7dad46683ea5e6e4389e5069c68d8a7575b0b
Contents?: true
Size: 815 Bytes
Versions: 9
Compression:
Stored size: 815 Bytes
Contents
module MetricFu class ChurnGenerator < Generator def self.metric :churn end ### # options available are what can be passed to churn_calculator # https://github.com/danmayer/churn#library-options ### def emit @output = run(options) end def analyze if @output.nil? || @output.size.zero? @churn = { churn: {} } else @churn = @output end @churn end # ensure hash only has the :churn key def to_h { churn: @churn[:churn] } end # @param args [Hash] churn metric run options # @return [Hash] churn results def run(args) # @note passing in false to report will return a hash # instead of the default String ::Churn::ChurnCalculator.new(args).report(false) end end end
Version data entries
9 entries across 9 versions & 3 rubygems