Method: Spoom::Git.parse_commit

Defined in:
lib/spoom/git.rb

.parse_commit(string) ⇒ Object



121
122
123
124
125
126
127
# File 'lib/spoom/git.rb', line 121

def parse_commit(string)
  sha, epoch = string.split(" ", 2)
  return nil unless sha && epoch

  time = Time.strptime(epoch, "%s")
  Commit.new(sha: sha, time: time)
end