From b8e1924b058001ebfd0f4ea6459eb5f3dd994861 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Fri, 28 Jul 2017 17:25:31 -0700 Subject: [PATCH 1/4] fix compilation on Linux --- Sources/Context.swift | 2 +- Sources/SwiftIdentifier.swift | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Context.swift b/Sources/Context.swift index 3e70c673..f7d6062c 100644 --- a/Sources/Context.swift +++ b/Sources/Context.swift @@ -22,7 +22,7 @@ public enum StencilContext { /// - Throws: `Parameters.Error` public static func enrich(context: [String: Any], parameters: [String], - environment: [String: String] = ProcessInfo().environment) throws -> [String: Any] { + environment: [String: String] = ProcessInfo.processInfo.environment) throws -> [String: Any] { var context = context context[environmentKey] = merge(context[environmentKey], with: environment) diff --git a/Sources/SwiftIdentifier.swift b/Sources/SwiftIdentifier.swift index 654b98fd..68d9e5e8 100644 --- a/Sources/SwiftIdentifier.swift +++ b/Sources/SwiftIdentifier.swift @@ -69,7 +69,7 @@ func swiftIdentifier(from string: String, let mappedParts = parts.map({ (string: String) -> String in // Can't use capitalizedString here because it will lowercase all letters after the first // e.g. "SomeNiceIdentifier".capitalizedString will because "Someniceidentifier" which is not what we want - let ns = string as NSString + let ns = NSString(string: string) if ns.length > 0 { let firstLetter = ns.substring(to: 1) let rest = ns.substring(from: 1) From a1333861eb11dc17f87427ce9b2c3bca97b8bc54 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Fri, 28 Jul 2017 17:34:08 -0700 Subject: [PATCH 2/4] fix linter error --- Sources/Context.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Context.swift b/Sources/Context.swift index f7d6062c..b30a4f62 100644 --- a/Sources/Context.swift +++ b/Sources/Context.swift @@ -22,7 +22,8 @@ public enum StencilContext { /// - Throws: `Parameters.Error` public static func enrich(context: [String: Any], parameters: [String], - environment: [String: String] = ProcessInfo.processInfo.environment) throws -> [String: Any] { + environment: [String: String] = + ProcessInfo.processInfo.environment) throws -> [String: Any] { var context = context context[environmentKey] = merge(context[environmentKey], with: environment) From 0527c878cec3a10ea3a45cf701973e00a396a99d Mon Sep 17 00:00:00 2001 From: JP Simard Date: Sat, 29 Jul 2017 22:14:27 -0700 Subject: [PATCH 3/4] fix SwiftLint violation in Context.swift --- Sources/Context.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Context.swift b/Sources/Context.swift index b30a4f62..80e4cdd9 100644 --- a/Sources/Context.swift +++ b/Sources/Context.swift @@ -23,7 +23,7 @@ public enum StencilContext { public static func enrich(context: [String: Any], parameters: [String], environment: [String: String] = - ProcessInfo.processInfo.environment) throws -> [String: Any] { + ProcessInfo.processInfo.environment) throws -> [String: Any] { var context = context context[environmentKey] = merge(context[environmentKey], with: environment) From fd0c3a0909d035dfa06cf884b467524a90575bf3 Mon Sep 17 00:00:00 2001 From: JP Simard Date: Sat, 29 Jul 2017 22:17:00 -0700 Subject: [PATCH 4/4] fix Linux compilation issue in unit tests --- Tests/StencilSwiftKitTests/TestsHelper.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/StencilSwiftKitTests/TestsHelper.swift b/Tests/StencilSwiftKitTests/TestsHelper.swift index 6128f041..6bb40fed 100644 --- a/Tests/StencilSwiftKitTests/TestsHelper.swift +++ b/Tests/StencilSwiftKitTests/TestsHelper.swift @@ -9,7 +9,7 @@ import XCTest import PathKit private let colorCode: (String) -> String = - ProcessInfo().environment["XcodeColors"] == "YES" ? { "\u{001b}[\($0);" } : { _ in "" } + ProcessInfo.processInfo.environment["XcodeColors"] == "YES" ? { "\u{001b}[\($0);" } : { _ in "" } private let (msgColor, reset) = (colorCode("fg250,0,0"), colorCode("")) private let okCode = (num: colorCode("fg127,127,127"), code: colorCode(""))