From 0daf11ccee78539afb8a9e1517733d814e3d61de Mon Sep 17 00:00:00 2001 From: Paolo Fragomeni Date: Thu, 12 Jan 2012 00:41:10 -0500 Subject: [PATCH] [dist] package update --- lib/plates.js | 17 +++++++------- package.json | 2 +- test/api-test.js | 60 +++++++++++++++++++++++------------------------ test/perf-test.js | 2 +- 4 files changed, 40 insertions(+), 41 deletions(-) diff --git a/lib/plates.js b/lib/plates.js index 732e1dd..d4a230a 100644 --- a/lib/plates.js +++ b/lib/plates.js @@ -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, diff --git a/package.json b/package.json index a5b5fa5..516e983 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/test/api-test.js b/test/api-test.js index 1184759..9efcecf 100644 --- a/test/api-test.js +++ b/test/api-test.js @@ -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`.': ( diff --git a/test/perf-test.js b/test/perf-test.js index da9c33d..aed017e 100644 --- a/test/perf-test.js +++ b/test/perf-test.js @@ -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