Parent

MetricFu::Churn

Public Class Methods

new(options={}) click to toggle source
# File lib/generators/churn.rb, line 5
def initialize(options={})
  super
end
verify_dependencies!() click to toggle source
# File lib/generators/churn.rb, line 9
def self.verify_dependencies!
  result = `churn --help`
  raise 'sudo gem install churn # if you want the churn tasks' unless result.match(/churn/)
end

Public Instance Methods

analyze() click to toggle source
# File lib/generators/churn.rb, line 21
def analyze
  if @output.match(/fatal: Not a git repository/)
    @churn = [:churn => {}]
  else
    @churn = YAML::load(@output)
  end
end
emit() click to toggle source
# File lib/generators/churn.rb, line 15
def emit
  @output = `churn --yaml`
  yaml_start = @output.index("---")
  @output = @output[yaml_start...@output.length] if yaml_start
end
to_h() click to toggle source
# File lib/generators/churn.rb, line 29
def to_h
  {:churn => @churn[:churn]}
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.