Skip to content

Commit

Permalink
add annotation for macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
fumito-ito committed Aug 23, 2024
1 parent 7e31911 commit c3b2f6a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Sources/Template.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ final public class Template {
/// - parameter encoding: The encoding of the template resource.
/// - parameter configuration: The configuration for rendering. If the configuration is not specified, `Configuration.default` is used.
/// - throws: MustacheError
@available(iOS 15.0, *)
@available(iOS 15.0, macOS 12.0, *)
public convenience init(URL: Foundation.URL, encoding: String.Encoding = .utf8, configuration: Configuration = .default) async throws {
let baseURL = URL.deletingLastPathComponent()
let templateExtension = URL.pathExtension
Expand Down
6 changes: 3 additions & 3 deletions Sources/TemplateRepository.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public protocol TemplateRepositoryDataSource {
/// - parameter templateID: The template ID of the template.
/// - throws: MustacheError
/// - returns: A Mustache template string.
@available(iOS 15.0, *)
@available(iOS 15.0, macOS 12.0, *)
func templateStringForTemplateID(_ templaetID: TemplateID) async throws -> String
}

Expand Down Expand Up @@ -353,7 +353,7 @@ final public class TemplateRepository {
}
}

@available(iOS 15.0, *)
@available(iOS 15.0, macOS 12.0, *)
func templateAST(named name: String, relativeToTemplateID baseTemplateID: TemplateID? = nil) async throws -> TemplateAST {
guard let dataSource = self.dataSource else {
throw MustacheError(kind: .templateNotFound, message: "Missing dataSource", templateID: baseTemplateID)
Expand Down Expand Up @@ -510,7 +510,7 @@ final public class TemplateRepository {
return try NSString(contentsOf: URL(string: templateID)!, encoding: encoding.rawValue) as String
}

@available(iOS 15.0, *)
@available(iOS 15.0, macOS 12.0, *)
func templateStringForTemplateID(_ templateID: TemplateID) async throws -> String {
let (data, _) = try await URLSession.shared.data(from: URL(string: templateID)!)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ class TemplateFromMethodsTests: XCTestCase {
}
}

@available(iOS 15.0, *)
@available(iOS 15.0, macOS 12.0, *)
extension TemplateFromMethodsTests {
func testTemplateFromURL() async {
let template = try! await Template(URL: templateURL)
Expand Down

0 comments on commit c3b2f6a

Please sign in to comment.