make Page#data lazy
This commit is contained in:
+9
-2
@@ -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
|
||||||
|
|
||||||
attr_accessor :wiki, :data
|
attr_accessor :wiki, :blob
|
||||||
|
|
||||||
# Initialize a page.
|
# Initialize a page.
|
||||||
#
|
#
|
||||||
@@ -19,10 +19,17 @@ module Gollum
|
|||||||
#
|
#
|
||||||
# Returns the populated Gollum::Page.
|
# Returns the populated Gollum::Page.
|
||||||
def populate(blob)
|
def populate(blob)
|
||||||
self.data = blob.data
|
self.blob = blob
|
||||||
self
|
self
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# The contents of the page.
|
||||||
|
#
|
||||||
|
# Returns the String data.
|
||||||
|
def data
|
||||||
|
self.blob.data
|
||||||
|
end
|
||||||
|
|
||||||
# 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.
|
||||||
|
|||||||
Reference in New Issue
Block a user