Permalink
Browse files

Prefix implicit root option with __

  • Loading branch information...
1 parent db691b6 commit c039dcf4b51025763cb9f71d561b8faafbbd3c1e @eldargab committed May 21, 2012
Showing with 9 additions and 8 deletions.
  1. +1 −1 lib/engines/less.js
  2. +7 −6 lib/engines/stylus.js
  3. +1 −1 lib/index.js
View
@@ -12,7 +12,7 @@ module.exports = function () {
function render (file, cb) {
var paths = this.paths
? this.paths
- : this.root ? [this.root] : null
+ : this.__root ? [this.__root] : null
var parser = new Parser({
filename: file,
View
@@ -7,16 +7,17 @@ module.exports = function () {
contentType: 'text/css',
renderFile: function (file, cb) {
- var paths = this.paths
+ this.paths = this.paths
? this.paths
- : this.root ? [this.root] : null
+ : this.__root ? [this.__root] : null
+
+ this.filename = file
+
+ var opts = this
fs.readFile(file, 'utf8', function (error, str) {
if (error) return cb(error)
- stylus.render(str, {
- filename: file,
- paths: paths
- }, cb)
+ stylus.render(str, opts, cb)
})
}
}
View
@@ -31,7 +31,7 @@ Views.engine = function engine (ext, opts) {
eng = cache[ext] = opts[ext] || Views.engines(ext) || null
if (eng) {
var extName = ext.substring(1)
- mix(eng, {root: opts.root}, opts['*'], opts[extName])
+ mix(eng, {__root: opts.root}, opts['*'], opts[extName])
}
}
return eng ? Object.create(eng) : null

0 comments on commit c039dcf

Please sign in to comment.