-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
writing out templates to the filesystem works
- Loading branch information
1 parent
12a08cc
commit d8d8676
Showing
9 changed files
with
76 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
--- | ||
@include views.md | ||
--- | ||
@include magic_values | ||
@include persistence | ||
--- | ||
@include options |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
### directories | ||
|
||
* templates | ||
* generated | ||
|
||
### writeTemplates | ||
|
||
boolean - should the compile step write out a template to `options.generated + "/templates.js"` ? | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var x = new (require("transitive"))(); | ||
var fs = require("fs"); | ||
var folder = process.cwd()+"/test_temp/"+require("uuid-pure").newId(); | ||
var options = {}; | ||
|
||
exports.setUp = function(test, assert){ | ||
process.chdir("./test/views"); | ||
fs.mkdirSync(folder, "777"); | ||
|
||
options = x.loadOptions({}); | ||
|
||
options.directories.generated = folder; | ||
options.mergeDefault = false; | ||
x.options = options; | ||
|
||
test.finish(); | ||
}; | ||
|
||
exports["test generated templates"] = function (test, assert) { | ||
|
||
var functions = x.Views.compile(options); | ||
|
||
templates = require(folder+"/templates.js"); | ||
|
||
assert.equal(templates["user/profile"]({name:"aaron"}), "<h1>AARON</h1>"); | ||
test.finish(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters