class Rugged::Tree

Public Instance Methods

each_blob() { || ... } click to toggle source

Iterate over the blobs in this tree

# File lib/rugged/tree.rb, line 22
def each_blob
  self.each { |e| yield e if e[:type] == :blob }
end
each_tree() { || ... } click to toggle source

Iterat over the subtrees in this tree

# File lib/rugged/tree.rb, line 27
def each_tree
  self.each { |e| yield e if e[:type] == :tree }
end
inspect() click to toggle source
# File lib/rugged/tree.rb, line 5
def inspect
  data = "#<Rugged::Tree:#{object_id} {oid: #{oid}}>\n"
  self.each { |e| data << "  <\"#{e[:name]}\" #{e[:oid]}>\n" }
  data
end
walk_blobs(mode=:postorder) { |root, e| ... } click to toggle source

Walks the tree but only yields blobs

# File lib/rugged/tree.rb, line 12
def walk_blobs(mode=:postorder)
  self.walk(mode) { |root, e| yield root, e if e[:type] == :blob }
end
walk_trees(mode=:postorder) { |root, e| ... } click to toggle source

Walks the tree but only yields subtrees

# File lib/rugged/tree.rb, line 17
def walk_trees(mode=:postorder)
  self.walk(mode) { |root, e| yield root, e if e[:type] == :tree }
end