Wiki#pages uses the treemap

This commit is contained in:
rick
2010-08-30 17:41:35 -07:00
parent 7e2b1fdbc6
commit 6dab4f7fe6
3 changed files with 31 additions and 26 deletions
+17 -1
View File
@@ -22,11 +22,27 @@ module Gollum
@name ||= ::File.basename(@path)
end
# Gets the Grit::Blob instance for this blob.
# Gets a Grit::Blob instance for this blob.
#
# repo - Grit::Repo instance for the Grit::Blob.
#
# Returns an unbaked Grit::Blob instance.
def blob(repo)
@blob ||= Grit::Blob.create(repo, :id => @sha, :name => @name)
end
# Gets a Page instance for this blob.
#
# wiki - Gollum::Wiki instance for the Gollum::Page
#
# Returns a Gollum::Page instance.
def page(wiki, commit)
blob = self.blob(wiki.repo)
page = wiki.page_class.new(wiki).populate(blob, self.dir)
page.version = commit
page
end
# Normalizes a given directory name for searching through tree paths.
# Ensures that a directory begins with a slash, or
#