Sha256: 422928e47f0a6e6aa09a08a47e91f294e09e78be92ea8746476334896456b2ec
Contents?: true
Size: 929 Bytes
Versions: 49
Compression:
Stored size: 929 Bytes
Contents
module Rugged class Tree include Enumerable attr_reader :owner alias repo owner def diff(other = nil, options = nil) Tree.diff(repo, self, other, options) end def inspect data = "#<Rugged::Tree:#{object_id} {oid: #{oid}}>\n" self.each { |e| data << " <\"#{e[:name]}\" #{e[:oid]}>\n" } data end # Walks the tree but only yields blobs def walk_blobs(mode=:postorder) self.walk(mode) { |root, e| yield root, e if e[:type] == :blob } end # Walks the tree but only yields subtrees def walk_trees(mode=:postorder) self.walk(mode) { |root, e| yield root, e if e[:type] == :tree } end # Iterate over the blobs in this tree def each_blob self.each { |e| yield e if e[:type] == :blob } end # Iterat over the subtrees in this tree def each_tree self.each { |e| yield e if e[:type] == :tree } end end end
Version data entries
49 entries across 49 versions & 2 rubygems