Skip to content

Commit

Permalink
[dist] package update
Browse files Browse the repository at this point in the history
  • Loading branch information
Paolo Fragomeni committed Jan 12, 2012
1 parent 3236d61 commit 0daf11c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 41 deletions.
17 changes: 8 additions & 9 deletions lib/plates.js
Expand Up @@ -6,15 +6,14 @@
Merge.prototype = {

tag: new RegExp([
'<',
'(/?)', // 2 - is closing
'([-:\\w]+)', // 3 - name
'((?:[-\\w]+(?:', '=',
'(?:\\w+|["|\'](?:.*)["|\']))?)*)', // 4 - attributes
'(/?)', // 5 - is self-closing
'>'
].join('\\s*')
),
'<',
'(/?)', // 2 - is closing
'([-:\\w]+)', // 3 - name
'((?:[-\\w]+(?:', '=',
'(?:\\w+|["|\'](?:.*)["|\']))?)*)', // 4 - attributes
'(/?)', // 5 - is self-closing
'>'
].join('\\s*')),

attr: /([\-\w]*)=(?:["\']([\-\.\w\s\/]*)["\'])/gi,

Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -19,7 +19,7 @@
"benchmark" : "0.2.x"
},
"scripts": {
"test": "vows --spec test/*test.js"
"test": "vows --spec test/api-test.js"
},
"engines": ["node"],
"main" : "./lib/plates.js"
Expand Down
60 changes: 30 additions & 30 deletions test/api-test.js
Expand Up @@ -6,56 +6,56 @@ var vows = require('vows'),
vows.describe('merge data into markup').addBatch({
'when providing both data and markup': {

// '(1) a single tag with an `id` that corresponds to a `data-key`.': (
'(1) a single tag with an `id` that corresponds to a `data-key`.': (

// function() {
// return common.createTest('test-1');
// }()
function() {
return common.createTest('test-1');
}()

// ),
),

// '(2) a deeply nested tag with an `id` that corresponds to a `data-key`.': (
'(2) a deeply nested tag with an `id` that corresponds to a `data-key`.': (

// function() {
// return common.createTest('test-2');
// }()
function() {
return common.createTest('test-2');
}()

// ),
),

// '(3) a tag with an `id` that corresponds to a `data-key`, having a body of nested tags.': (
'(3) a tag with an `id` that corresponds to a `data-key`, having a body of nested tags.': (

// function() {
// return common.createTest('test-3');
// }()
function() {
return common.createTest('test-3');
}()

// ),
),

// '(4) a tag with an arbitrary attribute that corresponds to a `data-key`.': (
'(4) a tag with an arbitrary attribute that corresponds to a `data-key`.': (

// function() {
function() {

// var map = new Plates.Map();
// map.where('src').is('google.com').use('key1');
// map.where('src').is('yahoo.com').use('key2');
var map = new Plates.Map();
map.where('src').is('google.com').use('key1');
map.where('src').is('yahoo.com').use('key2');

// return common.createTest('test-4', map);
return common.createTest('test-4', map);

// }()
}()

// ),
),

// '(5) a tag with a class attribute whith a value that corresponds to a `data-key`.': (
'(5) a tag with a class attribute whith a value that corresponds to a `data-key`.': (

// function() {
function() {

// var map = new Plates.Map();
// map.where('class').is('hidden').use('key1');
var map = new Plates.Map();
map.where('class').is('hidden').use('key1');

// return common.createTest('test-5', map);
return common.createTest('test-5', map);

// }()
}()

// ),
),


'(6) a tag with a class attribute whith a value that corresponds to a `data-key`.': (
Expand Down
2 changes: 1 addition & 1 deletion test/perf-test.js
Expand Up @@ -2,7 +2,7 @@ var Benchmark = require('benchmark');
var suite = new Benchmark.Suite();

var Mustache = require('mustache');
var Plates = require('../../lib/plates');
var Plates = require('../lib/plates');

suite

Expand Down

0 comments on commit 0daf11c

Please sign in to comment.