creates an archive of this object (tree)
# File lib/git/object.rb, line 65 65: def archive(file = nil, opts = {}) 66: @base.lib.archive(@objectish, file, opts) 67: end
Get the object’s contents. If no block is given, the contents are cached in memory and returned as a string. If a block is given, it yields an IO object (via IO::popen) which could be used to read a large file in chunks.
Use this for large files so that they are not held in memory.
# File lib/git/object.rb, line 35 35: def contents(&block) 36: if block_given? 37: @base.lib.object_contents(@objectish, &block) 38: else 39: @contents ||= @base.lib.object_contents(@objectish) 40: end 41: end
# File lib/git/object.rb, line 43 43: def contents_array 44: self.contents.split("\n") 45: end
# File lib/git/object.rb, line 56 56: def diff(objectish) 57: Git::Diff.new(@base, @objectish, objectish) 58: end
# File lib/git/object.rb, line 51 51: def grep(string, path_limiter = nil, opts = {}) 52: opts = {:object => sha, :path_limiter => path_limiter}.merge(opts) 53: @base.lib.grep(string, opts) 54: end
# File lib/git/object.rb, line 60 60: def log(count = 30) 61: Git::Log.new(@base, count).object(@objectish) 62: end
# File lib/git/object.rb, line 21 21: def sha 22: @sha ||= @base.lib.revparse(@objectish) 23: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.