Add support for Swift 3.0

This commit is contained in:
Kyle Fuller
2016-09-13 19:09:58 +01:00
parent f393efbd0b
commit feff3b18b1
41 changed files with 252 additions and 229 deletions

View File

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