use new-style Public: instead of Private: to denote API
This commit is contained in:
+4
-4
@@ -1,6 +1,6 @@
|
|||||||
module Gollum
|
module Gollum
|
||||||
class File
|
class File
|
||||||
# Initialize a file.
|
# Public: Initialize a file.
|
||||||
#
|
#
|
||||||
# wiki - The Gollum::Wiki in question.
|
# wiki - The Gollum::Wiki in question.
|
||||||
#
|
#
|
||||||
@@ -10,14 +10,14 @@ module Gollum
|
|||||||
@blob = nil
|
@blob = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# The raw contents of the page.
|
# Public: The raw contents of the page.
|
||||||
#
|
#
|
||||||
# Returns the String data.
|
# Returns the String data.
|
||||||
def raw_data
|
def raw_data
|
||||||
@blob.data rescue nil
|
@blob.data rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# The Grit::Commit version of the file.
|
# Public: The Grit::Commit version of the file.
|
||||||
attr_reader :version
|
attr_reader :version
|
||||||
|
|
||||||
#########################################################################
|
#########################################################################
|
||||||
@@ -26,7 +26,7 @@ module Gollum
|
|||||||
#
|
#
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
# Private: Find a file in the given Gollum repo.
|
# 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.
|
||||||
|
|||||||
+15
-15
@@ -2,7 +2,7 @@ module Gollum
|
|||||||
class Page
|
class Page
|
||||||
VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|re?st(\.txt)?|asciidoc|pod|\d)$/i
|
VALID_PAGE_RE = /^(.+)\.(md|mkdn?|mdown|markdown|textile|rdoc|org|re?st(\.txt)?|asciidoc|pod|\d)$/i
|
||||||
|
|
||||||
# Initialize a page.
|
# Public: Initialize a page.
|
||||||
#
|
#
|
||||||
# wiki - The Gollum::Wiki in question.
|
# wiki - The Gollum::Wiki in question.
|
||||||
#
|
#
|
||||||
@@ -12,31 +12,31 @@ module Gollum
|
|||||||
@blob = nil
|
@blob = nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# The on-disk filename of the page.
|
# Public: The on-disk filename of the page.
|
||||||
#
|
#
|
||||||
# Returns the String name.
|
# Returns the String name.
|
||||||
def name
|
def name
|
||||||
@blob.name rescue nil
|
@blob.name rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# The String full path of the page.
|
# Public: The String full path of the page.
|
||||||
attr_reader :path
|
attr_reader :path
|
||||||
|
|
||||||
# The raw contents of the page.
|
# Public: The raw contents of the page.
|
||||||
#
|
#
|
||||||
# Returns the String data.
|
# Returns the String data.
|
||||||
def raw_data
|
def raw_data
|
||||||
@blob.data rescue nil
|
@blob.data rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# The formatted contents of the page.
|
# Public: The formatted contents of the page.
|
||||||
#
|
#
|
||||||
# Returns the String data.
|
# Returns the String data.
|
||||||
def formatted_data
|
def formatted_data
|
||||||
GitHub::Markup.render(@blob.name, @blob.data) rescue nil
|
GitHub::Markup.render(@blob.name, @blob.data) rescue nil
|
||||||
end
|
end
|
||||||
|
|
||||||
# The format of the page.
|
# Public: The format of the page.
|
||||||
#
|
#
|
||||||
# Returns the Symbol format of the page. One of:
|
# Returns the Symbol format of the page. One of:
|
||||||
# [ :markdown | :textile | :rdoc | :org | :rest | :asciidoc | :pod |
|
# [ :markdown | :textile | :rdoc | :org | :rest | :asciidoc | :pod |
|
||||||
@@ -64,10 +64,10 @@ module Gollum
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# The Grit::Commit version of the page.
|
# Public: The Grit::Commit version of the page.
|
||||||
attr_reader :version
|
attr_reader :version
|
||||||
|
|
||||||
# All of the versions that have touched this Page.
|
# Public: All of the versions that have touched this Page.
|
||||||
#
|
#
|
||||||
# Returns an Array of Grit::Commit.
|
# Returns an Array of Grit::Commit.
|
||||||
def versions
|
def versions
|
||||||
@@ -80,10 +80,10 @@ module Gollum
|
|||||||
#
|
#
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
# Private: The Grit::Commit version of the page.
|
# The Grit::Commit version of the page.
|
||||||
attr_writer :version
|
attr_writer :version
|
||||||
|
|
||||||
# Private: Convert a format Symbol into an extension String.
|
# Convert a format Symbol into an extension String.
|
||||||
#
|
#
|
||||||
# format - The format Symbol.
|
# format - The format Symbol.
|
||||||
#
|
#
|
||||||
@@ -100,7 +100,7 @@ module Gollum
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Private: Find a page in the given Gollum repo.
|
# 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.
|
||||||
@@ -116,7 +116,7 @@ module Gollum
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# 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 +144,7 @@ module Gollum
|
|||||||
return nil # nothing was found
|
return nil # nothing was found
|
||||||
end
|
end
|
||||||
|
|
||||||
# Private: Populate this Page with information from the Blob.
|
# Populate this Page with information from the Blob.
|
||||||
#
|
#
|
||||||
# blob - The Grit::Blob that contains the info.
|
# blob - The Grit::Blob that contains the info.
|
||||||
# path - The String directory path of the page file.
|
# path - The String directory path of the page file.
|
||||||
@@ -156,7 +156,7 @@ module Gollum
|
|||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
# Private: The full directory path for the given tree.
|
# 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.
|
||||||
@@ -170,7 +170,7 @@ module Gollum
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# Private: Compare the canonicalized versions of the two names.
|
# 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).
|
||||||
|
|||||||
+8
-9
@@ -1,6 +1,6 @@
|
|||||||
module Gollum
|
module Gollum
|
||||||
class Wiki
|
class Wiki
|
||||||
# Initialize a new Gollum Repo.
|
# Public: Initialize a new Gollum Repo.
|
||||||
#
|
#
|
||||||
# repo - The String path to the Git repository that holds the Gollum site.
|
# repo - The String path to the Git repository that holds the Gollum site.
|
||||||
#
|
#
|
||||||
@@ -10,7 +10,7 @@ module Gollum
|
|||||||
@repo = Grit::Repo.new(path)
|
@repo = Grit::Repo.new(path)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get the formatted page for a given page name.
|
# Public: 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").
|
# version - The String version ID to find (default: "master").
|
||||||
@@ -20,7 +20,7 @@ module Gollum
|
|||||||
Page.new(self).find(name, version)
|
Page.new(self).find(name, version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Get the static file for a given name.
|
# Public: Get the static file for a given name.
|
||||||
#
|
#
|
||||||
# name - The full String pathname to the file.
|
# name - The full String pathname to the file.
|
||||||
# version - The String version ID to find (default: "master").
|
# version - The String version ID to find (default: "master").
|
||||||
@@ -30,7 +30,7 @@ module Gollum
|
|||||||
File.new(self).find(name, version)
|
File.new(self).find(name, version)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Write a new version of a page to the Gollum repo root.
|
# Public: Write a new version of a page to the Gollum repo root.
|
||||||
#
|
#
|
||||||
# name - The String name of the page.
|
# name - The String name of the page.
|
||||||
# data - The new String contents of the page.
|
# data - The new String contents of the page.
|
||||||
@@ -50,8 +50,8 @@ module Gollum
|
|||||||
index.commit(commit[:message], [parent], actor)
|
index.commit(commit[:message], [parent], actor)
|
||||||
end
|
end
|
||||||
|
|
||||||
# Update an existing page with new content. The location of the page
|
# Public: Update an existing page with new content. The location of the
|
||||||
# inside the repository and the page's format will not change.
|
# page inside the repository and the page's format will not change.
|
||||||
#
|
#
|
||||||
# page - The Gollum::Page to update.
|
# page - The Gollum::Page to update.
|
||||||
# data - The new String contents of the page.
|
# data - The new String contents of the page.
|
||||||
@@ -75,11 +75,10 @@ module Gollum
|
|||||||
#
|
#
|
||||||
#########################################################################
|
#########################################################################
|
||||||
|
|
||||||
# Private: The Grit::Repo associated with this wiki.
|
# The Grit::Repo associated with this wiki.
|
||||||
attr_reader :repo
|
attr_reader :repo
|
||||||
|
|
||||||
# Private: The String path to the Git repository that holds the Gollum
|
# The String path to the Git repository that holds the Gollum site.
|
||||||
# site.
|
|
||||||
attr_reader :path
|
attr_reader :path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
Reference in New Issue
Block a user