From e2403bf46cdf8cceb99765fe665770ff5f775167 Mon Sep 17 00:00:00 2001 From: rick Date: Mon, 12 Jul 2010 17:06:31 -0700 Subject: [PATCH] Gollum::Wiki defaults to Gollum::Page and Gollum::File --- lib/gollum/wiki.rb | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/gollum/wiki.rb b/lib/gollum/wiki.rb index 4423e189..7065a218 100644 --- a/lib/gollum/wiki.rb +++ b/lib/gollum/wiki.rb @@ -3,8 +3,35 @@ module Gollum include Pagination 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 + # Public: Initialize a new Gollum Repo. #