mark stuff as private in tomdoc and organize a bit better

This commit is contained in:
Tom Preston-Werner
2010-04-17 16:19:13 -04:00
parent d1f6c24c3a
commit 78a9396421
2 changed files with 53 additions and 43 deletions
+7 -1
View File
@@ -18,7 +18,13 @@ module Gollum
self.blob.data rescue nil
end
# Find a file in the given Gollum repo.
#########################################################################
#
# Private
#
#########################################################################
# Private: Find a file in the given Gollum repo.
#
# name - The full String path.
# version - The String version ID to find.
+46 -42
View File
@@ -4,23 +4,6 @@ module Gollum
attr_accessor :wiki, :blob, :path, :version
# Convert a format Symbol into an extension String.
#
# format - The format Symbol.
#
# Returns the String extension (no leading period).
def self.format_to_ext(format)
case format
when :markdown then 'md'
when :textile then 'textile'
when :rdoc then 'rdoc'
when :org then 'org'
when :rest then 'rest'
when :asciidoc then 'asciidoc'
when :pod then 'pod'
end
end
# Initialize a page.
#
# wiki - The Gollum::Wiki in question.
@@ -30,18 +13,6 @@ module Gollum
self.wiki = wiki
end
# Populate this Page with information from the Blob.
#
# blob - The Grit::Blob that contains the info.
# path - The String directory path of the page file.
#
# Returns the populated Gollum::Page.
def populate(blob, path)
self.blob = blob
self.path = (path + '/' + blob.name)[1..-1]
self
end
# The on-disk filename of the page.
#
# Returns the String name.
@@ -49,13 +20,6 @@ module Gollum
self.blob.name rescue nil
end
# The formatted contents of the page.
#
# Returns the String data.
def formatted_data
GitHub::Markup.render(self.blob.name, self.blob.data) rescue nil
end
# The raw contents of the page.
#
# Returns the String data.
@@ -63,6 +27,13 @@ module Gollum
self.blob.data rescue nil
end
# The formatted contents of the page.
#
# Returns the String data.
def formatted_data
GitHub::Markup.render(self.blob.name, self.blob.data) rescue nil
end
# The format of the page.
#
# Returns the Symbol format of the page. One of:
@@ -98,7 +69,30 @@ module Gollum
@wiki.repo.log('master', self.path)
end
# Find a page in the given Gollum repo.
#########################################################################
#
# Private
#
#########################################################################
# Private: Convert a format Symbol into an extension String.
#
# format - The format Symbol.
#
# Returns the String extension (no leading period).
def self.format_to_ext(format)
case format
when :markdown then 'md'
when :textile then 'textile'
when :rdoc then 'rdoc'
when :org then 'org'
when :rest then 'rest'
when :asciidoc then 'asciidoc'
when :pod then 'pod'
end
end
# Private: Find a page in the given Gollum repo.
#
# name - The human or canonical String page name to find.
# version - The String version ID to find.
@@ -114,9 +108,7 @@ module Gollum
end
end
# private
# Find a page in a given tree.
# Private: Find a page in a given tree.
#
# tree - The Grit::Tree in which to look.
# name - The canonical String page name.
@@ -144,7 +136,19 @@ module Gollum
return nil # nothing was found
end
# The full directory path for the given tree.
# Private: Populate this Page with information from the Blob.
#
# blob - The Grit::Blob that contains the info.
# path - The String directory path of the page file.
#
# Returns the populated Gollum::Page.
def populate(blob, path)
self.blob = blob
self.path = (path + '/' + blob.name)[1..-1]
self
end
# Private: The full directory path for the given tree.
#
# treemap - The Hash treemap containing parentage information.
# tree - The Grit::Tree for which to compute the path.
@@ -158,7 +162,7 @@ module Gollum
end
end
# Compare the canonicalized versions of the two names.
# Private: Compare the canonicalized versions of the two names.
#
# name - The human or canonical String page name.
# filename - the String filename on disk (including extension).