Sha256: af19fd90f31ae139a08f1b73746d1922aec584713262f2a50d60d9c9975d9e26

Contents?: true

Size: 494 Bytes

Versions: 5

Compression:

Stored size: 494 Bytes

Contents

module MetricFu

  class Churn < Generator

    def initialize(options={})
      super
    end
    
    def emit
      @output = `churn --yaml`
      yaml_start = @output.index("---")
      @output = @output[yaml_start...@output.length] if yaml_start
    end

    def analyze
      if @output.match(/fatal: Not a git repository/)
        @churn = [:churn => {}]
      else
        @churn = YAML::load(@output)
      end
    end

    def to_h
      {:churn => @churn[:churn]}
    end
  end

end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
goldstar-metric_fu-1.5.1.2 lib/generators/churn.rb
metric_fu-2.0.0 lib/generators/churn.rb
goldstar-metric_fu-1.5.1.1 lib/generators/churn.rb
metric_fu-1.5.1 lib/generators/churn.rb
metric_fu-1.5.0 lib/generators/churn.rb