class Gollum::Git::Tree

Public Class Methods

new(tree) click to toggle source
# File lib/grit_adapter/git_layer_grit.rb, line 359
def initialize(tree)
  @tree = tree
end

Public Instance Methods

/(file) click to toggle source

if index.current_tree && tree = index.current_tree / (@wiki.page_file_dir || '/')

# File lib/grit_adapter/git_layer_grit.rb, line 376
def /(file)
  result = @tree.send(:/, file)
  case result
  when Grit::Blob
    return Gollum::Git::Blob.new(result)
  when Grit::Tree
    return Gollum::Git::Tree.new(result)
  else
    nil
  end
end
[](i) click to toggle source
# File lib/grit_adapter/git_layer_grit.rb, line 367
def [](i)
  @tree[i]
end
blobs() click to toggle source
# File lib/grit_adapter/git_layer_grit.rb, line 388
def blobs
  return Array.new if @tree == {}
  @tree.blobs.map{|blob| Gollum::Git::Blob.new(blob) }
end
id() click to toggle source
# File lib/grit_adapter/git_layer_grit.rb, line 371
def id
  @tree.id
end
keys() click to toggle source
# File lib/grit_adapter/git_layer_grit.rb, line 363
def keys
  @tree.keys
end