Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename SwiftTemplate to StencilSwiftTemplate #14

Merged
merged 1 commit into from
Jan 27, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

### Internal Changes

* Renamed `SwiftTemplate` to `StencilSwiftTemplate`.
[David Jennes](https://github.com/djbe)
[#14](https://github.com/SwiftGen/StencilSwiftKit/issues/14)

## Before 5.0.0

Expand Down
31 changes: 14 additions & 17 deletions Pods/Pods.xcodeproj/project.pbxproj

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import Stencil

// Workaround until Stencil fixes https://github.com/kylef/Stencil/issues/22
open class SwiftTemplate: Template {
open class StencilSwiftTemplate: Template {
public required init(templateString: String, environment: Environment? = nil, name: String? = nil) {
let templateStringWithMarkedNewlines = templateString
.replacingOccurrences(of: "\n\n", with: "\n\u{000b}\n")
Expand Down Expand Up @@ -61,5 +61,5 @@ func stencilSwiftExtension() -> Extension {
}

public func stencilSwiftEnvironment() -> Environment {
return Environment(extensions: [stencilSwiftExtension()], templateClass: SwiftTemplate.self)
return Environment(extensions: [stencilSwiftExtension()], templateClass: StencilSwiftTemplate.self)
}
4 changes: 2 additions & 2 deletions Tests/TestSuites/CallNodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import XCTest

class CallNodeTests: XCTestCase {
func testBasic() {
let template = SwiftTemplate(templateString: Fixtures.string(for: "call-basic.stencil"), environment: stencilSwiftEnvironment())
let template = StencilSwiftTemplate(templateString: Fixtures.string(for: "call-basic.stencil"), environment: stencilSwiftEnvironment())
let result = try! template.render([:])

let expected = Fixtures.string(for: "call-basic.out")
XCTDiffStrings(result, expected)
}

func testWithRecursion() {
let template = SwiftTemplate(templateString: Fixtures.string(for: "call-with-recursion.stencil"), environment: stencilSwiftEnvironment())
let template = StencilSwiftTemplate(templateString: Fixtures.string(for: "call-with-recursion.stencil"), environment: stencilSwiftEnvironment())
let result = try! template.render([:])

let expected = Fixtures.string(for: "call-with-recursion.out")
Expand Down
4 changes: 2 additions & 2 deletions Tests/TestSuites/SetNodeTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ import XCTest

class SetNodeTests: XCTestCase {
func testBasic() {
let template = SwiftTemplate(templateString: Fixtures.string(for: "set-basic.stencil"), environment: stencilSwiftEnvironment())
let template = StencilSwiftTemplate(templateString: Fixtures.string(for: "set-basic.stencil"), environment: stencilSwiftEnvironment())
let result = try! template.render([:])

let expected = Fixtures.string(for: "set-basic.out")
XCTDiffStrings(result, expected)
}

func testWithContext() {
let template = SwiftTemplate(templateString: Fixtures.string(for: "set-with-context.stencil"), environment: stencilSwiftEnvironment())
let template = StencilSwiftTemplate(templateString: Fixtures.string(for: "set-with-context.stencil"), environment: stencilSwiftEnvironment())
let result = try! template.render([
"x": 1,
"y": 2,
Expand Down