8c5003cf75
* Network::Commit ** Removing unnecessary accessors. ** Removing add_refs methods. * Network::Graph ** Removing unnecessary accessors. ** The 3 times loop of commits don't need.
31 lines
534 B
Ruby
31 lines
534 B
Ruby
require "grit"
|
|
|
|
module Network
|
|
class Commit
|
|
include ActionView::Helpers::TagHelper
|
|
|
|
attr_reader :refs
|
|
attr_accessor :time, :spaces, :parent_spaces
|
|
|
|
def initialize(raw_commit, refs)
|
|
@commit = ::Commit.new(raw_commit)
|
|
@time = -1
|
|
@spaces = []
|
|
@parent_spaces = []
|
|
@refs = refs || []
|
|
end
|
|
|
|
def method_missing(m, *args, &block)
|
|
@commit.send(m, *args, &block)
|
|
end
|
|
|
|
def space
|
|
if @spaces.size > 0
|
|
@spaces.first
|
|
else
|
|
0
|
|
end
|
|
end
|
|
end
|
|
end
|