add Gollum::File
This commit is contained in:
@@ -5,6 +5,7 @@ require 'github/markup'
|
||||
# internal
|
||||
require 'gollum/wiki'
|
||||
require 'gollum/page'
|
||||
require 'gollum/file'
|
||||
|
||||
module Gollum
|
||||
VERSION = '0.0.1'
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
module Gollum
|
||||
class File
|
||||
attr_accessor :wiki
|
||||
|
||||
# Initialize a file.
|
||||
#
|
||||
# wiki - The Gollum::Wiki in question.
|
||||
#
|
||||
# Returns a newly initialized Gollum::File.
|
||||
def initialize(wiki)
|
||||
self.wiki = wiki
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -21,5 +21,14 @@ module Gollum
|
||||
def page(name, version = 'master')
|
||||
Page.new(self).find(name, version)
|
||||
end
|
||||
|
||||
# Get the static file for a given name.
|
||||
#
|
||||
# name - The full String pathname to the file.
|
||||
#
|
||||
# Returns a Gollum::File or nil if no matching file was found.
|
||||
def file(name)
|
||||
File.new(self).find(name)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user