implement version-specific page find
This commit is contained in:
+4
-3
@@ -83,11 +83,12 @@ module Gollum
|
||||
|
||||
# Find a page in the given Gollum repo.
|
||||
#
|
||||
# name - The human or canonical String page name to find.
|
||||
# name - The human or canonical String page name to find.
|
||||
# version - The String version ID to find.
|
||||
#
|
||||
# Returns a Gollum::Page or nil if the page could not be found.
|
||||
def find(name)
|
||||
commit = self.wiki.repo.commits.first
|
||||
def find(name, version)
|
||||
commit = self.wiki.repo.commit(version)
|
||||
if page = find_page_in_tree(commit.tree, name)
|
||||
page.version = commit
|
||||
page
|
||||
|
||||
+4
-3
@@ -14,11 +14,12 @@ module Gollum
|
||||
|
||||
# Get the formatted page for a given page name.
|
||||
#
|
||||
# name - The human or canonical String page name of the wiki page.
|
||||
# name - The human or canonical String page name of the wiki page.
|
||||
# version - The String version ID to find (default: "master").
|
||||
#
|
||||
# Returns a Gollum::Page or nil if no matching page was found.
|
||||
def page(name)
|
||||
Page.new(self).find(name)
|
||||
def page(name, version = 'master')
|
||||
Page.new(self).find(name, version)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user