Skip to content

Commit

Permalink
Removed "_" prefix from partials
Browse files Browse the repository at this point in the history
  • Loading branch information
tj committed Dec 10, 2010
1 parent 6f6f9f0 commit 2662dae
Show file tree
Hide file tree
Showing 21 changed files with 6 additions and 19 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
13 changes: 0 additions & 13 deletions lib/express/view/partial.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ var cache = {};
var Partial = exports = module.exports = function Partial(view, options) {
options = options || {};
View.call(this, view, options);
this.path = this.resolvePartialPath(this.dirname);
};

/**
Expand All @@ -38,18 +37,6 @@ var Partial = exports = module.exports = function Partial(view, options) {

Partial.prototype.__proto__ = View.prototype;

/**
* Resolve partial view path.
*
* @param {String} dir
* @return {String}
* @api public
*/

Partial.prototype.resolvePartialPath = function(dir){
return dir + '/_' + basename(this.path);
};

/**
* Resolve partial object name from the view path.
*
Expand Down
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/fixtures/greetings.jade
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
h1= name
!= partial('greetings', { locals: { name: otherName }})
!= partial('greeting', { locals: { name: otherName }})
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
10 changes: 5 additions & 5 deletions test/view.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,19 +106,19 @@ module.exports = {
var fixtures = __dirname + '/fixtures';

var view = new Partial('user.jade', { root: fixtures });
view.path.should.equal(fixtures + '/_user.jade');
view.path.should.equal(fixtures + '/user.jade');

var view = new Partial('user', { parentView: view, root: fixtures });
view.path.should.equal(fixtures + '/_user.jade');
view.path.should.equal(fixtures + '/user.jade');

var view = new Partial('forum/thread', { parentView: view });
view.path.should.equal(fixtures + '/forum/_thread.jade');
view.path.should.equal(fixtures + '/forum/thread.jade');

var view = new Partial('forum/thread.jade', { root: fixtures });
view.path.should.equal(fixtures + '/forum/_thread.jade');
view.path.should.equal(fixtures + '/forum/thread.jade');

var view = new Partial('thread', { parentView: view });
view.path.should.equal(fixtures + '/forum/_thread.jade');
view.path.should.equal(fixtures + '/forum/thread.jade');
},

'test #render()': function(){
Expand Down

0 comments on commit 2662dae

Please sign in to comment.