Sha256: 893c2c8d7fb93d2a13570d278fd2e25c7f847645c527329fcbd94e5764909e5c
Contents?: true
Size: 613 Bytes
Versions: 1
Compression:
Stored size: 613 Bytes
Contents
require_relative "../git-hack" module GitHack class CommitLineBuilder < LineBuilder def initialize(data,index) super(data,index) @is_message = false @commit = { 'masseg' => '', parent => []} end def process_line @is_message line = @data[@index] line = line.chomp if line = "" @is_message = !@is_message elsif is_message @commit.message << line+"\n" else data = line.split key = data.shift value = data.join(" ") if key == 'commit' @commit['sha'] = value end if key == 'parent' @commit[key] << value else end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
git-hack-0.0.1 | lib/git-hack/commit_line_builder.rb |