class Graal::TreeBlob

Attributes

path[R]
revision[R]

Public Class Methods

new(backend, revision, path, gitid = nil) click to toggle source
# File lib/graal/tree_blob.rb, line 9
def initialize(backend, revision, path, gitid = nil)
   @backend = backend
   @revision = revision || 'master'
   @path = path || ''
   @gitid = gitid
end

Public Instance Methods

abbrev(n = 8) click to toggle source
# File lib/graal/tree_blob.rb, line 21
def abbrev(n = 8)
   gitid[0...n]
end
blob?() click to toggle source
# File lib/graal/tree_blob.rb, line 29
def blob?
   is_a? Blob
end
git_hash()
Alias for: gitid
gitid() click to toggle source
# File lib/graal/tree_blob.rb, line 16
def gitid
   @gitid ||= @backend.gitid_for(@revision, @path)
end
Also aliased as: git_hash
history(n = nil, skip = nil) click to toggle source
# File lib/graal/tree_blob.rb, line 37
def history(n = nil, skip = nil)
   history = log
   history = log.number(n)  unless n.nil?
   history = log.skip(skip) unless skip.nil?
   history.to_a
end
log() click to toggle source
# File lib/graal/tree_blob.rb, line 33
def log
   Log.new(@backend, @revision, @path)
end
tree?() click to toggle source
# File lib/graal/tree_blob.rb, line 25
def tree?
   is_a? Tree
end