mark stuff as private in tomdoc and organize a bit better
This commit is contained in:
+7
-1
@@ -18,7 +18,13 @@ module Gollum
|
|||||||
self.blob.data rescue nil
|
self.blob.data rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# Find a file in the given Gollum repo.
|
#########################################################################
|
||||||
|
#
|
||||||
|
# Private
|
||||||
|
#
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
# Private: Find a file in the given Gollum repo.
|
||||||
#
|
#
|
||||||
# name - The full String path.
|
# name - The full String path.
|
||||||
# version - The String version ID to find.
|
# version - The String version ID to find.
|
||||||
|
|||||||
+46
-42
@@ -4,23 +4,6 @@ module Gollum
|
|||||||
|
|
||||||
attr_accessor :wiki, :blob, :path, :version
|
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.
|
# Initialize a page.
|
||||||
#
|
#
|
||||||
# wiki - The Gollum::Wiki in question.
|
# wiki - The Gollum::Wiki in question.
|
||||||
@@ -30,18 +13,6 @@ module Gollum
|
|||||||
self.wiki = wiki
|
self.wiki = wiki
|
||||||
end
|
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.
|
# The on-disk filename of the page.
|
||||||
#
|
#
|
||||||
# Returns the String name.
|
# Returns the String name.
|
||||||
@@ -49,13 +20,6 @@ module Gollum
|
|||||||
self.blob.name rescue nil
|
self.blob.name rescue nil
|
||||||
end
|
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.
|
# The raw contents of the page.
|
||||||
#
|
#
|
||||||
# Returns the String data.
|
# Returns the String data.
|
||||||
@@ -63,6 +27,13 @@ module Gollum
|
|||||||
self.blob.data rescue nil
|
self.blob.data rescue nil
|
||||||
end
|
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.
|
# The format of the page.
|
||||||
#
|
#
|
||||||
# Returns the Symbol format of the page. One of:
|
# Returns the Symbol format of the page. One of:
|
||||||
@@ -98,7 +69,30 @@ module Gollum
|
|||||||
@wiki.repo.log('master', self.path)
|
@wiki.repo.log('master', self.path)
|
||||||
end
|
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.
|
# name - The human or canonical String page name to find.
|
||||||
# version - The String version ID to find.
|
# version - The String version ID to find.
|
||||||
@@ -114,9 +108,7 @@ module Gollum
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# private
|
# Private: Find a page in a given tree.
|
||||||
|
|
||||||
# Find a page in a given tree.
|
|
||||||
#
|
#
|
||||||
# tree - The Grit::Tree in which to look.
|
# tree - The Grit::Tree in which to look.
|
||||||
# name - The canonical String page name.
|
# name - The canonical String page name.
|
||||||
@@ -144,7 +136,19 @@ module Gollum
|
|||||||
return nil # nothing was found
|
return nil # nothing was found
|
||||||
end
|
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.
|
# treemap - The Hash treemap containing parentage information.
|
||||||
# tree - The Grit::Tree for which to compute the path.
|
# tree - The Grit::Tree for which to compute the path.
|
||||||
@@ -158,7 +162,7 @@ module Gollum
|
|||||||
end
|
end
|
||||||
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.
|
# name - The human or canonical String page name.
|
||||||
# filename - the String filename on disk (including extension).
|
# filename - the String filename on disk (including extension).
|
||||||
|
|||||||
Reference in New Issue
Block a user