[Project] Use 2 spaces for indentation

This commit is contained in:
Kyle Fuller
2015-06-29 16:40:15 -07:00
parent 59bab00c97
commit 53d5a4f8c3
20 changed files with 1047 additions and 1045 deletions

View File

@@ -11,35 +11,35 @@ import PathKit
// A class for loading a template from disk
public class TemplateLoader {
public let paths:[Path]
public let paths:[Path]
public init(paths:[Path]) {
self.paths = paths
public init(paths:[Path]) {
self.paths = paths
}
public init(bundle:[NSBundle]) {
self.paths = bundle.map {
return Path($0.bundlePath)
}
}
public init(bundle:[NSBundle]) {
self.paths = bundle.map {
return Path($0.bundlePath)
public func loadTemplate(templateName:String) -> Template? {
return loadTemplate([templateName])
}
public func loadTemplate(templateNames:[String]) -> Template? {
for path in paths {
for templateName in templateNames {
let templatePath = path + Path(templateName)
if templatePath.exists() {
if let template = Template(path: templatePath) {
return template
}
}
}
}
public func loadTemplate(templateName:String) -> Template? {
return loadTemplate([templateName])
}
public func loadTemplate(templateNames:[String]) -> Template? {
for path in paths {
for templateName in templateNames {
let templatePath = path + Path(templateName)
if templatePath.exists() {
if let template = Template(path: templatePath) {
return template
}
}
}
}
return nil
}
return nil
}
}