2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
||||
.conche/
|
||||
.build/
|
||||
Packages/
|
||||
|
||||
1
.swift-version
Normal file
1
.swift-version
Normal file
@@ -0,0 +1 @@
|
||||
2.2-dev
|
||||
8
Package.swift
Normal file
8
Package.swift
Normal file
@@ -0,0 +1,8 @@
|
||||
import PackageDescription
|
||||
|
||||
let package = Package(
|
||||
name: "Stencil",
|
||||
dependencies: [
|
||||
.Package(url: "https://github.com/kylef/PathKit.git", majorVersion: 0, minor: 5),
|
||||
]
|
||||
)
|
||||
@@ -26,9 +26,10 @@ public class Context {
|
||||
|
||||
/// Set a variable in the current context, deleting the variable if it's nil
|
||||
set(value) {
|
||||
if var dictionary = dictionaries.popLast() {
|
||||
dictionary[key] = value
|
||||
dictionaries.append(dictionary)
|
||||
if let dictionary = dictionaries.popLast() {
|
||||
var mutable_dictionary = dictionary
|
||||
mutable_dictionary[key] = value
|
||||
dictionaries.append(mutable_dictionary)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,8 +16,7 @@
|
||||
"tag": "0.4.0"
|
||||
},
|
||||
"source_files": [
|
||||
"Stencil/*.swift",
|
||||
"Stencil/TemplateLoader/*.swift"
|
||||
"Sources/*.swift"
|
||||
],
|
||||
"platforms": {
|
||||
"ios": "8.0",
|
||||
@@ -29,9 +28,9 @@
|
||||
},
|
||||
"test_specification": {
|
||||
"source_files": [
|
||||
"StencilSpecs/*.swift",
|
||||
"StencilSpecs/TemplateLoader/*.swift",
|
||||
"StencilSpecs/Nodes/*.swift"
|
||||
"Tests/*.swift",
|
||||
"Tests/TemplateLoader/*.swift",
|
||||
"Tests/Nodes/*.swift"
|
||||
],
|
||||
"dependencies": {
|
||||
"Spectre": [ "~> 0.5.0" ],
|
||||
|
||||
@@ -4,7 +4,7 @@ import PathKit
|
||||
|
||||
|
||||
describe("Include") {
|
||||
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures"
|
||||
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
|
||||
let loader = TemplateLoader(paths: [path])
|
||||
|
||||
$0.describe("parsing") {
|
||||
@@ -4,7 +4,7 @@ import PathKit
|
||||
|
||||
|
||||
describe("Inheritence") {
|
||||
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures"
|
||||
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
|
||||
let loader = TemplateLoader(paths: [path])
|
||||
|
||||
$0.it("can inherit from another template") {
|
||||
@@ -4,7 +4,7 @@ import PathKit
|
||||
|
||||
|
||||
describe("TemplateLoader") {
|
||||
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures"
|
||||
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
|
||||
let loader = TemplateLoader(paths: [path])
|
||||
|
||||
$0.it("returns nil when a template cannot be found") {
|
||||
Reference in New Issue
Block a user