Sha256: 9da0662aed2e8e38a8f006deb355ef696845017b9a5670b4d43386c228bca7eb

Contents?: true

Size: 696 Bytes

Versions: 8

Compression:

Stored size: 696 Bytes

Contents

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

#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

8 entries across 8 versions & 1 rubygems

Version Path
churn-0.0.11 bin/churn
churn-0.0.10 bin/churn
churn-0.0.9 bin/churn
churn-0.0.8 bin/churn
churn-0.0.7 bin/churn
churn-0.0.6 bin/churn
churn-0.0.5 bin/churn
churn-0.0.4 bin/churn