Skip to content

Commit

Permalink
Update jade template plugin to conform with new template plugin struc…
Browse files Browse the repository at this point in the history
…ture
  • Loading branch information
jnordberg committed Mar 19, 2012
1 parent e7103a1 commit 62a941e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/plugins/jade-template.coffee
Expand Up @@ -2,6 +2,7 @@
async = require 'async'
jade = require 'jade'
fs = require 'fs'
path = require 'path'

{TemplatePlugin} = require './../templates'

Expand All @@ -15,14 +16,15 @@ class JadeTemplate extends TemplatePlugin
catch error
callback error

JadeTemplate.fromFile = (filename, callback) ->
JadeTemplate.fromFile = (filename, base, callback) ->
fullpath = path.join base, filename
async.waterfall [
(callback) ->
fs.readFile filename, callback
fs.readFile fullpath, callback
(buffer, callback) ->
try
rv = jade.compile buffer.toString(),
filename: filename
filename: fullpath
callback null, new JadeTemplate rv
catch error
callback error
Expand Down

0 comments on commit 62a941e

Please sign in to comment.