diff --git a/CHANGELOG.md b/CHANGELOG.md index 0135359..22209fb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Rock +## 0.3.1 + +### Non Breaking Changes + +- **[Dependencies]** Upgraded `PathKit`, `Stencil` and `PromptLine` which fixes Linux issues + ## 0.3.0 ### Additions diff --git a/Package.swift b/Package.swift index cc4786c..166155f 100644 --- a/Package.swift +++ b/Package.swift @@ -7,13 +7,13 @@ let package = Package( Target(name: "RockLib", dependencies: []), ], dependencies: [ - .Package(url: "https://github.com/kylef/PathKit.git", Version(0, 7, 1)), - .Package(url: "https://github.com/kylef/Stencil.git", Version(0, 7, 2)), + .Package(url: "https://github.com/kylef/PathKit.git", Version(0, 8, 0)), + .Package(url: "https://github.com/kylef/Stencil.git", Version(0, 8, 0)), .Package(url: "https://github.com/Carthage/Commandant.git", majorVersion: 0, minor: 11), .Package(url: "https://github.com/mtynior/ColorizeSwift.git", majorVersion: 1, minor: 1), .Package(url: "https://github.com/behrang/YamlSwift.git", majorVersion: 3, minor: 3), .Package(url: "https://github.com/antitypical/Result.git", majorVersion: 3), .Package(url: "https://github.com/vknabel/Lens.git", majorVersion: 0, minor: 1), - .Package(url: "https://github.com/vknabel/PromptLine.git", Version(0, 5, 1)), + .Package(url: "https://github.com/vknabel/PromptLine.git", Version(0, 6, 1)), ] ) diff --git a/README.md b/README.md index e54caf3..2dd910f 100644 --- a/README.md +++ b/README.md @@ -120,7 +120,7 @@ $ curl -sL https://raw.githubusercontent.com/vknabel/Rock/master/Scripts/Install Rock can be updated by simply running installing itself with a version specified. ```bash -$ rock install rock@0.3.0 +$ rock install rock@0.3.1 ``` ## Limitations diff --git a/Rockfile b/Rockfile index ffd057b..3f088d3 100644 --- a/Rockfile +++ b/Rockfile @@ -1,6 +1,6 @@ name: Rock url: https://github.com/vknabel/Rock -version: 0.3.0 +version: 0.3.1 # Dependencies may be installed locally by running `rock install` # If you like you can even delcare Specs inline or override specific scripts. dependencies: @@ -44,6 +44,7 @@ scripts: # Set git tag - git tag -a {{version}} -m {{version}} - git push --tags + postpublish: # Copy latest Changelog - sed -n /'^## {{version}}$'/,/'^## '/p CHANGELOG.md | sed -e '$ d' | pbcopy # Create new release on Github diff --git a/Scripts/Install.generated.swift b/Scripts/Install.generated.swift index 5e6c58e..e46d519 100644 --- a/Scripts/Install.generated.swift +++ b/Scripts/Install.generated.swift @@ -9,7 +9,7 @@ typealias Process = Task #endif let rockPath = ProcessInfo.processInfo.environment["ROCK_PATH"] ?? "~/.rock" -let version = ProcessInfo.processInfo.environment["ROCK_VERSION"] ?? "0.3.0" +let version = ProcessInfo.processInfo.environment["ROCK_VERSION"] ?? "0.3.1" func run(workingDir: String? = nil, _ args: String...) { let process = Process() diff --git a/Sources/RockLib/Generated/Version.generated.swift b/Sources/RockLib/Generated/Version.generated.swift index 1f1bf53..e2ed910 100644 --- a/Sources/RockLib/Generated/Version.generated.swift +++ b/Sources/RockLib/Generated/Version.generated.swift @@ -1,6 +1,7 @@ // Generated using Sourcery 0.5.3 — https://github.com/krzysztofzablocki/Sourcery // DO NOT EDIT + public extension RockConfig { - public static let version = "0.3.0" + public static let version = "0.3.1" } diff --git a/Sources/RockLib/YamlAndStencil.swift b/Sources/RockLib/YamlAndStencil.swift index 5cd29b7..a382dfe 100644 --- a/Sources/RockLib/YamlAndStencil.swift +++ b/Sources/RockLib/YamlAndStencil.swift @@ -3,8 +3,10 @@ import PathKit import Stencil import Yaml +typealias ContextLiteral = [String: Any] + private extension String { - func render(_ context: Context? = nil) throws -> String { + func render(_ context: ContextLiteral? = nil) throws -> String { let template = Template(templateString: self) return try template.render(context) } @@ -55,19 +57,18 @@ private extension Yaml { func render( _ dictionary: [String: Any], - namespace: Namespace = Namespace(), descriptor: Yaml.YamlSortDescriptor ) throws -> (Any, Yaml) { + let context = dictionary switch self { case let .string(value): - let context = Context(dictionary: dictionary, namespace: namespace) let rendered = try value.render(context) return (rendered, .string(rendered)) case let .array(values): var contextList = [Any]() var vs = [(Any, Yaml)]() for v in values { - let result = try v.render(dictionary, namespace: namespace, descriptor: descriptor) + let result = try v.render(dictionary, descriptor: descriptor) contextList.append(result.0) vs.append(result) } @@ -78,8 +79,8 @@ private extension Yaml { var localDictionary: [String: Any] = [:] try value.sorted(by: descriptor).forEach { key, value in - let renderedKey = try key.render(dictionary, namespace: namespace, descriptor: descriptor) - let renderedValue = try value.render(dictionary, namespace: namespace, descriptor: descriptor) + let renderedKey = try key.render(dictionary, descriptor: descriptor) + let renderedValue = try value.render(dictionary, descriptor: descriptor) dict[renderedKey.1] = renderedValue.1 if let renderedKey = renderedKey.0 as? String { @@ -99,17 +100,15 @@ public extension Yaml { public static func rendering( _ text: String, - namespace: Namespace = Namespace(), orderedBy order: [Yaml] = ["const", "constant", "constants", "version", "license", "name", "url"] ) throws -> Yaml { - return try rendering(text, namespace: namespace, sort: sortDescriptor(by: order)) + return try rendering(text, sort: sortDescriptor(by: order)) } public static func rendering( _ text: String, - namespace: Namespace = Namespace(), sort descriptor: YamlSortDescriptor ) throws -> Yaml { - return try Yaml.load(text).render([:], namespace: namespace, descriptor: descriptor).1 + return try Yaml.load(text).render([:], descriptor: descriptor).1 } }