diff --git a/Podfile.lock b/Podfile.lock index 8279478..2ac8bc2 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -1,10 +1,10 @@ PODS: - - PathKit (0.4.0) + - PathKit (0.5.0) DEPENDENCIES: - - PathKit (~> 0.4.0) + - PathKit (~> 0.5.0) SPEC CHECKSUMS: - PathKit: bfbf544223c1a9fbf5dd7ff301d9ab1c46603b7d + PathKit: 64e70cb924d6faed9251049f5f28662855524baf COCOAPODS: 0.38.2 diff --git a/Stencil.podspec b/Stencil.podspec index dbcd860..d1c1411 100644 --- a/Stencil.podspec +++ b/Stencil.podspec @@ -11,6 +11,6 @@ Pod::Spec.new do |spec| spec.ios.deployment_target = '8.0' spec.osx.deployment_target = '10.9' spec.requires_arc = true - spec.dependency 'PathKit', '~> 0.4.0' + spec.dependency 'PathKit', '~> 0.5.0' end diff --git a/Stencil/Template.swift b/Stencil/Template.swift index f0f5f21..ed78845 100644 --- a/Stencil/Template.swift +++ b/Stencil/Template.swift @@ -6,12 +6,12 @@ public class Template { public let parser:TokenParser /// Create a template with the given name inside the main bundle - public convenience init?(named:String) throws { + public convenience init(named:String) throws { try self.init(named:named, inBundle:nil) } /// Create a template with the given name inside the given bundle - public convenience init?(named:String, inBundle bundle:NSBundle?) throws { + public convenience init(named:String, inBundle bundle:NSBundle?) throws { var url:NSURL? if let bundle = bundle { @@ -25,13 +25,12 @@ public class Template { /// Create a template with a file found at the given URL public convenience init(URL:NSURL) throws { - let templateString = try NSString(contentsOfURL: URL, encoding: NSUTF8StringEncoding) - self.init(templateString: templateString as String) + try self.init(path: Path(URL.absoluteString)) } /// Create a template with a file found at the given path - public convenience init?(path:Path) throws { - self.init(templateString: path.read() ?? "") + public convenience init(path:Path) throws { + self.init(templateString: try path.read()) } /// Create a template with a template string