Skip to content

Commit

Permalink
Merge pull request #165 from Medium/nick-soynode
Browse files Browse the repository at this point in the history
upgrade soynode
  • Loading branch information
nicks committed Jun 5, 2015
2 parents aea16db + da7ffce commit 3d97605
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "matador",
"description": "an MVC framework for Node",
"version": "2.0.0-alpha.10",
"version": "2.0.0-alpha.11",
"homepage": "https://github.com/Medium/matador",
"main": "src/matador.js",
"authors": [
Expand All @@ -23,7 +23,7 @@
"dependencies": {
"connect": "2.3.3",
"valentine": "1.8.0",
"soynode": "^0.7.0",
"soynode": "^1.0.0",
"useragent": "~2.0.6"
},
"devDependencies": {
Expand Down
9 changes: 6 additions & 3 deletions src/TemplateEngine.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ TemplateEngine.prototype.precompileTemplates = function (searchPaths, options, c

var pathsLeft = searchPaths.length

function onPathDone(err) {
function onPathDone(dir, err) {
if (dir) {
console.log('Done compiling templates in', dir)
}
pathsLeft--

if (err) {
Expand All @@ -46,12 +49,12 @@ TemplateEngine.prototype.precompileTemplates = function (searchPaths, options, c
dir = dir + '/views'

if (!isDirectory(dir)) {
onPathDone(null)
onPathDone(null, null)
return
}

console.log('Compiling Templates in', dir)
soynode.compileTemplates(dir, onPathDone)
soynode.compileTemplates(dir, onPathDone.bind(null, dir))
})
}

Expand Down
13 changes: 9 additions & 4 deletions src/all/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@ var matador = require('matador')

app.useDevErrorHandler()
app.useCommonMiddleware()
app.start()
app.listen(port)

console.log('matador running on port ' + port)
app.start(function (err) {
if (err) {
console.error('matador failed to boot')
console.error(err)
} else {
app.listen(port)
console.log('matador running on port ' + port)
}
})
2 changes: 1 addition & 1 deletion tests/integration/template_engine/afterBoot.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# We need to wait for SoyNode to finish compiling
sleep 2
sleep 3

0 comments on commit 3d97605

Please sign in to comment.