Class: Middleman::VCSTime::Git::ResourceIncludes::Numstats

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/middleman-vcs-time/systems/git.rb

Overview

Parsed numstat log

Defined Under Namespace

Classes: Commit

Constant Summary collapse

GIT_NUMSTAT =
%w(git log --follow --numstat --format=%at --).freeze

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Numstats

Returns a new instance of Numstats.



37
38
39
# File 'lib/middleman-vcs-time/systems/git.rb', line 37

def initialize(path)
  @raw = IO.popen(GIT_NUMSTAT + [path])
end

Instance Method Details

#eachObject



41
42
43
# File 'lib/middleman-vcs-time/systems/git.rb', line 41

def each
  @raw.each_line.each_slice(3) { |entry| yield Commit.new(entry) }
end