Skip to content
This repository was archived by the owner on Sep 6, 2018. It is now read-only.

Commit 5ae9034

Browse files
committed
remove context generation parameters
1 parent 26d23cf commit 5ae9034

15 files changed

+18
-112
lines changed

Sources/Stencil/AssetsCatalogContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import Foundation
1818
- `value`: `String` — the actual full name for loading the image
1919
*/
2020
extension AssetsCatalogParser {
21-
public func stencilContext(enumName: String = "Asset") -> [String: Any] {
21+
public func stencilContext() -> [String: Any] {
2222
let catalogs = self.catalogs.keys.sorted(by: <).map { name -> [String: Any] in
2323
return [
2424
"name": name,

Sources/Stencil/ColorsContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import Foundation
1515
- `alpha`: `String` — hex value of the alpha component
1616
*/
1717
extension ColorsFileParser {
18-
public func stencilContext(enumName: String = "ColorName") -> [String: Any] {
18+
public func stencilContext() -> [String: Any] {
1919
let colorMap = colors.map({ (color: (name: String, value: UInt32)) -> [String:String] in
2020
let name = color.name.trimmingCharacters(in: CharacterSet.whitespaces)
2121
let hex = "00000000" + String(color.value, radix: 16)

Sources/Stencil/FontsContext.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import Foundation
1616
*/
1717

1818
extension FontsFileParser {
19-
public func stencilContext(enumName: String = "FontFamily") -> [String: Any] {
19+
public func stencilContext() -> [String: Any] {
2020
// turn into array of dictionaries
2121
let families = entries.map { (name: String, family: Set<Font>) -> [String: Any] in
2222
let fonts = family.map { (font: Font) -> [String: String] in

Sources/Stencil/StoryboardsContext.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ private func uppercaseFirst(_ string: String) -> String {
3434
- `customModule`: `String` — The custom module of the segue (absent if no custom segue class)
3535
*/
3636
extension StoryboardParser {
37-
public func stencilContext(sceneEnumName: String = "StoryboardScene",
38-
segueEnumName: String = "StoryboardSegue") -> [String: Any] {
37+
public func stencilContext() -> [String: Any] {
3938
let storyboards = Set(storyboardsScenes.keys).union(storyboardsSegues.keys).sorted(by: <)
4039
let storyboardsMap = storyboards.map { (storyboardName: String) -> [String:Any] in
4140
var sbMap: [String:Any] = ["name": storyboardName]

Sources/Stencil/StringsContext.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ private extension String {
2929
Contains a list of types like `"String"`, `"Int"`, etc
3030
*/
3131
extension StringsFileParser {
32-
public func stencilContext(enumName: String = "L10n", tableName: String = "Localizable") -> [String: Any] {
32+
public func stencilContext() -> [String: Any] {
3333

3434
let entryToStringMapper = { (entry: Entry, keyPath: [String]) -> [String: Any] in
3535
let levelName = entry.keyStructure.last ?? ""
@@ -52,7 +52,7 @@ extension StringsFileParser {
5252
usingMapper: entryToStringMapper
5353
)
5454
let tables: [[String: Any]] = [[
55-
"name": tableName,
55+
"name": "Localizable",
5656
"levels": structuredStrings
5757
]]
5858

Tests/SwiftGenKitTests/ColorsCLRFileTests.swift

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,6 @@ class ColorsCLRFileTests: XCTestCase {
2323
let result = parser.stencilContext()
2424
XCTDiffContexts(result, expected: "defaults.plist", sub: .colors)
2525
}
26-
27-
func testFileWithCustomName() throws {
28-
let parser = ColorsCLRFileParser()
29-
try parser.parseFile(at: Fixtures.path(for: "colors.clr", sub: .colors))
30-
31-
let result = parser.stencilContext(enumName: "XCTColors")
32-
XCTDiffContexts(result, expected: "customname.plist", sub: .colors)
33-
}
34-
3526
func testFileWithBadFile() {
3627
let parser = ColorsCLRFileParser()
3728
do {

Tests/SwiftGenKitTests/ColorsJSONFileTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ class ColorsJSONFileTests: XCTestCase {
2424
XCTDiffContexts(result, expected: "defaults.plist", sub: .colors)
2525
}
2626

27-
func testFileWithCustomName() throws {
28-
let parser = ColorsJSONFileParser()
29-
try parser.parseFile(at: Fixtures.path(for: "colors.json", sub: .colors))
30-
31-
let result = parser.stencilContext(enumName: "XCTColors")
32-
XCTDiffContexts(result, expected: "customname.plist", sub: .colors)
33-
}
34-
3527
func testFileWithBadSyntax() {
3628
let parser = ColorsJSONFileParser()
3729
do {

Tests/SwiftGenKitTests/ColorsTextFileTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,6 @@ class ColorsTextFileTests: XCTestCase {
3535
XCTDiffContexts(result, expected: "text-defaults.plist", sub: .colors)
3636
}
3737

38-
func testFileWithCustomName() throws {
39-
let parser = ColorsTextFileParser()
40-
try parser.parseFile(at: Fixtures.path(for: "colors.txt", sub: .colors))
41-
42-
let result = parser.stencilContext(enumName: "XCTColors")
43-
XCTDiffContexts(result, expected: "text-customname.plist", sub: .colors)
44-
}
45-
4638
func testFileWithBadSyntax() {
4739
let parser = ColorsTextFileParser()
4840
do {

Tests/SwiftGenKitTests/ColorsXMLFileTests.swift

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,6 @@ class ColorsXMLFileTests: XCTestCase {
2424
XCTDiffContexts(result, expected: "defaults.plist", sub: .colors)
2525
}
2626

27-
func testFileWithCustomName() throws {
28-
let parser = ColorsXMLFileParser()
29-
try parser.parseFile(at: Fixtures.path(for: "colors.xml", sub: .colors))
30-
31-
let result = parser.stencilContext(enumName: "XCTColors")
32-
XCTDiffContexts(result, expected: "customname.plist", sub: .colors)
33-
}
34-
3527
func testFileWithBadSyntax() {
3628
let parser = ColorsXMLFileParser()
3729
do {

0 commit comments

Comments
 (0)