Sha256: 02869407975576e5e1fb668a917d5bae15ef333b028b55ed510fb6d4b13fbf2d

Contents?: true

Size: 711 Bytes

Versions: 9

Compression:

Stored size: 711 Bytes

Contents

#! /usr/bin/env ruby
require 'main'
require 'yaml'

#example usage. In the root of a project 'churn', or 'churn --help'
Main do
  option('minimum_churn_count', 'c') do
    argument :required
    cast :int
    default 3
  end

  option('yaml', 'y') do
    cast :boolean
    default false
  end

  def report_churn(output_string)
    require File.join(File.dirname(__FILE__), '..', 'lib', 'churn', 'churn_calculator')
    result = Churn::ChurnCalculator.new({:minimum_churn_count => params['minimum_churn_count'].value}).report(output_string)
    unless output_string
      result = YAML::dump(result)
    end
    result
  end

  def run
    report = report_churn(!params['yaml'].value)
    puts report
  end

end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
churn-0.0.20 bin/churn
churn-0.0.19 bin/churn
rferraz-churn-0.0.19 bin/churn
rferraz-churn-0.0.17 bin/churn
rferraz-churn-0.0.16 bin/churn
churn-0.0.15 bin/churn
churn-0.0.14 bin/churn
churn-0.0.13 bin/churn
churn-0.0.12 bin/churn