Add Wiki#files for list of non-page files.

This commit is contained in:
trans
2012-06-22 08:23:46 -04:00
parent 8fd11e8fdb
commit 754485c306
4 changed files with 62 additions and 3 deletions
+15 -2
View File
@@ -19,6 +19,7 @@ module Gollum
def name
@blob && @blob.name
end
alias filename name
# Public: The raw contents of the page.
#
@@ -28,7 +29,7 @@ module Gollum
end
# Public: The Grit::Commit version of the file.
attr_reader :version
attr_accessor :version
# Public: The String path of the file.
attr_reader :path
@@ -38,6 +39,18 @@ module Gollum
@blob.mime_type
end
# Populate the 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=nil)
@blob = blob
@path = "#{path}/#{blob.name}"[1..-1]
self
end
#########################################################################
#
# Internal Methods
@@ -61,4 +74,4 @@ module Gollum
end
end
end
end
end