<commit_before>/**
 * Created by Scott on 5/29/2015.
 */
define(['../../lib/jSQL', '../../lib/SQLish'], function(jSQL, SQLish) {
    var app = {
        baseNode: document.getElementById('jato') || document.querySelector('body')
    };

    app.start = function() {
        // Eventually this will be a sample application and tests will be in the tests folder...
        // but for now, testing here allows for rapid development :)

        // make sure auto-publish knows the current URI
        // solves initial load of url, ie. from a bookmark - site.com/index.html#info
        // otherwise, initial url hash is not evaluated
        window.dispatchEvent(new Event('hashchange'));

        var dataObj = new DataObject(),
            model = SQLish.model,
            model2 = SQLish.model2;

        model.addListener('modelUpdate', function () {
            console.log('Model 1:', arguments);
        });

        model2.addListener('modelUpdate', function () {
            console.log('Model 2:', arguments);
        });

        dataObj.set('<NAME>', 'truth');

        // TODO: move to tests!!!
        jSQL.create.db('testDB').table('Customers')([
            ['CustomerID', {
                'primary': true,
                'auto': true,
                'domain': /\d+/i,
                'data': [
                    1, 2, 3, 4, 5
                ]
            }],
            ['CustomerName', {
                'domain': /[\w]+/gi,
                'data': [
                    '<NAME>',
                    '<NAME>',
                    '<NAME>',
                    'Around the Horn',
                    'Berglunds snabbkop'
                ]
            }],
            ['ContactName', {<commit_msg>Added tests for DataObjects and synthetic model events (provided by eventHub.js)<commit_after>/**
 * Created by Scott on 5/29/2015.
 */
define(['../../lib/jSQL', '../../lib/SQLish'], function(jSQL, SQLish) {
    var app = {
        baseNode: document.getElementById('jato') || document.querySelector('body')
    };

    app.start = function() {
        // Eventually this will be a sample application and tests will be in the tests folder...
        // but for now, testing here allows for rapid development :)

        // make sure auto-publish knows the current URI
        // solves initial load of url, ie. from a bookmark - site.com/index.html#info
        // otherwise, initial url hash is not evaluated
        window.dispatchEvent(new Event('hashchange'));

        var dataObj = new DataObject(),
            model = SQLish.model;

        model.addListener('truth', function (e) {
            // this === currentTarget
            this.log('truth was heard with args:', arguments);
            this.log('The truth about me is:', e.detail.value);
        }, console); // console was passed as the currentTarget

        model.addListener('truth.about', function () {
            this.log('truth.about was heard with args:', arguments);
        }, console);

        model.addListener('truth.about.me', function () {
            this.log('truth.about.me was heard with args:', arguments);
        }, console);

        dataObj.set('<NAME>', 'truth.about.me');

        console.log('---------------------------------------------------------------');

        // TODO: move to tests!!!
        jSQL.create.db('testDB').table('Customers')([
            ['CustomerID', {
                'primary': true,
                'auto': true,
                'domain': /\d+/i,
                'data': [
                    1, 2, 3, 4, 5
                ]
            }],
            ['CustomerName', {
                'domain': /[\w]+/gi,
                'data': [
                    '<NAME>',
                    '<NAME>',
                    '<NAME>',
                    'Around the Horn',
                    'Berglunds snabbkop'
                ]
            }],
            ['ContactName', {
{'fraction_non_alphanumeric': 0.15899795501022496, 'fraction_numerical': 0.007413087934560327, 'mean_word_length': 1.4532915360501568, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7287605', 'n_tokens_mistral': 1050, 'n_tokens_neox': 991, 'n_words': 277}