未验证 提交 d65e31ab 编写于 作者: N Nick Thomas

Backport changes to Gitlab::Tempalte::BaseTemplate

上级 803bf517
module Gitlab
module Template
class BaseTemplate
def initialize(path, project = nil)
attr_reader :category
def initialize(path, project = nil, category: nil)
@path = path
@category = category
@finder = self.class.finder(project)
end
def name
File.basename(@path, self.class.extension)
end
alias_method :id, :name
def content
@finder.read(@path)
......@@ -62,7 +66,7 @@ module Gitlab
directory = category_directory(category)
files = finder(project).list_files_for(directory)
files.map { |f| new(f, project) }.sort
files.map { |f| new(f, project, category: category) }.sort
end
def category_directory(category)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册