class Bringit::CommitStats

Attributes

additions[R]
deletions[R]
id[R]
total[R]

Public Class Methods

new(commit) click to toggle source

Instantiate a CommitStats object

# File lib/bringit/commit_stats.rb, line 8
def initialize(commit)
  @id = commit.id
  @additions = 0
  @deletions = 0
  @total = 0

  diff = commit.diff_from_parent

  diff.each_patch do |p|
    # TODO: Use the new Rugged convenience methods when they're released
    @additions += p.stat[0]
    @deletions += p.stat[1]
    @total += p.changes
  end
end