Gollum::Wiki defaults to Gollum::Page and Gollum::File
This commit is contained in:
+28
-1
@@ -3,8 +3,35 @@ module Gollum
|
|||||||
include Pagination
|
include Pagination
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
attr_accessor :page_class, :file_class
|
# Sets the page class used by all instances of this Wiki.
|
||||||
|
attr_writer :page_class
|
||||||
|
|
||||||
|
# Sets the file class used by all instances of this Wiki.
|
||||||
|
attr_writer :file_class
|
||||||
|
|
||||||
|
# Gets the page class used by all instances of this Wiki.
|
||||||
|
# Default: Gollum::Page.
|
||||||
|
def page_class
|
||||||
|
@page_class ||
|
||||||
|
if superclass.respond_to?(:page_class)
|
||||||
|
superclass.page_class
|
||||||
|
else
|
||||||
|
::Gollum::Page
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
# Gets the file class used by all instances of this Wiki.
|
||||||
|
# Default: Gollum::File.
|
||||||
|
def file_class
|
||||||
|
@file_class ||
|
||||||
|
if superclass.respond_to?(:file_class)
|
||||||
|
superclass.file_class
|
||||||
|
else
|
||||||
|
::Gollum::File
|
||||||
|
end
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
# Public: Initialize a new Gollum Repo.
|
# Public: Initialize a new Gollum Repo.
|
||||||
#
|
#
|
||||||
|
|||||||
Reference in New Issue
Block a user