Class: Codescout::CommitStats

Inherits:
Object
  • Object
show all
Defined in:
lib/codescout/commit_stats.rb

Instance Method Summary collapse

Constructor Details

#initialize(analyzer) ⇒ CommitStats

Returns a new instance of CommitStats.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/codescout/commit_stats.rb', line 7

def initialize(analyzer)
  git = Git.open(".", log: Logger.new(STDERR))
  commit = git.gcommit("HEAD")

  @hash = {
    commit:          commit.sha,
    author:          commit.author.name,
    author_email:    commit.author.email,
    committer:       commit.committer.name,
    committer_email: commit.committer.email,
    branch:          commit.name,
    message:         commit.message
  }
end

Instance Method Details

#to_hashObject



22
23
24
# File 'lib/codescout/commit_stats.rb', line 22

def to_hash
  @hash
end