19 Commits

Author SHA1 Message Date
David Jennes
ccd9402682 Merge pull request #319 from stencilproject/release/0.14.2
Release 0.14.2
2021-11-03 18:04:47 +01:00
David Jennes
9f0b9388d2 Bump gems 2021-11-03 17:59:55 +01:00
David Jennes
38f5faec78 Version 0.14.2 2021-11-03 17:59:46 +01:00
David Jennes
a724419474 Merge pull request #314 from astromonkee/update_pathkit_to_1.0.1
Update PathKit & Spectre to support Xcode 13
2021-10-07 23:09:00 +02:00
David Jennes
12b3a2e9bd Add changelog entry 2021-10-07 23:08:06 +02:00
astromonkee
47a44889ae Update Spectre to 0.10.1 2021-09-29 18:43:28 +09:00
astromonkee
01740c61d3 Update pathkit to 1.0.1
Pathkit 1.0.1 adds support for Xcode 13
2021-09-23 20:36:29 +09:00
David Jennes
c729a7d58f Reset CHANGELOG 2021-04-11 16:30:50 +02:00
David Jennes
973e190edf Merge pull request #307 from stencilproject/release/0.14.1
Release 0.14.1
2021-04-11 16:26:15 +02:00
David Jennes
e134aafe7f Version 0.14.1 2021-04-11 00:17:27 +02:00
David Jennes
88fd776a02 Merge pull request #306 from lkuczborski/variable-crash-fix
Fix for crashing range indexes when variable length is 1
2021-04-10 18:08:27 +02:00
Łukasz Kuczborski
8480648bd3 Fixed changelog entry 2021-04-10 05:57:40 +02:00
Łukasz Kuczborski
521a599a60 Fixed logic and tests 2021-04-09 23:37:54 +02:00
Łukasz Kuczborski
371a4737d9 Fixed missing braces 2021-04-09 23:27:00 +02:00
Łukasz Kuczborski
61919c5e8e PR fixes 2021-04-09 23:21:46 +02:00
Łukasz Kuczborski
7c635975d1 Fix for crashing range indexes when variable length is 1 2021-04-09 22:51:55 +02:00
David Jennes
fd107355c2 Merge pull request #305 from danpalmer/patch-1
Fix build warning
2021-02-07 21:09:47 +01:00
Dan Palmer
f5f85d95a9 Fix build warning
`components` is not mutated, so it can be a `let`. This fixes the build warning that otherwise shows up in build logs.
2021-01-18 17:33:13 +00:00
Olivier Halligon
22440c5369 Reset CHANGELOG 2020-08-17 20:45:21 +02:00
11 changed files with 107 additions and 62 deletions

View File

@@ -1,4 +1,19 @@
# Stencil Changelog
## 0.14.2
### Internal Changes
- Update Spectre (0.10) and PathKit to support Xcode 13.
[Astromonkee](https://github.com/astromonkee)
[#314](https://github.com/stencilproject/Stencil/pull/314)
## 0.14.1
### Bug Fixes
- Fix for crashing range indexes when variable length is 1.
[Łukasz Kuczborski](https://github.com/lkuczborski)
[#306](https://github.com/stencilproject/Stencil/pull/306)
## 0.14.0
@@ -15,10 +30,6 @@
[Ilya Puchka](https://github.com/ilyapuchka)
[#203](https://github.com/stencilproject/Stencil/pull/203)
### Deprecations
_None_
### Bug Fixes
- Fixed using parenthesis in boolean expressions, they now can be used without spaces around them.

View File

@@ -1,97 +1,119 @@
GEM
remote: https://rubygems.org/
specs:
CFPropertyList (3.0.2)
activesupport (4.2.11.3)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.7.0)
CFPropertyList (3.0.4)
rexml
activesupport (6.1.4.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.8.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.3)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
atomos (0.1.3)
claide (1.0.3)
cocoapods (1.9.3)
activesupport (>= 4.0.2, < 5)
cocoapods (1.11.2)
addressable (~> 2.8)
claide (>= 1.0.2, < 2.0)
cocoapods-core (= 1.9.3)
cocoapods-core (= 1.11.2)
cocoapods-deintegrate (>= 1.0.3, < 2.0)
cocoapods-downloader (>= 1.2.2, < 2.0)
cocoapods-downloader (>= 1.4.0, < 2.0)
cocoapods-plugins (>= 1.0.0, < 2.0)
cocoapods-search (>= 1.0.0, < 2.0)
cocoapods-stats (>= 1.0.0, < 2.0)
cocoapods-trunk (>= 1.4.0, < 2.0)
cocoapods-try (>= 1.1.0, < 2.0)
colored2 (~> 3.1)
escape (~> 0.0.4)
fourflusher (>= 2.3.0, < 3.0)
gh_inspector (~> 1.0)
molinillo (~> 0.6.6)
molinillo (~> 0.8.0)
nap (~> 1.0)
ruby-macho (~> 1.4)
xcodeproj (>= 1.14.0, < 2.0)
cocoapods-core (1.9.3)
activesupport (>= 4.0.2, < 6)
ruby-macho (>= 1.0, < 3.0)
xcodeproj (>= 1.21.0, < 2.0)
cocoapods-core (1.11.2)
activesupport (>= 5.0, < 7)
addressable (~> 2.8)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix (~> 4.0)
typhoeus (~> 1.0)
cocoapods-deintegrate (1.0.4)
cocoapods-downloader (1.4.0)
cocoapods-deintegrate (1.0.5)
cocoapods-downloader (1.5.1)
cocoapods-plugins (1.0.0)
nap
cocoapods-search (1.0.0)
cocoapods-stats (1.1.0)
cocoapods-trunk (1.5.0)
cocoapods-search (1.0.1)
cocoapods-trunk (1.6.0)
nap (>= 0.8, < 2.0)
netrc (~> 0.11)
cocoapods-try (1.2.0)
colored2 (3.1.2)
concurrent-ruby (1.1.6)
concurrent-ruby (1.1.9)
escape (0.0.4)
ethon (0.12.0)
ffi (>= 1.3.0)
faraday (1.0.1)
ethon (0.15.0)
ffi (>= 1.15.0)
faraday (1.8.0)
faraday-em_http (~> 1.0)
faraday-em_synchrony (~> 1.0)
faraday-excon (~> 1.1)
faraday-httpclient (~> 1.0.1)
faraday-net_http (~> 1.0)
faraday-net_http_persistent (~> 1.1)
faraday-patron (~> 1.0)
faraday-rack (~> 1.0)
multipart-post (>= 1.2, < 3)
ffi (1.13.1)
ruby2_keywords (>= 0.0.4)
faraday-em_http (1.0.0)
faraday-em_synchrony (1.0.0)
faraday-excon (1.1.0)
faraday-httpclient (1.0.1)
faraday-net_http (1.0.1)
faraday-net_http_persistent (1.2.0)
faraday-patron (1.0.0)
faraday-rack (1.0.0)
ffi (1.15.4)
fourflusher (2.3.1)
fuzzy_match (2.0.4)
gh_inspector (1.1.3)
httpclient (2.8.3)
i18n (0.9.5)
i18n (1.8.11)
concurrent-ruby (~> 1.0)
json (2.3.1)
minitest (5.14.1)
molinillo (0.6.6)
json (2.6.1)
minitest (5.14.4)
molinillo (0.8.0)
multipart-post (2.1.1)
nanaimo (0.3.0)
nap (1.1.0)
netrc (0.11.0)
octokit (4.18.0)
octokit (4.21.0)
faraday (>= 0.9)
sawyer (~> 0.8.0, >= 0.5.3)
public_suffix (4.0.5)
rake (13.0.1)
ruby-macho (1.4.0)
public_suffix (4.0.6)
rake (13.0.6)
rexml (3.2.5)
ruby-macho (2.5.1)
ruby2_keywords (0.0.5)
sawyer (0.8.2)
addressable (>= 2.3.5)
faraday (> 0.8, < 2.0)
thread_safe (0.3.6)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
xcodeproj (1.17.1)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
xcodeproj (1.21.0)
CFPropertyList (>= 2.3.3, < 4.0)
atomos (~> 0.1.3)
claide (>= 1.0.2, < 2.0)
colored2 (~> 3.1)
nanaimo (~> 0.3.0)
rexml (~> 3.2.4)
zeitwerk (2.5.1)
PLATFORMS
ruby

View File

@@ -6,8 +6,8 @@
"repositoryURL": "https://github.com/kylef/PathKit.git",
"state": {
"branch": null,
"revision": "73f8e9dca9b7a3078cb79128217dc8f2e585a511",
"version": "1.0.0"
"revision": "3bfd2737b700b9a36565a8c94f4ad2b050a5e574",
"version": "1.0.1"
}
},
{
@@ -15,8 +15,8 @@
"repositoryURL": "https://github.com/kylef/Spectre.git",
"state": {
"branch": null,
"revision": "f14ff47f45642aa5703900980b014c2e9394b6e5",
"version": "0.9.0"
"revision": "26cc5e9ae0947092c7139ef7ba612e34646086c7",
"version": "0.10.1"
}
}
]

View File

@@ -7,8 +7,8 @@ let package = Package(
.library(name: "Stencil", targets: ["Stencil"])
],
dependencies: [
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.0"),
.package(url: "https://github.com/kylef/Spectre.git", from: "0.9.0")
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.1"),
.package(url: "https://github.com/kylef/Spectre.git", from: "0.10.1")
],
targets: [
.target(name: "Stencil", dependencies: [

View File

@@ -7,8 +7,8 @@ let package = Package(
.library(name: "Stencil", targets: ["Stencil"])
],
dependencies: [
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.0"),
.package(url: "https://github.com/kylef/Spectre.git", from: "0.9.0")
.package(url: "https://github.com/kylef/PathKit.git", from: "1.0.1"),
.package(url: "https://github.com/kylef/Spectre.git", from: "0.10.1")
],
targets: [
.target(name: "Stencil", dependencies: [

View File

@@ -60,7 +60,7 @@ public class VariableNode: NodeType {
let elseExpression: Resolvable?
class func parse(_ parser: TokenParser, token: Token) throws -> NodeType {
var components = token.components
let components = token.components
func hasToken(_ token: String, at index: Int) -> Bool {
return components.count > (index + 1) && components[index] == token

View File

@@ -48,7 +48,7 @@ public struct Variable: Equatable, Resolvable {
/// Resolve the variable in the given context
public func resolve(_ context: Context) throws -> Any? {
if (variable.hasPrefix("'") && variable.hasSuffix("'")) || (variable.hasPrefix("\"") && variable.hasSuffix("\"")) {
if variable.count > 1 && ((variable.hasPrefix("'") && variable.hasSuffix("'")) || (variable.hasPrefix("\"") && variable.hasSuffix("\""))) {
// String literal
return String(variable[variable.index(after: variable.startIndex) ..< variable.index(before: variable.endIndex)])
}

View File

@@ -1,6 +1,6 @@
{
"name": "Stencil",
"version": "0.14.0",
"version": "0.14.2",
"summary": "Stencil is a simple and powerful template language for Swift.",
"homepage": "https://stencil.fuller.li",
"license": {
@@ -13,7 +13,7 @@
"social_media_url": "https://twitter.com/kylefuller",
"source": {
"git": "https://github.com/stencilproject/Stencil.git",
"tag": "0.14.0"
"tag": "0.14.2"
},
"source_files": [
"Sources/*.swift"

View File

@@ -63,13 +63,25 @@ final class VariableTests: XCTestCase {
let result = try variable.resolve(self.context) as? String
try expect(result) == "name"
}
it("can resolve a string literal with one double quote") {
let variable = Variable("\"")
let result = try variable.resolve(self.context) as? String
try expect(result).to.beNil()
}
it("can resolve a string literal with single quotes") {
let variable = Variable("'name'")
let result = try variable.resolve(self.context) as? String
try expect(result) == "name"
}
it("can resolve a string literal with one single quote") {
let variable = Variable("'")
let result = try variable.resolve(self.context) as? String
try expect(result).to.beNil()
}
it("can resolve an integer literal") {
let variable = Variable("5")
let result = try variable.resolve(self.context) as? Int

View File

@@ -58,9 +58,9 @@ author = 'Kyle Fuller'
# built documents.
#
# The short X.Y version.
version = '0.14.0'
version = '0.14.2'
# The full version, including alpha/beta/rc tags.
release = '0.14.0'
release = '0.14.2'
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.

View File

@@ -26,7 +26,7 @@ If you're using CocoaPods, you can add Stencil to your ``Podfile`` and then run
.. code-block:: ruby
pod 'Stencil', '~> 0.14.0'
pod 'Stencil', '~> 0.14.2'
Carthage
--------
@@ -37,7 +37,7 @@ Carthage
.. code-block:: text
github "stencilproject/Stencil" ~> 0.14.0
github "stencilproject/Stencil" ~> 0.14.2
2) Checkout your dependencies, generate the Stencil Xcode project, and then use Carthage to build Stencil: