class Git::Object::AbstractObject
def archive(file = nil, opts = {})
def archive(file = nil, opts = {}) @base.lib.archive(@objectish, file, opts) end
def blob?; false; end
def blob?; false; end
def commit?; false; end
def commit?; false; end
def contents(&block)
read a large file in chunks.
If a block is given, it yields an IO object (via IO::popen) which could be used to
If no block is given, the contents are cached in memory and returned as a string.
Get the object's contents.
def contents(&block) if block_given? @base.lib.cat_file_contents(@objectish, &block) else @contents ||= @base.lib.cat_file_contents(@objectish) end end
def contents_array
def contents_array self.contents.split("\n") end
def diff(objectish)
def diff(objectish) Git::Diff.new(@base, @objectish, objectish) end
def grep(string, path_limiter = nil, opts = {})
def grep(string, path_limiter = nil, opts = {}) opts = {:object => sha, :path_limiter => path_limiter}.merge(opts) @base.lib.grep(string, opts) end
def initialize(base, objectish)
def initialize(base, objectish) @base = base @objectish = objectish.to_s @contents = nil @trees = nil @size = nil @sha = nil end
def log(count = 30)
def log(count = 30) Git::Log.new(@base, count).object(@objectish) end
def sha
def sha @sha ||= @base.lib.rev_parse(@objectish) end
def size
def size @size ||= @base.lib.cat_file_size(@objectish) end
def tag?; false; end
def tag?; false; end
def to_s
def to_s @objectish end
def tree?; false; end
def tree?; false; end