Permalink
Browse files

version boost / fix of layout subdir bug

  • Loading branch information...
1 parent 8678178 commit 6323af6a8274a4bdf02998152dbf0d548d94bd93 @malgorithms committed Sep 20, 2012
Showing with 21 additions and 8 deletions.
  1. +13 −4 lib/engine.js
  2. +1 −1 package.json
  3. +7 −3 src/engine.coffee
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,7 +1,7 @@
{
"name": "toffee",
"description": "An Express 3.x and 2.x templating language based on CoffeeScript with slicker tokens and syntax. Built with love at OkCupid.",
- "version": "0.0.43",
+ "version": "0.0.44",
"directories": {
"lib": "./lib"
},
View
@@ -31,16 +31,20 @@ class engine
__toffee.autoEscape: if set as false, don't escape output of #{} vars by default
###
+ if options?.layout
+ layout_options = {}
+ layout_options[k] = v for k,v of options when k isnt "layout"
+
[err, res] = @runSync filename, options
# if we got an error but want to pretty-print by faking ok result
if err and @prettyPrintErrors
[err, res] = [null, err]
# if we're using a layout, pub into that
- if (not err) and options?.layout
- options.body = res
- [err, res] = @runSync options.layout, options
+ if (not err) and layout_options?
+ layout_options.body = res
+ [err, res] = @runSync options.layout, layout_options
if err and @prettyPrintErrors
[err, res] = [null, err]

0 comments on commit 6323af6

Please sign in to comment.