Permalink
Browse files

Merge pull request #114 from doug-martin/master

v0.3.0
  • Loading branch information...
doug-martin committed May 18, 2014
2 parents 29697cb + 317c821 commit 61d427fa77a7a104eed068d08144d14220591f3c
@@ -1,5 +1,3 @@
language: node_js
node_js:
- 0.6
- 0.8
- 0.10
@@ -5,6 +5,12 @@ module.exports = function (grunt) {
child = require("child_process");
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
exec: {
removeDocs: "rm -rf docs/* && mkdir -p ./docs/examples/browser && cp -r ./examples/browser/ ./docs/examples/browser && cp ./nools.min.js ./docs/nools.js",
createDocs: 'coddoc -f multi-html -d ./lib --dir ./docs'
},
jshint: {
src: ["./index.js", "lib/**/*.js", "Gruntfile.js"],
options: {
@@ -46,17 +52,33 @@ module.exports = function (grunt) {
src: ['./browser/nools.js'],
dest: './nools.js'
}
},
benchmark: {
manners: {
files: "./benchmark/manners/benchmark.js"
},
sendMoreMoney: {
files: "./benchmark/sendMoreMoney/benchmark.js"
},
simple: {
files: "./benchmark/simple/benchmark.js"
},
waltzDb: {
files: "./benchmark/waltzDb/benchmark.js"
}
}
});
// Default task.
grunt.registerTask('default', ['jshint', "compile-tests", 'it', 'browserify:nools', 'uglify:min']);
grunt.registerTask('default', ['jshint', "compile-tests", 'it', 'browserify:nools', 'uglify:min', 'exec']);
grunt.loadNpmTasks('grunt-it');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-browserify');
grunt.loadNpmTasks('grunt-exec');
grunt.registerTask("compile-tests", "compiles all lest files", function () {
grunt.registerTask("compile-tests", "compiles all nools files", function () {
var files = grunt.file.expand("./test/rules/*.nools"), count = files.length, done = this.async();
function counter(err) {
@@ -80,7 +102,20 @@ module.exports = function (grunt) {
counter(err);
});
});
});
grunt.registerTask("benchmarks", function () {
});
grunt.registerMultiTask('benchmark', 'execute it unit tests in a spawned process', function () {
var done = this.async();
require(this.data.files).classic(function (err) {
if (err) {
done(false);
} else {
done();
}
});
});
};
@@ -1,16 +1,17 @@
(function () {
"use strict";
var data = require("./data"),
nools = require("../../index");
"use strict";
var data = require("./data"),
nools = require("../../index");
var flow = nools.compile(__dirname + "/manners.nools");
var guests = data.load(flow).manners64;
var session = flow.getSession.apply(flow, guests);
session.assert(new (flow.getDefined("count"))({value: 1}));
var start = new Date();
session.match().then(function () {
console.log("Duration %dms", new Date() - start);
}, function (err) {
console.log(err.stack);
});
})();
var flow = nools.compile(__dirname + "/manners.nools");
var guests = data.load(flow).manners64;
var session = flow.getSession.apply(flow, guests);
session.assert(new (flow.getDefined("count"))({value: 1}));
var start = new Date();
module.exports = session.match().then(function () {
console.log("Duration %dms", new Date() - start);
session.dispose();
}, function (err) {
session.dispose();
console.log(err.stack);
});
@@ -6,7 +6,7 @@ var nools = require("../../index"),
var start = new Date(),
session;
console.log("starting");
(session = flow.getSession(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)).match().then(function () {
module.exports = (session = flow.getSession(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)).match().then(function () {
console.log("%dms", +(new Date()) - start);
session.dispose();
});
@@ -11,7 +11,7 @@ for (var i = 0; i < COUNT; i++) {
}
var start = new Date().getTime();
var start = new Date();
var execCount = 0;
@@ -35,13 +35,12 @@ for (var j = 0; j < COUNT; j++) {
}
}
session.match(function (err) {
module.exports = session.match(function (err) {
if (err) {
throw err;
}
var end = new Date().getTime();
var diff = end - start;
console.log("elapsed: " + diff);
console.log("Duration %dms", new Date() - start);
session.dispose();
});
@@ -8,11 +8,12 @@ var items = data.load(flow).waltzdb4;
var session = flow.getSession.apply(flow, items);
session.assert(new (flow.getDefined("stage"))({value: "DUPLICATE"}));
var start = new Date();
session.match(function (err) {
module.exports = session.match(function (err) {
if (err) {
console.log(err.stack);
} else {
console.log("Duration %dms", new Date() - start);
}
session.dispose();
});
@@ -178,6 +178,16 @@
<h1>0.3.0</h1>
<ul>
<li>Added new <code>===</code> and <code>!==</code> operators <a href="https://github.com/C2FO/nools/issues/110">#110</a></li>
<li>Fix for issue <a href="https://github.com/C2FO/nools/issues/109">#109</a></li>
<li>Updated Readme<ul>
<li>Updated agenda groups examples for <a href="https://github.com/C2FO/nools/issues/105">#105</a></li>
<li>Changed class names not to match property names in readme <a href="https://github.com/C2FO/nools/issues/99">#99</a></li>
</ul>
</li>
</ul>
<h1>0.2.3</h1>
<ul>
<li>Added new <code>getFacts</code> method to allow for querying of facts currently in session. <a href="https://github.com/C2FO/nools/issues/52">#52</a>;</li>
Oops, something went wrong.

0 comments on commit 61d427f

Please sign in to comment.