gitlab-org--gitlab-foss/app/models/tree.rb
2011-11-20 22:32:12 +02:00

24 lines
433 B
Ruby

class Tree
attr_accessor :path, :tree, :project, :ref
delegate :contents,
:basename,
:name,
:data,
:text?,
:colorize,
:to => :tree
def initialize(raw_tree, project, ref = nil, path = nil)
@project, @ref, @path = project, ref, path,
@tree = if path
raw_tree / path
else
raw_tree
end
end
def is_blob?
tree.is_a?(Grit::Blob)
end
end