This commit is contained in:
rick
2010-09-30 15:36:14 -07:00
parent 5e59e39d67
commit cc929bbc56
+17 -9
View File
@@ -279,15 +279,6 @@ module Gollum
end
end
def find_page_from_name(cname)
if page = @wiki.page(cname)
return page
end
if pos = cname.index('#')
[@wiki.page(cname[0...pos]), cname[pos..-1]]
end
end
# Find the given file in the repo.
#
# name - The String absolute or relative path of the file.
@@ -302,6 +293,23 @@ module Gollum
end
end
# Find a page from a given cname. If the page has an anchor (#) and has
# no match, strip the anchor and try again.
#
# cname - The String canonical page name.
#
# Returns a Gollum::Page instance if a page is found, or an Array of
# [Gollum::Page, String extra] if a page without the extra anchor data
# is found.
def find_page_from_name(cname)
if page = @wiki.page(cname)
return page
end
if pos = cname.index('#')
[@wiki.page(cname[0...pos]), cname[pos..-1]]
end
end
#########################################################################
#
# Code