2
.gitignore
vendored
2
.gitignore
vendored
@@ -1 +1,3 @@
|
|||||||
.conche/
|
.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 a variable in the current context, deleting the variable if it's nil
|
||||||
set(value) {
|
set(value) {
|
||||||
if var dictionary = dictionaries.popLast() {
|
if let dictionary = dictionaries.popLast() {
|
||||||
dictionary[key] = value
|
var mutable_dictionary = dictionary
|
||||||
dictionaries.append(dictionary)
|
mutable_dictionary[key] = value
|
||||||
|
dictionaries.append(mutable_dictionary)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -16,8 +16,7 @@
|
|||||||
"tag": "0.4.0"
|
"tag": "0.4.0"
|
||||||
},
|
},
|
||||||
"source_files": [
|
"source_files": [
|
||||||
"Stencil/*.swift",
|
"Sources/*.swift"
|
||||||
"Stencil/TemplateLoader/*.swift"
|
|
||||||
],
|
],
|
||||||
"platforms": {
|
"platforms": {
|
||||||
"ios": "8.0",
|
"ios": "8.0",
|
||||||
@@ -29,9 +28,9 @@
|
|||||||
},
|
},
|
||||||
"test_specification": {
|
"test_specification": {
|
||||||
"source_files": [
|
"source_files": [
|
||||||
"StencilSpecs/*.swift",
|
"Tests/*.swift",
|
||||||
"StencilSpecs/TemplateLoader/*.swift",
|
"Tests/TemplateLoader/*.swift",
|
||||||
"StencilSpecs/Nodes/*.swift"
|
"Tests/Nodes/*.swift"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"Spectre": [ "~> 0.5.0" ],
|
"Spectre": [ "~> 0.5.0" ],
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import PathKit
|
|||||||
|
|
||||||
|
|
||||||
describe("Include") {
|
describe("Include") {
|
||||||
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures"
|
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
|
||||||
let loader = TemplateLoader(paths: [path])
|
let loader = TemplateLoader(paths: [path])
|
||||||
|
|
||||||
$0.describe("parsing") {
|
$0.describe("parsing") {
|
||||||
@@ -4,7 +4,7 @@ import PathKit
|
|||||||
|
|
||||||
|
|
||||||
describe("Inheritence") {
|
describe("Inheritence") {
|
||||||
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures"
|
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
|
||||||
let loader = TemplateLoader(paths: [path])
|
let loader = TemplateLoader(paths: [path])
|
||||||
|
|
||||||
$0.it("can inherit from another template") {
|
$0.it("can inherit from another template") {
|
||||||
@@ -4,7 +4,7 @@ import PathKit
|
|||||||
|
|
||||||
|
|
||||||
describe("TemplateLoader") {
|
describe("TemplateLoader") {
|
||||||
let path = Path(__FILE__) + ".." + ".." + "StencilSpecs" + "fixtures"
|
let path = Path(__FILE__) + ".." + ".." + "Tests" + "fixtures"
|
||||||
let loader = TemplateLoader(paths: [path])
|
let loader = TemplateLoader(paths: [path])
|
||||||
|
|
||||||
$0.it("returns nil when a template cannot be found") {
|
$0.it("returns nil when a template cannot be found") {
|
||||||
Reference in New Issue
Block a user