gitlabhq/app/models/network/commit.rb
Sato Hiroyuki 8c5003cf75 Refactor: clean up models.
* Network::Commit
** Removing unnecessary accessors.
** Removing add_refs methods.
* Network::Graph
** Removing unnecessary accessors.
** The 3 times loop of commits don't need.
2013-03-07 17:56:01 +09:00

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