Sha256: 5899ae5ac8050f42d023b79413fac5fa1461393a058beb7b6ef64d9e34da75b1

Contents?: true

Size: 1.27 KB

Versions: 1

Compression:

Stored size: 1.27 KB

Contents

#!/usr/bin/env ruby

require_relative '../lib/pair_see/seer'
require 'trollop'

opts = Trollop.options do
  opt :root, 'Folder in which .git folder is', default: '.'
  opt :config, 'location of config file, example: ../../config/config.yml', default: "#{__FILE__}/../../config/config.yml"
  opt :after, 'Date since which you want to get commits, in yyyy-mm-dd format', default: '0-1-1'
  opt :extras, 'See all commits without the name of any dev in them', default: false
  opt :latest, 'See dates of most recent commits by pairs', default: false
  opt :recommended, 'See active devs who have not paired (and therefore should)', default: false
  opt :cards, 'See cards and number of commits on each', default: false
  opt :cards_per_person, 'See cards for each dev', default: false
end

def run_command(opts)
  log_lines = PairSee::LogLines.new(opts[:root], opts[:after])

  pair_see = PairSee::Seer.new(log_lines, opts[:config])
  if opts[:extras]
    pair_see.commits_not_by_known_pair
  elsif opts[:latest]
    pair_see.all_most_recent_commits
  elsif opts[:recommended]
    pair_see.recommended_pairings
  elsif opts[:cards]
    pair_see.pretty_card_data
  elsif opts[:cards_per_person]
    pair_see.cards_per_person
  else
    pair_see.all_commits
  end
end

puts run_command(opts).join("\n")

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pair_see-0.1.1 bin/pairsee