<commit_before>"use strict";

var assert = require('assert');
var webdriverio = require('webdriverio');
var q = require('q');

var injectEventLogger = function() {

    var DEBUG = false;

    function EventLogger() {
        this.eventNames = ["XDdisconnection", "XDconnection", "XDdevice", "XDroles", "XDsync", "XDserverReady", "XDothersRolesChanged"];
        this.eventCounter = {};

        this.eventNames.forEach((function (event) {
            this.eventCounter[event] = 0;
            XDmvc.on(event, (function (sender) {
                this.eventCounter[event]++;
                if (DEBUG) {
                    console.log(event);
                    console.log(sender);
                    console.log(this.eventCounter);
                }
            }).bind(this))
        }).bind(this));
    }

    window.eventLogger = new EventLogger();
    return 0;
};

var getEventCounter = function() {
    return window.eventLogger.eventCounter;
};

var utility = {
    setupConnectedBrowsers: function() {
        var self = this;

        var deviceA = self.devices.select('A');

        return deviceA.url(self.baseUrl).then(function () {
            console.log('A: init');
        }).execute(function () {
            return 1 + 2;
        }).then(function (ret) {

            console.log('A: executed script');
            console.log(ret.value);
            assert.equal(ret.value, 3);
        }).execute(injectEventLogger).then(function () {
            console.log('A: injected event logger');
        }).getUrl().then(function (url) {

            var allButA = Object.keys(self.deviceOptions).filter(function (deviceName) {
                return deviceName != 'A';
            });
            return multiAction(self.devices, allButA, function (device) {
                return device.url(url);
                //return self.deviceB.url(url).then(function () {
            }).then(function () {
                console.log('init urls');

                return deviceA.waitUntil(function () {
                    return deviceA.execute(getEventCounter).then(function (ret) {
                        console.log('A: got eventCounter: ');
                        console.log(ret.value);
                        console.log('devices.length: ' + self.devicesCount());
                        return ret.value.XDconnection == self.devicesCount() - 1;
                        //return ret.value.XDconnection == devicesButA.count();
                    });
                });
            });
        })
    },

    devicesCount : function() {
        var self = this;
        return Object.keys(self.deviceOptions).length;
    }
};

/**
 * Executes callback on devices matching deviceNames.
 * Returns an promise.
 * @param devices
 * @param deviceNames
 * @param callback
 * @returns
 */
function multiAction (devices, deviceNames, callback) {
    var promises = [];
    deviceNames.forEach(function(name) {
        promises.push(callback(devices.select(name)));
    });
    return q.all(promises);
}

describe('XD-MVC Example Gallery', function() {
    var self = this;

    // Set test timeout
    this.timeout(15 * 1000);

    self.deviceOptions = {};
    self.devices = {};
    self.baseUrl = "http://me.local:8082/gallery.html";

    // Bind function to this reference
    self.setupConnectedBrowsers = utility.setupConnectedBrowsers.bind(self);
    self.devicesCount = utility.devicesCount.bind(self);

    var initWithDevices = function(devices) {
        self.deviceOptions = devices;
        // New browser instance with WebdriverIO
        self.devices = webdriverio.multiremote(self.deviceOptions);
        //attachCustomFunctions(this.devices);

        var tileWidth = Math.floor(1600 / self.devicesCount());

        return self.devices.init()
            .timeoutsAsyncScript(5 * 1000)
            .windowHandleSize({width: tileWidth, height: 600})
            .then(function () {
                // Align windows on screen
                var x = 0;
                Object.keys(self.deviceOptions).forEach(function (deviceName) {
                    self.devices.select(deviceName).windowHandlePosition({x: x, y: 0});
                    x += tileWidth;
                });

                // legacy variables
                self.deviceA = self.devices.select('A');
                self.deviceB = self.devices.select('B');
            });
    }.bind(this);

    beforeEach(function () {
    });

    afterEach(function() {
        // Close browser before completing a test
        return self.devices.end();
    });

    describe('eventLogger', function() {
        it ('should count XDconnection events', function() {

            return initWithDevices({A: templates.windows_chrome, B: templates.windows_chrome}).then(function() {
                return self.setupConnectedBrowsers();
            }).then(function() {
                return self.deviceA.execute(getEventCounter).then(function(ret) {
                    console.log('A: got eventCounter: ');
                    console.log(ret.value);
                    assert.equal(ret.value.XDconnection, self.devicesCount() - 1);
                });
            });
        });
    });

    it('should not share cookies across browser sessions', function () {

        return initWithDevices({A: templates.windows_chrome, B: templates.windows_chrome}).then(function() {
            return self.setupConnectedBrowsers();
        }).then(function() {
            return self.deviceA.url(this.baseUrl).then(function () {
                return self.deviceB.url(self.baseUrl);
            }).setCookie({name: 'test_cookieA', value: 'A'})
            .getCookie('test_cookieA').then(function (cookie) {

                assert.notEqual(cookie, null);
                assert.equal(cookie.name, 'test_cookieA');
                assert.equal(cookie.value, 'A');

                return self.deviceB.setCookie({name: 'test_cookieB', value: 'B'})
                .getCookie('test_cookieB').then(function (cookie) {

                    assert.notEqual(cookie, null);
                    assert.equal(cookie.name, 'test_cookieB');
                    assert.equal(cookie.value, 'B');

                }).getCookie('test_cookieA').then(function (cookie) {
                    assert.equal(cookie, null);
                });
            });
        });
    });

    it('should not share local storage across browser sessions', function () {
        var getItem = function(key) {
            return localStorage.getItem(key);
        };

        var setItem = function(key, value) {
            localStorage.setItem(key, value);
        };

        return initWithDevices({A: templates.windows_chrome, B: templates.windows_chrome}).then(function() {
            return self.setupConnectedBrowsers();
        }).then(function() {
            return self.deviceA.url(self.baseUrl).then(function () {
                return self.deviceB.url(self.baseUrl);
            }).execute(setItem, 'test_storageA', 'A')
            .execute(getItem, 'test_storageA').then(function (ret) {
                assert.equal(ret.value, 'A');

                return self.deviceB.execute(getItem, 'test_storageA').then(function (ret) {
                    return assert.equal(ret.value, null);
                });
            });
        });
    });

    var templates = {
        windows_chrome: {
            name: 'Chrome (Win)',
            desiredCapabilities: {browserName: 'chrome'}
        },
        nexus4: {
            name: 'Nexus 4',
            desiredCapabilities: {browserName: 'chrome'}
        }
    };

    describe.only('should show the selected image on the other devices', function () {

        var setups = [
            {devices: {A: templates.windows_chrome, B: templates.nexus4}},
            {devices: {A: templates.windows_chrome, B: templates.nexus4, C: templates.nexus4}}
        ];

        setups.forEach(function(setup) {

            // Assemble setup name
            var setupName = Object.keys(setup.devices).map(function(key) {
                var dev = setup.devices[key];
                return dev.name;
            }).join(', ');

            it('on ' + setupName, function() {

                var imageUrlA;

                return initWithDevices(setup.devices).then(function() {
                    return self.setupConnectedBrowsers();
                }).then(function() {
                    self.deviceA.waitForVisible('h2.gallery-overview', 5000).then(function () {
                        console.log('A: h2.gallery-overview is visible');
                    }).click('//*[text()="Bike Tours"]').then(function () {
                        console.log('A: clicked Bike Tours');
                    }).waitForVisible('#gallery img:nth-of-type(1)').then(function () {
                        console.log('A: first image is visible');
                    }).click('#gallery img:nth-of-type(1)').then(function () {
                        console.log('A: clicked first image in galery');
                    }).waitForVisible('#image img').then(function () {
                        console.log('A: #image img is visible');
                    }).scroll(0, 10000).then(function () {
                        console.log('A: scrolled down to the end');
                    }).getAttribute('#image img', 'src').then(function (src) {
                        imageUrlA = src;
                        console.log('A: image src ' + src);
                    }).getUrl().then(function (url) {

                        var allButA = Object.keys(self.deviceOptions).filter(function (deviceName) {
                            return deviceName != 'A';
                        });
                        var i = 0;
                        return multiAction(self.devices, allButA, function (device) {
                            return device.waitForVisible('#image img', 3000);
                        }).then(function () {
                            console.log('B: image found');
                            return multiAction(self.devices, allButA, function (device) {
                                return device.getAttribute('#image img', 'src');
                            });
                        }).then(function (srcs) {
                            Object.keys(srcs).forEach(function (key) {
                                var src = srcs[key];
                                console.log('A: imageUrlA ' + imageUrlA);
                                console.log('B: image src ' + src);
                                assert.equal(src, imageUrlA);
                            });

                            return multiAction(self.devices, allButA, function (device) {
                                return device.saveScreenshot('./screenshots/device' + i + '.png', function (err, screenshot, response) {
                                    console.log(i + ': save screenshot');
                                    console.log('err: ' + err);
                                    i++;
                                });
                            });
                        });
                    }).saveScreenshot('./screenshots/deviceA.png', function (err, screenshot, response) {
                        console.log('A: save screenshot');
                        console.log('err: ' + err);
                    });
                });
            });
        });
    });
});
<commit_msg>Fix bug: Return a promise<commit_after>"use strict";

var assert = require('assert');
var webdriverio = require('webdriverio');
var q = require('q');

var injectEventLogger = function() {

    var DEBUG = false;

    function EventLogger() {
        this.eventNames = ["XDdisconnection", "XDconnection", "XDdevice", "XDroles", "XDsync", "XDserverReady", "XDothersRolesChanged"];
        this.eventCounter = {};

        this.eventNames.forEach((function (event) {
            this.eventCounter[event] = 0;
            XDmvc.on(event, (function (sender) {
                this.eventCounter[event]++;
                if (DEBUG) {
                    console.log(event);
                    console.log(sender);
                    console.log(this.eventCounter);
                }
            }).bind(this))
        }).bind(this));
    }

    window.eventLogger = new EventLogger();
    return 0;
};

var getEventCounter = function() {
    return window.eventLogger.eventCounter;
};

var utility = {
    setupConnectedBrowsers: function() {
        var self = this;

        var deviceA = self.devices.select('A');

        return deviceA.url(self.baseUrl).then(function () {
            console.log('A: init');
        }).execute(function () {
            return 1 + 2;
        }).then(function (ret) {

            console.log('A: executed script');
            console.log(ret.value);
            assert.equal(ret.value, 3);
        }).execute(injectEventLogger).then(function () {
            console.log('A: injected event logger');
        }).getUrl().then(function (url) {

            var allButA = Object.keys(self.deviceOptions).filter(function (deviceName) {
                return deviceName != 'A';
            });
            return multiAction(self.devices, allButA, function (device) {
                return device.url(url);
                //return self.deviceB.url(url).then(function () {
            }).then(function () {
                console.log('init urls');

                return deviceA.waitUntil(function () {
                    return deviceA.execute(getEventCounter).then(function (ret) {
                        console.log('A: got eventCounter: ');
                        console.log(ret.value);
                        console.log('devices.length: ' + self.devicesCount());
                        return ret.value.XDconnection == self.devicesCount() - 1;
                        //return ret.value.XDconnection == devicesButA.count();
                    });
                });
            });
        })
    },

    devicesCount : function() {
        var self = this;
        return Object.keys(self.deviceOptions).length;
    }
};

/**
 * Executes callback on devices matching deviceNames.
 * Returns an promise.
 * @param devices
 * @param deviceNames
 * @param callback
 * @returns
 */
function multiAction (devices, deviceNames, callback) {
    var promises = [];
    deviceNames.forEach(function(name) {
        promises.push(callback(devices.select(name)));
    });
    return q.all(promises);
}

describe('XD-MVC Example Gallery', function() {
    var self = this;

    // Set test timeout
    this.timeout(15 * 1000);

    self.deviceOptions = {};
    self.devices = {};
    self.baseUrl = "http://me.local:8082/gallery.html";

    // Bind function to this reference
    self.setupConnectedBrowsers = utility.setupConnectedBrowsers.bind(self);
    self.devicesCount = utility.devicesCount.bind(self);

    var initWithDevices = function(devices) {
        self.deviceOptions = devices;
        // New browser instance with WebdriverIO
        self.devices = webdriverio.multiremote(self.deviceOptions);
        //attachCustomFunctions(this.devices);

        var tileWidth = Math.floor(1600 / self.devicesCount());

        return self.devices.init()
            .timeoutsAsyncScript(5 * 1000)
            .windowHandleSize({width: tileWidth, height: 600})
            .then(function () {
                // Align windows on screen
                var x = 0;
                Object.keys(self.deviceOptions).forEach(function (deviceName) {
                    self.devices.select(deviceName).windowHandlePosition({x: x, y: 0});
                    x += tileWidth;
                });

                // legacy variables
                self.deviceA = self.devices.select('A');
                self.deviceB = self.devices.select('B');
            });
    }.bind(this);

    beforeEach(function () {
    });

    afterEach(function() {
        // Close browser before completing a test
        return self.devices.end();
    });

    describe('eventLogger', function() {
        it ('should count XDconnection events', function() {

            return initWithDevices({A: templates.windows_chrome, B: templates.windows_chrome}).then(function() {
                return self.setupConnectedBrowsers();
            }).then(function() {
                return self.deviceA.execute(getEventCounter).then(function(ret) {
                    console.log('A: got eventCounter: ');
                    console.log(ret.value);
                    assert.equal(ret.value.XDconnection, self.devicesCount() - 1);
                });
            });
        });
    });

    it('should not share cookies across browser sessions', function () {

        return initWithDevices({A: templates.windows_chrome, B: templates.windows_chrome}).then(function() {
            return self.setupConnectedBrowsers();
        }).then(function() {
            return self.deviceA.url(this.baseUrl).then(function () {
                return self.deviceB.url(self.baseUrl);
            }).setCookie({name: 'test_cookieA', value: 'A'})
            .getCookie('test_cookieA').then(function (cookie) {

                assert.notEqual(cookie, null);
                assert.equal(cookie.name, 'test_cookieA');
                assert.equal(cookie.value, 'A');

                return self.deviceB.setCookie({name: 'test_cookieB', value: 'B'})
                .getCookie('test_cookieB').then(function (cookie) {

                    assert.notEqual(cookie, null);
                    assert.equal(cookie.name, 'test_cookieB');
                    assert.equal(cookie.value, 'B');

                }).getCookie('test_cookieA').then(function (cookie) {
                    assert.equal(cookie, null);
                });
            });
        });
    });

    it('should not share local storage across browser sessions', function () {
        var getItem = function(key) {
            return localStorage.getItem(key);
        };

        var setItem = function(key, value) {
            localStorage.setItem(key, value);
        };

        return initWithDevices({A: templates.windows_chrome, B: templates.windows_chrome}).then(function() {
            return self.setupConnectedBrowsers();
        }).then(function() {
            return self.deviceA.url(self.baseUrl).then(function () {
                return self.deviceB.url(self.baseUrl);
            }).execute(setItem, 'test_storageA', 'A')
            .execute(getItem, 'test_storageA').then(function (ret) {
                assert.equal(ret.value, 'A');

                return self.deviceB.execute(getItem, 'test_storageA').then(function (ret) {
                    return assert.equal(ret.value, null);
                });
            });
        });
    });

    var templates = {
        windows_chrome: {
            name: 'Chrome (Win)',
            desiredCapabilities: {browserName: 'chrome'}
        },
        nexus4: {
            name: 'Nexus 4',
            desiredCapabilities: {browserName: 'chrome'}
        }
    };

    describe('should show the selected image on the other devices', function () {

        var setups = [
            {devices: {A: templates.windows_chrome, B: templates.nexus4}},
            {devices: {A: templates.windows_chrome, B: templates.nexus4, C: templates.nexus4}}
        ];

        setups.forEach(function(setup) {

            // Assemble setup name
            var setupName = Object.keys(setup.devices).map(function(key) {
                var dev = setup.devices[key];
                return dev.name;
            }).join(', ');

            it('on ' + setupName, function() {

                var imageUrlA;

                return initWithDevices(setup.devices).then(function() {
                    return self.setupConnectedBrowsers();
                }).then(function() {
                    return self.deviceA.waitForVisible('h2.gallery-overview', 5000).then(function () {
                        console.log('A: h2.gallery-overview is visible');
                    }).click('//*[text()="Bike Tours"]').then(function () {
                        console.log('A: clicked Bike Tours');
                    }).waitForVisible('#gallery img:nth-of-type(1)').then(function () {
                        console.log('A: first image is visible');
                    }).click('#gallery img:nth-of-type(1)').then(function () {
                        console.log('A: clicked first image in galery');
                    }).waitForVisible('#image img').then(function () {
                        console.log('A: #image img is visible');
                    }).scroll(0, 10000).then(function () {
                        console.log('A: scrolled down to the end');
                    }).getAttribute('#image img', 'src').then(function (src) {
                        imageUrlA = src;
                        console.log('A: image src ' + src);
                    }).getUrl().then(function (url) {

                        var allButA = Object.keys(self.deviceOptions).filter(function (deviceName) {
                            return deviceName != 'A';
                        });
                        var i = 0;
                        return multiAction(self.devices, allButA, function (device) {
                            return device.waitForVisible('#image img', 3000);
                        }).then(function () {
                            console.log('B: image found');
                            return multiAction(self.devices, allButA, function (device) {
                                return device.getAttribute('#image img', 'src');
                            });
                        }).then(function (srcs) {
                            Object.keys(srcs).forEach(function (key) {
                                var src = srcs[key];
                                console.log('A: imageUrlA ' + imageUrlA);
                                console.log('B: image src ' + src);
                                assert.equal(src, imageUrlA);
                            });

                            return multiAction(self.devices, allButA, function (device) {
                                return device.saveScreenshot('./screenshots/device' + i + '.png', function (err, screenshot, response) {
                                    console.log(i + ': save screenshot');
                                    console.log('err: ' + err);
                                    i++;
                                });
                            });
                        });
                    }).saveScreenshot('./screenshots/deviceA.png', function (err, screenshot, response) {
                        console.log('A: save screenshot');
                        console.log('err: ' + err);
                    });
                });
            });
        });
    });
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'babrahams:constellation-distro',
  version: '0.1.0',
  summary: 'A set of packages to get you started with Constellation',
  git: 'https://github.com/JackAdams/constellation-distro.git',
  documentation: 'README.md',
  debugOnly: true
});

Package.onUse(function(api) {

  api.versionsFrom('1.1');

  api.use('constellation:console@1.1.5');
  api.use('babrahams:temple@0.2.5');
  api.use('constellation:subscriptions@0.2.5');
  api.use('constellation:session@0.2.5');
  api.use('constellation:autopublish@0.2.5');

});

Package.onTest(function(api) {
  api.use('tinytest');
});
<commit_msg>Updated dependencies<commit_after>Package.describe({
  name: 'babrahams:constellation-distro',
  version: '0.1.0',
  summary: 'A set of packages to get you started with Constellation',
  git: 'https://github.com/JackAdams/constellation-distro.git',
  documentation: 'README.md',
  debugOnly: true
});

Package.onUse(function(api) {

  api.versionsFrom('1.1');

  api.use('constellation:console@1.1.6');
  api.use('babrahams:temple@0.2.6');
  api.use('constellation:subscriptions@0.2.6');
  api.use('constellation:session@0.2.6');
  api.use('constellation:autopublish@0.2.6');

});

Package.onTest(function(api) {
  api.use('tinytest');
});
<|endoftext|>


<commit_before>/* jshint: */
/*global public_functions assert require flipcss fs:true sinon:true */

fs = require("fs");
sinon = require("sinon");

if (typeof require !== "undefined") {
    var buster = require("buster");
    var lib = require("../flipcss");
}

buster.assertions.add("pathFlipsTo", {
    assert: function (inputPath, expectedOutputPath) {
        var input = fs.readFileSync(inputPath).toString();
        var expectedOutput = fs.readFileSync(expectedOutputPath).toString();

        this.output = lib.flip(input);
        return this.output === expectedOutput;
    },
    assertMessage: "Expected ${0} to flip to ${1}, got \"${output}\".",
    refuteMessage: "Expected ${0} to not flip to ${1}, got \"${output}\"."
});

buster.assertions.add("flipsTo", {
    assert: function (input, expectedOutput) {
        this.output = lib.flip(input);
        return this.output === expectedOutput;
    },
    assertMessage: "Expected \"${0}\" to flip to \"${1}\", got \"${output}\".",
    refuteMessage: "Expected \"${0}\" to not flip to \"${1}\","
        + " got \"${output}\"."
});

buster.testCase("Functional tests: Flip stylesheet w/ pre-processing", {
    setUp: function () {
        sinon.spy(console, "log");
    },

    tearDown: function () {
        console.log.restore();
    },

    "flip without warnings": function() {
        var pre_func = lib.clean;

        var input = fs.readFileSync("fixtures/input_all.css").toString();
        var output = fs.readFileSync("fixtures/output_all.css").toString();

        input = pre_func(input, "rtl");
        assert.flipsTo(input, output);
    },

    "flip with warnings": function() {
        var func = lib.flip;
        var pre_func = lib.clean;

        var input = fs.readFileSync("fixtures/input_all.css").toString();
        var output = fs.readFileSync("fixtures/output_all.css").toString();

        input = pre_func(input, "rtl");
        assert.equals(func(input, true), output);

        // Check that warnings are given
        assert(console.log.calledTwice);
        var spyCall = console.log.getCall(0);
        assert(-1 < spyCall.args[0].indexOf("Warning: Inline"));
    }
});

buster.testCase("Flip CSS", {
    "swap words ('left' and 'right')": function() {
        assert.pathFlipsTo("fixtures/input_swap_words.css",
                           "fixtures/output_swap_words.css");
    },

    "swap values (margin/padding)": function() {
        assert.pathFlipsTo("fixtures/input_swap_values.css",
                           "fixtures/output_swap_values.css");
    },

    "swap background position values": function() {
        assert.pathFlipsTo("fixtures/input_background_position.css",
                           "fixtures/output_background_position.css");
    }
});

buster.testCase("Direction specific CSS", {
    "add direction rule to body": function() {
        var input, output;

        input = "body { display: inline-block; }";
        output = "body {direction:rtl; display: inline-block; }";
        assert.flipsTo(input, output);

        input = "foo {} body { display: inline-block; } bar {}";
        output = "foo {} body {direction:rtl; display: inline-block; } bar {}";
        assert.flipsTo(input, output);
    },

    "add body group with direction rule": function() {
        var input = "div { display: inline-block; }";
        var output = "body{direction:rtl;}div { display: inline-block; }";
        assert.flipsTo(input, output);
    },

    "direction-specific rules left unchanged on flip": function() {
        var input, output;

        // Left/right swapping:
        input = "margin: left; /* !rtl-only */";
        output = "body{direction:rtl;}margin: left; /* !rtl-only */";
        assert.flipsTo(input, output);

        input = "margin: left; /* !ltr-only */"; // would normally be cleaned
        output = "body{direction:rtl;}margin: left; /* !ltr-only */";
        assert.flipsTo(input, output);

        // Background position swapping
        input = "background: url('@{image-url}/foo.bar') 60% 0 no-repeat;"
            + "/* !rtl-only */";
        output = "body{direction:rtl;}background: url('@{image-url}/foo.bar')"
            + "60% 0 no-repeat; /* !rtl-only */";

        // Margin/padding value swapping
        input = "padding: 0.5em 1em 0.5em 3.2em; /* !rtl-only */";
        output = "body{direction:rtl;}padding: 0.5em 1em 0.5em 3.2em; "
               + "/* !rtl-only */";

        assert.flipsTo(input, output);
    }
});

buster.testCase("clean rules", {
    "delete rtl-only CSS rules": function() {
        var func = lib.clean;

        var input = fs.readFileSync("fixtures/input_delete_rule.css")
            .toString();
        var output = fs.readFileSync("fixtures/output_delete_rule.css")
            .toString();
        assert.equals(func(input, "ltr"), output);
    }
});
<commit_msg>Refactor tests: Remove variables.<commit_after>/* jshint: */
/*global public_functions assert require flipcss fs:true sinon:true */

fs = require("fs");
sinon = require("sinon");

if (typeof require !== "undefined") {
    var buster = require("buster");
    var lib = require("../flipcss");
}

buster.assertions.add("pathFlipsTo", {
    assert: function (inputPath, expectedOutputPath) {
        var input = fs.readFileSync(inputPath).toString();
        var expectedOutput = fs.readFileSync(expectedOutputPath).toString();

        this.output = lib.flip(input);
        return this.output === expectedOutput;
    },
    assertMessage: "Expected ${0} to flip to ${1}, got \"${output}\".",
    refuteMessage: "Expected ${0} to not flip to ${1}, got \"${output}\"."
});

buster.assertions.add("flipsTo", {
    assert: function (input, expectedOutput) {
        this.output = lib.flip(input);
        return this.output === expectedOutput;
    },
    assertMessage: "Expected \"${0}\" to flip to \"${1}\", got \"${output}\".",
    refuteMessage: "Expected \"${0}\" to not flip to \"${1}\","
        + " got \"${output}\"."
});

buster.testCase("Functional tests: Flip stylesheet w/ pre-processing", {
    setUp: function () {
        sinon.spy(console, "log");
    },

    tearDown: function () {
        console.log.restore();
    },

    "flip without warnings": function() {
        var input = fs.readFileSync("fixtures/input_all.css").toString();
        var output = fs.readFileSync("fixtures/output_all.css").toString();

        input = lib.clean(input, "rtl");
        assert.flipsTo(input, output);
    },

    "flip with warnings": function() {
        var input = fs.readFileSync("fixtures/input_all.css").toString();
        var output = fs.readFileSync("fixtures/output_all.css").toString();

        input = lib.clean(input, "rtl");
        assert.equals(lib.flip(input, true), output);

        // Check that warnings are given
        assert(console.log.calledTwice);
        var spyCall = console.log.getCall(0);
        assert(-1 < spyCall.args[0].indexOf("Warning: Inline"));
    }
});

buster.testCase("Flip CSS", {
    "swap words ('left' and 'right')": function() {
        assert.pathFlipsTo("fixtures/input_swap_words.css",
                           "fixtures/output_swap_words.css");
    },

    "swap values (margin/padding)": function() {
        assert.pathFlipsTo("fixtures/input_swap_values.css",
                           "fixtures/output_swap_values.css");
    },

    "swap background position values": function() {
        assert.pathFlipsTo("fixtures/input_background_position.css",
                           "fixtures/output_background_position.css");
    }
});

buster.testCase("Direction specific CSS", {
    "add direction rule to body": function() {
        var input, output;

        input = "body { display: inline-block; }";
        output = "body {direction:rtl; display: inline-block; }";
        assert.flipsTo(input, output);

        input = "foo {} body { display: inline-block; } bar {}";
        output = "foo {} body {direction:rtl; display: inline-block; } bar {}";
        assert.flipsTo(input, output);
    },

    "add body group with direction rule": function() {
        var input = "div { display: inline-block; }";
        var output = "body{direction:rtl;}div { display: inline-block; }";
        assert.flipsTo(input, output);
    },

    "direction-specific rules left unchanged on flip": function() {
        var input, output;

        // Left/right swapping:
        input = "margin: left; /* !rtl-only */";
        output = "body{direction:rtl;}margin: left; /* !rtl-only */";
        assert.flipsTo(input, output);

        input = "margin: left; /* !ltr-only */"; // would normally be cleaned
        output = "body{direction:rtl;}margin: left; /* !ltr-only */";
        assert.flipsTo(input, output);

        // Background position swapping
        input = "background: url('@{image-url}/foo.bar') 60% 0 no-repeat;"
            + "/* !rtl-only */";
        output = "body{direction:rtl;}background: url('@{image-url}/foo.bar')"
            + "60% 0 no-repeat; /* !rtl-only */";

        // Margin/padding value swapping
        input = "padding: 0.5em 1em 0.5em 3.2em; /* !rtl-only */";
        output = "body{direction:rtl;}padding: 0.5em 1em 0.5em 3.2em; "
               + "/* !rtl-only */";

        assert.flipsTo(input, output);
    }
});

buster.testCase("clean rules", {
    "delete rtl-only CSS rules": function() {
        var func = lib.clean;

        var input = fs.readFileSync("fixtures/input_delete_rule.css")
            .toString();
        var output = fs.readFileSync("fixtures/output_delete_rule.css")
            .toString();
        assert.equals(func(input, "ltr"), output);
    }
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'qulture:qr-ui-base',
  version: '0.2.0',
  summary: 'QR base react components and styles',
  git: 'https://github.com/qulture/qr-ui-base',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.3.2.4');
  api.export('QRUIBaseSettings');

  api.use('ecmascript');
  api.use('fourseven:scss@3.4.3');
  api.use('wolves:bourbon@3.1.0');
  api.use('cinn:react-form-helpers@1.0.0');

  api.addAssets([
    'public/fonts/font-icons.eot',
    'public/fonts/font-icons.ttf',
    'public/fonts/font-icons.woff',
    'public/fonts/font-icons.svg'
  ], 'client');

  api.addFiles('styles/_qr-base.scss', 'client', { isImport: true });
  api.addFiles('qr-ui-base.js', 'client');
});
<commit_msg>0.2.1 version<commit_after>Package.describe({
  name: 'qulture:qr-ui-base',
  version: '0.2.1',
  summary: 'QR base react components and styles',
  git: 'https://github.com/qulture/qr-ui-base',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.3.2.4');
  api.export('QRUIBaseSettings');

  api.use('ecmascript');
  api.use('fourseven:scss@3.4.3');
  api.use('wolves:bourbon@3.1.0');
  api.use('cinn:react-form-helpers@1.0.0');

  api.addAssets([
    'public/fonts/font-icons.eot',
    'public/fonts/font-icons.ttf',
    'public/fonts/font-icons.woff',
    'public/fonts/font-icons.svg'
  ], 'client');

  api.addFiles('styles/_qr-base.scss', 'client', { isImport: true });
  api.addFiles('qr-ui-base.js', 'client');
});
<|endoftext|>


<commit_before>var chai = require('chai');
var expect = chai.expect;
var assert = chai.assert;

var ot = require('../');

var compose = ot.compose;
var transform = ot.transform;
var invert = ot.invert;
var apply = ot.apply;
var opt = ot.optypes;

var r = opt.retain;
var i = opt.insert;
var d = opt['delete'];
var upA = opt.upA;
var upS = opt.upS;
var down = opt.down;
var pushS = opt.pushS;
var pushA = opt.pushA;
var unpushS = opt.unpushS;
var unpushA = opt.unpushA;
var pop = opt.pop;
var unpop = opt.unpop;

var doc     = "doc";
var p       = "p";
var bold    = "bold";

var doca  = [doc,["title", "Tests"],[p,[],"Hello, World!"]];
var docb  = [doc,["title", "Tests"],[p,[],'Hello, ',[bold,[],'World!']]];
var docd  = [doc,["title", "Tests"],[p,[],"Hello"]];
var docdi = [doc,["title", "Tests"],[p,[],"Hello, Barney"]];

//insert text
var opa = [upA,r(2),upA,r(2),upS,r(7),i("Cruel "),r(6),down,down,down];
//bold text
var opb = [upA,r(2),upA,r(2),upS,r(7),
  pop,pushA,i([bold,[]]),pushS,r(6),pop,down,down,down];
//Note: the list inserted after bold is atomic.

//should not modify a or b under transform
var opc = [upA,r(1),upA,i(["href","qubic.io"]),down,r(1),down];

//Unpush test
var opu = [upA,r(2),unpushA,r(3),unpop,down];

//non overlapping unpush test
var opuu = [upA,r(1),unpushA,r(2),unpop,r(1),down];

//half overlapping unpush push
var opup = [upA,r(2),unpushA,r(1),pushA,r(2),down,down];

//delete insert
var opdi = [upA,r(2),upA,r(2),upS,r(7),d("World!"),i("Barney"),down,down,down];
//delete
var opd = [upA,r(2),upA,r(2),upS,r(5),d(", World!"),down,down,down];

//invert targets
var opbi = [upA,r(2),upA,r(2),upS,r(7),
  unpop,unpushA,d([bold,[]]),unpushS,r(6),unpop,down,down,down];

//[upA,r(2),upA,r(3),upA,r(2),upS,i("Cruel "),down,r(6),down,down,down]
//[upA,r(2),upA,r(3),upA,r(2),upS,i("Cruel "),r(6),down,down,down,down]

//target = compose(opa,opbp) = compose(opb,opap)
var opab = [upA,r(2),upA,r(2),upS,r(7),
  pop,pushA,i([bold,[]]),pushS,i("Cruel "),r(6),pop,down,down,down]

//[upA,r(2),upA,r(2),upS,r(7),                              pop,pushA,i([bold,[]]),pushS,i("Cruel ")                                      ,r(6),pop,down,down,down]
//[upA,r(2),upA,r(2),upS,r(1),upA,r(2),upS,i("Cruel "),r(4),pop,pushA,i([bold,[]]),down,down,down,down,pushS,r(6),pop,down,down,down]

//target transformed
var opbp = [upA,r(2),upA,r(2),upS,r(7),
  pop,pushA,i([bold,[]]),pushS,r(12),pop,down,down,down];
var opap = [upA,r(2),upA,r(3),
  upA,r(2),upS,i("Cruel "),r(6),down,down,down,down];

//target transformed by opu
//var opbpu = [upA,r(2),upA,r(2),upS,r(7),
//  pop,pushA,i([bold,[]]),pushS,r(12),pop,down,down,down];
var opapu  = [upA,r(4),upS,r(7),i("Cruel "),r(6),down,down];
var opapuu = [upA,r(3),upA,r(2),upS,r(7),i("Cruel "),r(6),down,down,down];
var opapup = [upA,r(3),upA,r(1),upS,r(7),i("Cruel "),r(6),down,down,down];

//console.log(apply(apply(doca,opa),opbp))
//console.log(apply(apply(doca,opb),opap))

describe('Compose', function() {
  it ('Can compose insert and bold', function() {
    var comp = compose(opa,opbp);
    assert.equal(JSON.stringify(opab),JSON.stringify(comp));
  });

  it ('Can compose bold and insert', function() {
    var comp = compose(opb,opap);
    assert.equal(JSON.stringify(opab),JSON.stringify(comp));
  });

  it ('Self invert composes to retain 1', function() {
    var comp = compose(opb,invert(opb));
    assert.equal(JSON.stringify([r(1)]),JSON.stringify(comp));
  });
});

describe('Invert', function() {
  it ('Invert bold', function() {
    var inv = invert(opb);
    assert.equal(JSON.stringify(opbi),JSON.stringify(inv));
  });
});

describe('Delete', function() {
  it ('Can delete characters', function() {
    var d = apply(doca, opd);
    assert.equal(JSON.stringify(d),JSON.stringify(docd));
  });

  it ('Can replace characters', function() {
    var d = apply(doca, opdi);
    assert.equal(JSON.stringify(d),JSON.stringify(docdi));
  });
});

describe('Transform', function() {
  it ('Can transform insert by bold', function() {
    var p = transform(opa,opb);
    assert.equal(JSON.stringify(p),JSON.stringify(opap));
  });

  it ('Can transform bold by insert', function() {
    var p = transform(opb,opa,"left");
    assert.equal(JSON.stringify(p),JSON.stringify(opbp));
  });

  it ('Can transform with unpush/pop', function() {
    var p = transform(opa,opu);
    assert.equal(JSON.stringify(p),JSON.stringify(opapu));
  });

  it ('Can transform with non overlapping unpush/pop', function() {
    var p = transform(opa,opuu);
    assert.equal(JSON.stringify(p),JSON.stringify(opapuu));
  });

  it ('Can transform with half overlapping unpush/pop', function() {
    var p = transform(opa,opup);
    assert.equal(JSON.stringify(p),JSON.stringify(opapup));
  });

  it ('Subtree inserts cause identity transform', function() {
    var ac = transform(opa,opc);
    var bc = transform(opb,opc);
    assert.equal(JSON.stringify(ac),JSON.stringify(opa));
    assert.equal(JSON.stringify(bc),JSON.stringify(opb));
  });
});<commit_msg>added delete transform tests<commit_after>var chai = require('chai');
var expect = chai.expect;
var assert = chai.assert;

var ot = require('../');

var compose = ot.compose;
var transform = ot.transform;
var invert = ot.invert;
var apply = ot.apply;
var opt = ot.optypes;

var r = opt.retain;
var i = opt.insert;
var d = opt['delete'];
var upA = opt.upA;
var upS = opt.upS;
var down = opt.down;
var pushS = opt.pushS;
var pushA = opt.pushA;
var unpushS = opt.unpushS;
var unpushA = opt.unpushA;
var pop = opt.pop;
var unpop = opt.unpop;

var doc     = "doc";
var p       = "p";
var bold    = "bold";

var doca  = [doc,["title", "Tests"],[p,[],"Hello, World!"]];
var docb  = [doc,["title", "Tests"],[p,[],'Hello, ',[bold,[],'World!']]];
var docd  = [doc,["title", "Tests"],[p,[],"Hello"]];
var docdi = [doc,["title", "Tests"],[p,[],"Hello, Barney"]];
var docadi = [doc,["title", "Tests"],[p,[],"Hello, Cruel Barney"]];

//insert text
var opa = [upA,r(2),upA,r(2),upS,r(7),i("Cruel "),r(6),down,down,down];
//bold text
var opb = [upA,r(2),upA,r(2),upS,r(7),
  pop,pushA,i([bold,[]]),pushS,r(6),pop,down,down,down];
//Note: the list inserted after bold is atomic.

//should not modify a or b under transform
var opc = [upA,r(1),upA,i(["href","qubic.io"]),down,r(1),down];

//Unpush test
var opu = [upA,r(2),unpushA,r(3),unpop,down];

//non overlapping unpush test
var opuu = [upA,r(1),unpushA,r(2),unpop,r(1),down];

//half overlapping unpush push
var opup = [upA,r(2),unpushA,r(1),pushA,r(2),down,down];

//delete insert
var opdi = [upA,r(2),upA,r(2),upS,r(7),d("World!"),i("Barney"),down,down,down];
//delete
var opd = [upA,r(2),upA,r(2),upS,r(5),d(", World!"),down,down,down];

//invert targets
var opbi = [upA,r(2),upA,r(2),upS,r(7),
  unpop,unpushA,d([bold,[]]),unpushS,r(6),unpop,down,down,down];

//[upA,r(2),upA,r(3),upA,r(2),upS,i("Cruel "),down,r(6),down,down,down]
//[upA,r(2),upA,r(3),upA,r(2),upS,i("Cruel "),r(6),down,down,down,down]

//target = compose(opa,opbp) = compose(opb,opap)
var opab = [upA,r(2),upA,r(2),upS,r(7),
  pop,pushA,i([bold,[]]),pushS,i("Cruel "),r(6),pop,down,down,down]

//[upA,r(2),upA,r(2),upS,r(7),                              pop,pushA,i([bold,[]]),pushS,i("Cruel ")                                      ,r(6),pop,down,down,down]
//[upA,r(2),upA,r(2),upS,r(1),upA,r(2),upS,i("Cruel "),r(4),pop,pushA,i([bold,[]]),down,down,down,down,pushS,r(6),pop,down,down,down]

//target transformed
var opbp = [upA,r(2),upA,r(2),upS,r(7),
  pop,pushA,i([bold,[]]),pushS,r(12),pop,down,down,down];
var opap = [upA,r(2),upA,r(3),
  upA,r(2),upS,i("Cruel "),r(6),down,down,down,down];

//target transformed by opu
//var opbpu = [upA,r(2),upA,r(2),upS,r(7),
//  pop,pushA,i([bold,[]]),pushS,r(12),pop,down,down,down];
var opapu  = [upA,r(4),upS,r(7),i("Cruel "),r(6),down,down];
var opapuu = [upA,r(3),upA,r(2),upS,r(7),i("Cruel "),r(6),down,down,down];
var opapup = [upA,r(3),upA,r(1),upS,r(7),i("Cruel "),r(6),down,down,down];

//console.log(apply(apply(doca,opa),opbp))
//console.log(apply(apply(doca,opb),opap))

describe('Compose', function() {
  it ('Can compose insert and bold', function() {
    var comp = compose(opa,opbp);
    assert.equal(JSON.stringify(opab),JSON.stringify(comp));
  });

  it ('Can compose bold and insert', function() {
    var comp = compose(opb,opap);
    assert.equal(JSON.stringify(opab),JSON.stringify(comp));
  });

  it ('Self invert composes to retain 1', function() {
    var comp = compose(opb,invert(opb));
    assert.equal(JSON.stringify([r(1)]),JSON.stringify(comp));
  });
});

describe('Invert', function() {
  it ('Invert bold', function() {
    var inv = invert(opb);
    assert.equal(JSON.stringify(opbi),JSON.stringify(inv));
  });
});

describe('Delete', function() {
  it ('Can delete characters', function() {
    var d = apply(doca, opd);
    assert.equal(JSON.stringify(d),JSON.stringify(docd));
  });

  it ('Can replace characters', function() {
    var d = apply(doca, opdi);
    assert.equal(JSON.stringify(d),JSON.stringify(docdi));
  });
});

describe('Transform', function() {
  it ('Can transform insert by bold', function() {
    var p = transform(opa,opb);
    assert.equal(JSON.stringify(p),JSON.stringify(opap));
  });

  it ('Can transform bold by insert', function() {
    var p = transform(opb,opa,"left");
    assert.equal(JSON.stringify(p),JSON.stringify(opbp));
  });

  it ('Can transform with unpush/pop', function() {
    var p = transform(opa,opu);
    assert.equal(JSON.stringify(p),JSON.stringify(opapu));
  });

  it ('Can transform with non overlapping unpush/pop', function() {
    var p = transform(opa,opuu);
    assert.equal(JSON.stringify(p),JSON.stringify(opapuu));
  });

  it ('Can transform with half overlapping unpush/pop', function() {
    var p = transform(opa,opup);
    assert.equal(JSON.stringify(p),JSON.stringify(opapup));
  });

  it ('Subtree inserts cause identity transform', function() {
    var ac = transform(opa,opc);
    var bc = transform(opb,opc);
    assert.equal(JSON.stringify(ac),JSON.stringify(opa));
    assert.equal(JSON.stringify(bc),JSON.stringify(opb));
  });

  it ('Can transform insert by delete', function() {
    var p = transform(opa,opdi);
    var d = apply(apply(doca,opa),p);
    assert.equal(JSON.stringify(docadi),JSON.stringify(d));
  });

  it ('Can transform delete by insert', function() {
    var p = transform(opdi,opa,'left');
    var d = apply(apply(doca,opdi),p);
    assert.equal(JSON.stringify(docadi),JSON.stringify(d));
  });
});<|endoftext|>


<commit_before>
//Wait for the document to load and for ugui.js to run before running your app's custom JS
$(document).ready( runApp );

//Container for your app's custom JS
function runApp() {

    ugui.helpers.loadSettings();
    //require('nw.gui').Window.get().showDevTools();

    var correctSlash = "/";
    if ( process.platform == "win32" ) {
        correctSlash = "\\";
    }

    function cleanURL () {
        var url = $("#url").val();
        url = url.replace("https://", "");
        url = url.replace("http://",  "");
        url = url.replace("www.",     "");
        url = url.split(".").join(" ");
        url = url.split("/").join(" ");
        url = url.split("?").join(" ");
        url = url.split("&").join(" ");
        url = url.split("|").join(" ");
        url = url.split("=").join(" ");
        url = url.split("*").join(" ");
        url = url.split("\\").join(" ");
        url = url.split('"').join(" ");
        url = url.split(":").join(" ");
        url = url.split("<").join(" ");
        url = url.split(">").join(" ");
        return url;
    }

    $("#url").change(function () {
        var url = cleanURL();
        $("#output").val(url);
    });
    $("#url").keyup(function () {
        var url = cleanURL();
        $("#output").val(url);
    });

    $("#run").click(function (event) {
        event.preventDefault();
        ugui.helpers.buildUGUIArgObject();

        var filetype = "html";
        var ext = ".html";
        if (ugui.args.outputcsv.htmlticked) {
            filetype = "csv";
            ext = ".csv";
        } else if (ugui.args.outputhtml.htmlticked) {
            filetype = "html";
            ext = ".html";
        } else if (ugui.args.outputjson.htmlticked) {
            filetype = "json";
            ext = ".json";
        } else if (ugui.args.outputmd.htmlticked) {
            filetype = "markdown";
            ext = ".md";
        }

        var standard = "WCAG2AA";
        if (ugui.args.standardsection.htmlticked) {
            standard = "Section508";
        } else if (ugui.args.standardwcaga.htmlticked) {
            standard = "WCAG2A";
        } else if (ugui.args.standardwcagaa.htmlticked) {
            standard = "WCAG2AA";
        } else if (ugui.args.standardwcagaaa.htmlticked) {
            standard = "WCAG2AAA";
        }

        var url = ugui.args.url.value;
        var folderPicker = ugui.args.folderPicker.value;
        var fileName = ugui.args.output.value;
        var exandargs = "pa11y -r " + filetype + " -s " + standard + " " + url;

        var pa11y = require('pa11y');
        var phantomjs = require('phantomjs');

        var test = pa11y({
            'phantomjs': {
                'path': "node_modules\\phantomjs"
            },
            'allowedStandards': [standard],
            ignore: [ 'notice' ]
        });

        test.run(url, function (error, results) {
            if (error) {
                if (error.path = "phantomjs") {
                    console.info("PhantomJS must be installed globally.");
                    console.info("Install Node, from nodejs.org");
                    console.info("Then run: npm install -g phantomjs");
                    console.error(error);
                    $.get("_markup/phantomjs-missing.htm", function (markup) {
                        $("body").prepend( markup );
                        ugui.helpers.openDefaultBrowser();
                    });
                } else {
                    console.info("Failed to return data from the page you entered.");
                    console.error(error.message);
                }
                return;
            }
            $("#results").empty();
            var warn = 0;
            var noti = 0;
            var erro = 0;
            for (var i = 0; i < results.length; i++) {
                var theType = results[i].type;
                var panelColor = "default";
                if (theType == "warning") {
                    panelColor = "warning";
                    warn = warn + 1;
                } else if (theType == "error") {
                    panelColor = "danger";
                    erro = erro + 1;
                } else if (theType == "notice") {
                    panelColor = "primary";
                    noti = noti + 1;
                }

                var theContext = results[i].context;
                theContext = theContext.split("<").join("<");

                var entry =
                  '
' +
                    '
' + results[i].code + '
' +
                    '
' +
                      '' + results[i].type + ': ' + results[i].message + '

' +
                      '
' + theContext + '

' +
                    '
' +
                    '

' + results[i].selector + '

' +
                  '
';
                if (theType == "error") {
                    $("#results").prepend(entry);
                } else {
                    $("#results").append(entry);
                }
            }
            $("#button-row .btn-danger span").text(erro);
            $("#button-row .btn-warning span").text(warn);
            $("#button-row .btn-primary span").text(noti);

            $.get('_markup/template.html', function (data) {
                var results = $("#results").html();
                var buttons = $("#button-badges").html();
                var output = data + url + '
' + buttons + '

' + results + "

";
                ugui.helpers.writeToFile(folderPicker + correctSlash + fileName + ext, output);
            });
        });
    });

/*
    var argsForm = [];
    argsForm.push( $("#pa11y *[data-argName]") );

    function unlockSubmit() {
        //If a required element wasn't filled out in this form
        if ( $("#pa11y").is(":invalid") ) {
            //Disable/Lock the submit button
            $("#pa11y .sendCmdArgs").prop("disabled", true);
            $("#pa11y .sendCmdArgs").addClass("").removeClass("btn-success");
        //If all required elements in a form have been fulfilled
        } else {
            //Enable/Unlock the submit button
            $("#pa11y .sendCmdArgs").prop("disabled", false);
            $("#pa11y .sendCmdArgs").addClass("btn-success").removeClass("btn-default");
        }
    }

    for (index = 0; index < argsForm.length; index++) {
        //When you click out of a form element
        $(argsForm[index]).keyup  ( unlockSubmit );
        $(argsForm[index]).mouseup( unlockSubmit );
        $(argsForm[index]).change ( unlockSubmit );
    }

    //On page load have this run once to unlock submit if nothing is required.
    unlockSubmit();
*/

}// end runApp();
<commit_msg>Better detect URL stuff<commit_after>
//Wait for the document to load and for ugui.js to run before running your app's custom JS
$(document).ready( runApp );

//Container for your app's custom JS
function runApp() {

    ugui.helpers.loadSettings();
    //require('nw.gui').Window.get().showDevTools();

    var correctSlash = "/";
    if ( process.platform == "win32" ) {
        correctSlash = "\\";
    }

    function cleanURL () {
        var url = $("#url").val();
        url = url.replace("https://", "");
        url = url.replace("http://",  "");
        url = url.replace("www.",     "");
        url = url.replace(".html",    "");
        url = url.replace(".htm",     "");
        url = url.replace(".php",     "");
        url = url.replace(".aspx",    "");
        url = url.replace(".asp",     "");
        url = url.replace(".cfm",     "");
        url = url.split(".").join(" ");
        url = url.split("/").join(" ");
        url = url.split("?").join(" ");
        url = url.split("&").join(" ");
        url = url.split("|").join(" ");
        url = url.split("=").join(" ");
        url = url.split("*").join(" ");
        url = url.split("\\").join(" ");
        url = url.split('"').join(" ");
        url = url.split(":").join(" ");
        url = url.split("<").join(" ");
        url = url.split(">").join(" ");
        return url;
    }

    $("#url").change(function () {
        var url = cleanURL();
        $("#output").val(url);
    });
    $("#url").keyup(function () {
        var url = cleanURL();
        $("#output").val(url);
    });

    $("#run").click(function (event) {
        event.preventDefault();
        ugui.helpers.buildUGUIArgObject();

        var filetype = "html";
        var ext = ".html";
        if (ugui.args.outputcsv.htmlticked) {
            filetype = "csv";
            ext = ".csv";
        } else if (ugui.args.outputhtml.htmlticked) {
            filetype = "html";
            ext = ".html";
        } else if (ugui.args.outputjson.htmlticked) {
            filetype = "json";
            ext = ".json";
        } else if (ugui.args.outputmd.htmlticked) {
            filetype = "markdown";
            ext = ".md";
        }

        var standard = "WCAG2AA";
        if (ugui.args.standardsection.htmlticked) {
            standard = "Section508";
        } else if (ugui.args.standardwcaga.htmlticked) {
            standard = "WCAG2A";
        } else if (ugui.args.standardwcagaa.htmlticked) {
            standard = "WCAG2AA";
        } else if (ugui.args.standardwcagaaa.htmlticked) {
            standard = "WCAG2AAA";
        }

        var url = ugui.args.url.value;
        var folderPicker = ugui.args.folderPicker.value;
        var fileName = ugui.args.output.value;
        var exandargs = "pa11y -r " + filetype + " -s " + standard + " " + url;

        var pa11y = require('pa11y');
        var phantomjs = require('phantomjs');

        var test = pa11y({
            'phantomjs': {
                'path': "node_modules\\phantomjs"
            },
            'allowedStandards': [standard],
            ignore: [ 'notice' ]
        });

        test.run(url, function (error, results) {
            if (error) {
                if (error.path = "phantomjs") {
                    console.info("PhantomJS must be installed globally.");
                    console.info("Install Node, from nodejs.org");
                    console.info("Then run: npm install -g phantomjs");
                    console.error(error);
                    $.get("_markup/phantomjs-missing.htm", function (markup) {
                        $("body").prepend( markup );
                        ugui.helpers.openDefaultBrowser();
                    });
                } else {
                    console.info("Failed to return data from the page you entered.");
                    console.error(error.message);
                }
                return;
            }
            $("#results").empty();
            var warn = 0;
            var noti = 0;
            var erro = 0;
            for (var i = 0; i < results.length; i++) {
                var theType = results[i].type;
                var panelColor = "default";
                if (theType == "warning") {
                    panelColor = "warning";
                    warn = warn + 1;
                } else if (theType == "error") {
                    panelColor = "danger";
                    erro = erro + 1;
                } else if (theType == "notice") {
                    panelColor = "primary";
                    noti = noti + 1;
                }

                var theContext = results[i].context;
                theContext = theContext.split("<").join("<");

                var entry =
                  '
' +
                    '
' + results[i].code + '
' +
                    '
' +
                      '' + results[i].type + ': ' + results[i].message + '

' +
                      '
' + theContext + '

' +
                    '
' +
                    '

' + results[i].selector + '

' +
                  '
';
                if (theType == "error") {
                    $("#results").prepend(entry);
                } else {
                    $("#results").append(entry);
                }
            }
            $("#button-row .btn-danger span").text(erro);
            $("#button-row .btn-warning span").text(warn);
            $("#button-row .btn-primary span").text(noti);

            $.get('_markup/template.html', function (data) {
                var results = $("#results").html();
                var buttons = $("#button-badges").html();
                var output = data + url + '
' + buttons + '

' + results + "

";
                ugui.helpers.writeToFile(folderPicker + correctSlash + fileName + ext, output);
            });
        });
    });

/*
    var argsForm = [];
    argsForm.push( $("#pa11y *[data-argName]") );

    function unlockSubmit() {
        //If a required element wasn't filled out in this form
        if ( $("#pa11y").is(":invalid") ) {
            //Disable/Lock the submit button
            $("#pa11y .sendCmdArgs").prop("disabled", true);
            $("#pa11y .sendCmdArgs").addClass("").removeClass("btn-success");
        //If all required elements in a form have been fulfilled
        } else {
            //Enable/Unlock the submit button
            $("#pa11y .sendCmdArgs").prop("disabled", false);
            $("#pa11y .sendCmdArgs").addClass("btn-success").removeClass("btn-default");
        }
    }

    for (index = 0; index < argsForm.length; index++) {
        //When you click out of a form element
        $(argsForm[index]).keyup  ( unlockSubmit );
        $(argsForm[index]).mouseup( unlockSubmit );
        $(argsForm[index]).change ( unlockSubmit );
    }

    //On page load have this run once to unlock submit if nothing is required.
    unlockSubmit();
*/

}// end runApp();
<|endoftext|>


<commit_before>Package.describe({
  name: 'rcdelfin:accounts-mautic',
  summary: "Accounts service for Mautic accounts",
  version: "0.0.1",
  git: "https://github.com/PoBuchi/meteor-accounts-mautic.git"
});

Package.onUse(function(api) {
  api.use('accounts-base', ['client', 'server']);
  api.imply('accounts-base', ['client', 'server']);

  api.use('accounts-oauth', ['client', 'server']);
  api.use('rcdelfin:mautic', ['client', 'server']);

  api.addFiles(['mautic_login_button.css'], 'client');
  api.addFiles('mautic_common.js', ['client', 'server']);
  api.addFiles('mautic_server.js', 'server');
  api.addFiles('mautic_client.js', 'client');
});

Package.onTest(function(api) {
  api.versionsFrom('1.2.1');
  api.use('tinytest');
  api.use('autopublish');
  api.use('http', ['server']);
  api.use('ryepdx:linkedin-fake@0.0.4');
  api.use('rcdelfin:accounts-mautic');

  api.addFiles('mautic_client_tests.js', 'client');
  api.addFiles('mautic_server_tests.js', 'server');
});
<commit_msg>Bump version<commit_after>Package.describe({
  name: 'rcdelfin:accounts-mautic',
  summary: "Accounts service for Mautic accounts",
  version: "0.0.1",
  git: "https://github.com/PoBuchi/meteor-accounts-mautic.git"
});

Package.onUse(function(api) {
  api.versionsFrom('1.2.1');
  api.use('accounts-base', ['client', 'server']);
  api.imply('accounts-base', ['client', 'server']);

  api.use('accounts-oauth', ['client', 'server']);
  api.use('rcdelfin:mautic', ['client', 'server']);

  api.addFiles(['mautic_login_button.css'], 'client');
  api.addFiles('mautic_common.js', ['client', 'server']);
  api.addFiles('mautic_server.js', 'server');
  api.addFiles('mautic_client.js', 'client');
});

Package.onTest(function(api) {
  api.versionsFrom('1.2.1');
  api.use('tinytest');
  api.use('autopublish');
  api.use('http', ['server']);
  api.use('ryepdx:linkedin-fake@0.0.4');
  api.use('rcdelfin:accounts-mautic');

  api.addFiles('mautic_client_tests.js', 'client');
  api.addFiles('mautic_server_tests.js', 'server');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: "jQuery pageslide repackaged for Meteor"
});

Package.on_use(function (api) {
  api.use('jquery', 'client');
  api.add_files('lib/jquery-pageslide/jquery.pageslide.js','client');
});
<commit_msg>package.js fix<commit_after>try {
  Package.describe({
    summary: "jQuery pageslide repackaged for Meteor"
  });

  Package.on_use(function (api) {
    api.use('jquery', 'client');
    api.add_files('lib/jquery-pageslide/jquery.pageslide.js','client');
  });
}
catch (err) {
  console.log("Error while trying to load a package: " + err.message);
};
<|endoftext|>


<commit_before>var HelloWorldLayer = cc.Layer.extend({
    ctor:function () {
        this._super();

        var winSize = cc.director.getWinSize();
        var toast = new csToast();
        toast.set({text:"textteasdsadasdadadsxt", backgroundImage:"res/blue_button00.png"
        });
        toast.run(this);

        return true;
    }
});

var HelloWorldScene = cc.Scene.extend({
    onEnter:function () {
        this._super();
        var layer = new HelloWorldLayer();
        this.addChild(layer);
    }
});

<commit_msg>Delete test.js<commit_after><|endoftext|>


<commit_before>"use strict";

const fs = require("fs");
const net = require("net");
const colors = require("chalk");
const Helper = require("./helper");

class Identification {
	constructor(startedCallback) {
		this.connectionId = 0;
		this.connections = new Map();

		if (typeof Helper.config.oidentd === "string") {
			this.oidentdFile = Helper.expandHome(Helper.config.oidentd);
			log.info(`Oidentd file: ${colors.green(this.oidentdFile)}`);

			this.refresh();
		}

		if (Helper.config.identd.enable) {
			if (this.oidentdFile) {
				log.warn("Using both identd and oidentd at the same time, this is most likely not intended.");
			}

			const server = net.createServer(this.serverConnection.bind(this));
			server.listen({
				port: Helper.config.identd.port || 113,
				host: Helper.config.bind || Helper.config.host,
			}, () => {
				const address = server.address();
				log.info(`Identd server available on ${colors.green(address.address + ":" + address.port)}`);

				startedCallback(this);
			});
		} else {
			startedCallback(this);
		}
	}

	serverConnection(socket) {
		socket.on("data", (data) => {
			this.respondToIdent(socket, data);
			socket.end();
		});
	}

	respondToIdent(socket, data) {
		data = data.toString().split(",");

		const lport = parseInt(data[0]);
		const fport = parseInt(data[1]);

		if (lport < 1 || fport < 1 || lport > 65535 || fport > 65535) {
			return;
		}

		for (const connection of this.connections.values()) {
			if (connection.socket.remoteAddress === socket.remoteAddress
			&& connection.socket.remotePort === fport
			&& connection.socket.localPort === lport
			&& connection.socket.localAddress === socket.localAddress) {
				return socket.write(`${lport}, ${fport} : USERID : UNIX : ${connection.user}\r\n`);
			}
		}

		socket.write(`${lport}, ${fport} : ERROR : NO-USER\r\n`);
	}

	addSocket(socket, user) {
		const id = ++this.connectionId;

		this.connections.set(id, {socket, user});

		if (this.oidentdFile) {
			this.refresh();
		}

		return id;
	}

	removeSocket(id) {
		this.connections.delete(id);

		if (this.oidentdFile) {
			this.refresh();
		}
	}

	refresh() {
		let file = "# Warning: file generated by The Lounge: changes will be overwritten!\n";

		this.connections.forEach((connection) => {
			file += `to ${connection.socket.remoteAddress}`
				+ ` fport ${connection.socket.remotePort}`
				+ ` from ${connection.socket.localAddress}`
				+ ` lport ${connection.socket.localPort}`
				+ ` { reply "${connection.user}" }\n`;
		});

		fs.writeFile(this.oidentdFile, file, {flag: "w+"}, function(err) {
			if (err) {
				log.error("Failed to update oidentd file!", err);
			}
		});
	}
}

module.exports = Identification;
<commit_msg>Specify parseInt base<commit_after>"use strict";

const fs = require("fs");
const net = require("net");
const colors = require("chalk");
const Helper = require("./helper");

class Identification {
	constructor(startedCallback) {
		this.connectionId = 0;
		this.connections = new Map();

		if (typeof Helper.config.oidentd === "string") {
			this.oidentdFile = Helper.expandHome(Helper.config.oidentd);
			log.info(`Oidentd file: ${colors.green(this.oidentdFile)}`);

			this.refresh();
		}

		if (Helper.config.identd.enable) {
			if (this.oidentdFile) {
				log.warn("Using both identd and oidentd at the same time, this is most likely not intended.");
			}

			const server = net.createServer(this.serverConnection.bind(this));
			server.listen({
				port: Helper.config.identd.port || 113,
				host: Helper.config.bind || Helper.config.host,
			}, () => {
				const address = server.address();
				log.info(`Identd server available on ${colors.green(address.address + ":" + address.port)}`);

				startedCallback(this);
			});
		} else {
			startedCallback(this);
		}
	}

	serverConnection(socket) {
		socket.on("data", (data) => {
			this.respondToIdent(socket, data);
			socket.end();
		});
	}

	respondToIdent(socket, data) {
		data = data.toString().split(",");

		const lport = parseInt(data[0], 10) || 0;
		const fport = parseInt(data[1], 10) || 0;

		if (lport < 1 || fport < 1 || lport > 65535 || fport > 65535) {
			return;
		}

		for (const connection of this.connections.values()) {
			if (connection.socket.remoteAddress === socket.remoteAddress
			&& connection.socket.remotePort === fport
			&& connection.socket.localPort === lport
			&& connection.socket.localAddress === socket.localAddress) {
				return socket.write(`${lport}, ${fport} : USERID : UNIX : ${connection.user}\r\n`);
			}
		}

		socket.write(`${lport}, ${fport} : ERROR : NO-USER\r\n`);
	}

	addSocket(socket, user) {
		const id = ++this.connectionId;

		this.connections.set(id, {socket, user});

		if (this.oidentdFile) {
			this.refresh();
		}

		return id;
	}

	removeSocket(id) {
		this.connections.delete(id);

		if (this.oidentdFile) {
			this.refresh();
		}
	}

	refresh() {
		let file = "# Warning: file generated by The Lounge: changes will be overwritten!\n";

		this.connections.forEach((connection) => {
			file += `to ${connection.socket.remoteAddress}`
				+ ` fport ${connection.socket.remotePort}`
				+ ` from ${connection.socket.localAddress}`
				+ ` lport ${connection.socket.localPort}`
				+ ` { reply "${connection.user}" }\n`;
		});

		fs.writeFile(this.oidentdFile, file, {flag: "w+"}, function(err) {
			if (err) {
				log.error("Failed to update oidentd file!", err);
			}
		});
	}
}

module.exports = Identification;
<|endoftext|>


<commit_before>Package.describe({
  name: 'ostrio:files',
  version: '1.7.7',
  summary: 'Upload files via DDP, HTTP and WebRTC/DC. To server FS, AWS, GridFS, DropBox or Google Drive.',
  git: 'https://github.com/VeliovGroup/Meteor-Files',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.4');
  api.use('webapp', 'server');
  api.use(['reactive-var', 'tracker', 'http'], 'client');
  api.use(['mongo','underscore', 'check', 'random', 'coffeescript', 'ecmascript', 'ostrio:cookies@2.0.5'], ['client', 'server']);
  api.addFiles('event-emitter.jsx', 'client');
  api.addAssets('worker.min.js', 'client');
  api.mainModule('files.coffee', ['server', 'client']);
  api.export('FilesCollection');
});

Npm.depends({
  'fs-extra': '2.0.0',
  'request': '2.79.0',
  'throttle': '1.0.3',
  'file-type': '4.1.0'
});
<commit_msg>Update Cookies package dependency<commit_after>Package.describe({
  name: 'ostrio:files',
  version: '1.7.7',
  summary: 'Upload files via DDP, HTTP and WebRTC/DC. To server FS, AWS, GridFS, DropBox or Google Drive.',
  git: 'https://github.com/VeliovGroup/Meteor-Files',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.4');
  api.use('webapp', 'server');
  api.use(['reactive-var', 'tracker', 'http'], 'client');
  api.use(['mongo','underscore', 'check', 'random', 'coffeescript', 'ecmascript', 'ostrio:cookies@2.1.1'], ['client', 'server']);
  api.addFiles('event-emitter.jsx', 'client');
  api.addAssets('worker.min.js', 'client');
  api.mainModule('files.coffee', ['server', 'client']);
  api.export('FilesCollection');
});

Npm.depends({
  'fs-extra': '2.0.0',
  'request': '2.79.0',
  'throttle': '1.0.3',
  'file-type': '4.1.0'
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'danimal:cue',
  version: '1.0.0',
  // Brief, one-line summary of the package.
  summary: 'Queue for Meteor',
  // URL to the Git repository containing the source code for this package.
  git: '',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0.3.1');
  api.use('mongo');
  api.use('fongandrew:find-and-modify@0.1.2')
  api.addFiles('cue.js');
  api.export('Cue', 'server')
  api.export('CueJob', 'server')
});
<commit_msg>add git url<commit_after>Package.describe({
  name: 'danimal:cue',
  version: '1.0.0',
  // Brief, one-line summary of the package.
  summary: 'Queue for Meteor',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/dan335/cue',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0.3.1');
  api.use('mongo');
  api.use('fongandrew:find-and-modify@0.1.2')
  api.addFiles('cue.js');
  api.export('Cue', 'server')
  api.export('CueJob', 'server')
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Accounts Templates styled for Twitter Bootstrap.',
  version: '1.8.1',
  name: 'useraccounts:bootstrap',
  git: 'https://github.com/meteor-useraccounts/bootstrap.git',
});

Package.on_use(function(api, where) {
  api.versionsFrom('METEOR@1.0');

  api.use([
    'less',
    'templating',
  ], 'client');

  api.use([
    'useraccounts:core',
  ], ['client', 'server']);

  api.imply([
    'useraccounts:core@1.8.1',
  ], ['client', 'server']);

  api.add_files([
    'lib/at_error.html',
    'lib/at_error.js',
    'lib/at_form.html',
    'lib/at_form.js',
    'lib/at_input.html',
    'lib/at_input.js',
    'lib/at_nav_button.html',
    'lib/at_nav_button.js',
    'lib/at_oauth.html',
    'lib/at_oauth.js',
    'lib/at_pwd_form.html',
    'lib/at_pwd_form.js',
    'lib/at_pwd_form_btn.html',
    'lib/at_pwd_form_btn.js',
    'lib/at_pwd_link.html',
    'lib/at_pwd_link.js',
    'lib/at_reCaptcha.html',
    'lib/at_reCaptcha.js',
    'lib/at_result.html',
    'lib/at_result.js',
    'lib/at_sep.html',
    'lib/at_sep.js',
    'lib/at_signin_link.html',
    'lib/at_signin_link.js',
    'lib/at_signup_link.html',
    'lib/at_signup_link.js',
    'lib/at_social.html',
    'lib/at_social.js',
    'lib/at_terms_link.html',
    'lib/at_terms_link.js',
    'lib/at_resend_verification_email_link.html',
    'lib/at_resend_verification_email_link.js',
    'lib/at_title.html',
    'lib/at_title.js',
    'lib/full_page_at_form.html',
    'lib/at_bootstrap.less'
  ], ['client']);
});

Package.on_test(function(api) {
  api.use([
    'useraccounts:bootstrap',
    'useraccounts:core@1.8.1',
  ]);

  api.use([
    'accounts-password',
    'tinytest',
    'test-helpers'
  ], ['client', 'server']);

  api.add_files([
    'tests/tests.js'
  ], ['client', 'server']);
});
<commit_msg>minor release - Bump to version 1.9.0<commit_after>Package.describe({
  summary: 'Accounts Templates styled for Twitter Bootstrap.',
  version: '1.9.0',
  name: 'useraccounts:bootstrap',
  git: 'https://github.com/meteor-useraccounts/bootstrap.git',
});

Package.on_use(function(api, where) {
  api.versionsFrom('METEOR@1.0');

  api.use([
    'less',
    'templating',
  ], 'client');

  api.use([
    'useraccounts:core',
  ], ['client', 'server']);

  api.imply([
    'useraccounts:core@1.9.0',
  ], ['client', 'server']);

  api.add_files([
    'lib/at_error.html',
    'lib/at_error.js',
    'lib/at_form.html',
    'lib/at_form.js',
    'lib/at_input.html',
    'lib/at_input.js',
    'lib/at_nav_button.html',
    'lib/at_nav_button.js',
    'lib/at_oauth.html',
    'lib/at_oauth.js',
    'lib/at_pwd_form.html',
    'lib/at_pwd_form.js',
    'lib/at_pwd_form_btn.html',
    'lib/at_pwd_form_btn.js',
    'lib/at_pwd_link.html',
    'lib/at_pwd_link.js',
    'lib/at_reCaptcha.html',
    'lib/at_reCaptcha.js',
    'lib/at_result.html',
    'lib/at_result.js',
    'lib/at_sep.html',
    'lib/at_sep.js',
    'lib/at_signin_link.html',
    'lib/at_signin_link.js',
    'lib/at_signup_link.html',
    'lib/at_signup_link.js',
    'lib/at_social.html',
    'lib/at_social.js',
    'lib/at_terms_link.html',
    'lib/at_terms_link.js',
    'lib/at_resend_verification_email_link.html',
    'lib/at_resend_verification_email_link.js',
    'lib/at_title.html',
    'lib/at_title.js',
    'lib/full_page_at_form.html',
    'lib/at_bootstrap.less'
  ], ['client']);
});

Package.on_test(function(api) {
  api.use([
    'useraccounts:bootstrap',
    'useraccounts:core@1.9.0',
  ]);

  api.use([
    'accounts-password',
    'tinytest',
    'test-helpers'
  ], ['client', 'server']);

  api.add_files([
    'tests/tests.js'
  ], ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  name: "jaywon:meteor-node-uuid",
  summary: "Generate RFC compliant UUIDs using node-uuid.",
  version: "1.0.0",
  git: "https://github.com/jaywon/meteor-node-uuid"
});

Package.onUse(function(api) {
  api.versionsFrom('0.9.0');

  var path = Npm.require('path');
  var asset_path = path.join('node-uuid');

  api.addFiles(path.join(asset_path, 'uuid.js'), 'client');
  api.addFiles(path.join(asset_path, 'uuid.js'), 'server');
});
<commit_msg>Update package version for meteor publish versioning requirements.<commit_after>Package.describe({
  name: "jaywon:meteor-node-uuid",
  summary: "Generate RFC compliant UUIDs using node-uuid.",
  version: "1.0.1",
  git: "https://github.com/jaywon/meteor-node-uuid"
});

Package.onUse(function(api) {
  api.versionsFrom('0.9.0');

  var path = Npm.require('path');
  var asset_path = path.join('node-uuid');

  api.addFiles(path.join(asset_path, 'uuid.js'), 'client');
  api.addFiles(path.join(asset_path, 'uuid.js'), 'server');
});
<|endoftext|>


<commit_before>Package.describe({
  name: "iron-path",
  summary: "Compile paths into regular expressions.",
  version: "0.1.0",
  githubUrl: "https://github.com/eventedmind/iron-path"
});

Package.on_use(function (api) {
  api.add_files('lib/compile.js');
  api.add_files('lib/path.js');
  api.export('Iron');
});

Package.on_test(function (api) {
  api.use('iron-path');
  api.use('tinytest');
  api.use('test-helpers');
  api.add_files('test/path_test.js', ['client', 'server']);
});
<commit_msg>Misspelled filename.<commit_after>Package.describe({
  name: "iron-path",
  summary: "Compile paths into regular expressions.",
  version: "0.1.0",
  githubUrl: "https://github.com/eventedmind/iron-path"
});

Package.on_use(function (api) {
  api.add_files('lib/compiler.js');
  api.add_files('lib/path.js');
  api.export('Iron');
});

Package.on_test(function (api) {
  api.use('iron-path');
  api.use('tinytest');
  api.use('test-helpers');
  api.add_files('test/path_test.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Accounts Templates styled for Semantic UI.",
    version: "1.3.2",
    name: "useraccounts:semantic-ui",
    git: "https://github.com/meteor-useraccounts/semantic-ui.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@1.0");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "useraccounts:core",
    ], ["client", "server"]);

    api.imply([
        "useraccounts:core@1.3.2",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_nav_button.html",
        "lib/at_nav_button.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_semantic-ui.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "useraccounts:semantic-ui",
        "useraccounts:core@1.3.2",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});
<commit_msg>minor release - Bump to version 1.4.0<commit_after>Package.describe({
    summary: "Accounts Templates styled for Semantic UI.",
    version: "1.4.0",
    name: "useraccounts:semantic-ui",
    git: "https://github.com/meteor-useraccounts/semantic-ui.git",
});

Package.on_use(function(api, where) {
    api.versionsFrom("METEOR@1.0");

    api.use([
        "less",
        "templating",
    ], "client");

    api.use([
        "useraccounts:core",
    ], ["client", "server"]);

    api.imply([
        "useraccounts:core@1.4.0",
    ], ["client", "server"]);

    api.add_files([
        "lib/at_error.html",
        "lib/at_error.js",
        "lib/at_form.html",
        "lib/at_form.js",
        "lib/at_input.html",
        "lib/at_input.js",
        "lib/at_nav_button.html",
        "lib/at_nav_button.js",
        "lib/at_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_semantic-ui.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "useraccounts:semantic-ui",
        "useraccounts:core@1.4.0",
    ]);

    api.use([
        "accounts-password",
        "tinytest",
        "test-helpers"
    ], ["client", "server"]);

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});
<|endoftext|>


<commit_before>Package.describe({
    name: "gfk:server-cookies",
    summary: "Server-side access to http request cookies.",
    version: "1.0.0"
});

Package.onUse(function(api) {
    api.versionsFrom('1.0');

    api.use(['webapp', 'underscore'], 'server');
    api.use([
        'tracker',
        'reactive-var',
        'jquery',
        'check'
    ], 'client');

    api.addFiles([
        'server/server-cookies.js',
        'server/methods.js'
    ], 'server');

    api.addFiles(['client/server-cookies.js'], 'client');

    api.export('ServerCookies', ['server', 'client']);

    api.export([
        'cookieTokenRequestHandler',
        'cookieTokens',
        'serverCookieMethods'
        ], 'server', { testOnly: true });

    api.export([
        'trackConnectionStatus',
        'setCookieTokenCookies'
    ], 'client', { testOnly: true });

});

Package.onTest(function (api) {
  api.use([
    'gfk:server-cookies',
    'mike:mocha-package@0.5.8',
    'practicalmeteor:sinon',
    'practicalmeteor:chai'
  ]);

  api.add_files([
      'test/server/server-cookies.test.js',
      'test/server/methods.test.js'
  ], ['server']);

  api.add_files('test/client/server-cookies.test.js', ['client']);
});
<commit_msg>Version bump to 1.0.1<commit_after>Package.describe({
    name: "gfk:server-cookies",
    summary: "Server-side access to http request cookies.",
    version: "1.0.1"
});

Package.onUse(function(api) {
    api.versionsFrom('1.0');

    api.use(['webapp', 'underscore'], 'server');
    api.use([
        'tracker',
        'reactive-var',
        'jquery',
        'check'
    ], 'client');

    api.addFiles([
        'server/server-cookies.js',
        'server/methods.js'
    ], 'server');

    api.addFiles(['client/server-cookies.js'], 'client');

    api.export('ServerCookies', ['server', 'client']);

    api.export([
        'cookieTokenRequestHandler',
        'cookieTokens',
        'serverCookieMethods'
        ], 'server', { testOnly: true });

    api.export([
        'trackConnectionStatus',
        'setCookieTokenCookies'
    ], 'client', { testOnly: true });

});

Package.onTest(function (api) {
  api.use([
    'gfk:server-cookies',
    'mike:mocha-package@0.5.8',
    'practicalmeteor:sinon',
    'practicalmeteor:chai'
  ]);

  api.add_files([
      'test/server/server-cookies.test.js',
      'test/server/methods.test.js'
  ], ['server']);

  api.add_files('test/client/server-cookies.test.js', ['client']);
});
<|endoftext|>


<commit_before>Package.describe({
	name: "hansoft:typescript",
	summary: "TypeScript is a staticaly typed superset of JavaScript",
	version: "1.0.0"
});

Package.registerBuildPlugin({
	name: "compileTypescript",
	use: ["meteor"],
	sources: [
		"plugin/compile-typescript.js"
	],
	npmDependencies: {
		"typescript": "1.5.0-beta",
	}
});
<commit_msg>Added git repository link in package description.<commit_after>Package.describe({
	name: "hansoft:typescript",
	summary: "TypeScript is a staticaly typed superset of JavaScript",
	git: "https://github.com/Hansoft/meteor-typescript",
	version: "1.0.0"
});

Package.registerBuildPlugin({
	name: "compileTypescript",
	use: ["meteor"],
	sources: [
		"plugin/compile-typescript.js"
	],
	npmDependencies: {
		"typescript": "1.5.0-beta",
	}
});
<|endoftext|>


<commit_before>Package.describe({
    name: "froatsnook:shopify",
    version: "1.4.3",
    summary: "Shopify API Access",
    git: "https://github.com/froatsnook/meteor-shopify",
    documentation: "README.md"
});

Package.onUse(function(api) {
    api.versionsFrom("1.0.3.1");
    api.use("check", ["client", "server"]);
    api.use("http", ["client", "server"]);
    api.use("underscore", ["client", "server"]);
    api.use("webapp", "server");
    api.use("froatsnook:sleep@1.1.0", ["client", "server"]);
    api.addFiles("lib/01-shopify.js", ["client", "server"]);
    api.addFiles("lib/02-APIMethods.js", ["client", "server"]);
    api.addFiles("lib/api.js", ["client", "server"]);
    api.addFiles("lib/Authenticators.js", ["client", "server"]);
    api.addFiles("lib/AuthRedirect.js", "server");
    api.addFiles("lib/DefaultScopes.js", ["client", "server"]);
    api.addFiles("lib/Keyset.js", ["server"]);
    api.addFiles("lib/ProxyAPICache.js", ["server"]);
    api.export("Shopify", ["client", "server"]);
});

Package.onTest(function(api) {
    Npm.depends({ "express": "4.12.2" });

    api.use("tinytest");
    api.use("webapp", "server");
    api.use("check");
    api.use("tracker");
    api.use("froatsnook:sleep@1.1.0");
    api.use("froatsnook:shopify");
    api.addFiles("test/shopify-api-simulator.js", ["server"]);
    api.addFiles("test/shopify-tests.js");
});

<commit_msg>Bump version to 1.4.4.<commit_after>Package.describe({
    name: "froatsnook:shopify",
    version: "1.4.4",
    summary: "Shopify API Access",
    git: "https://github.com/froatsnook/meteor-shopify",
    documentation: "README.md"
});

Package.onUse(function(api) {
    api.versionsFrom("1.0.3.1");
    api.use("check", ["client", "server"]);
    api.use("http", ["client", "server"]);
    api.use("underscore", ["client", "server"]);
    api.use("webapp", "server");
    api.use("froatsnook:sleep@1.1.0", ["client", "server"]);
    api.addFiles("lib/01-shopify.js", ["client", "server"]);
    api.addFiles("lib/02-APIMethods.js", ["client", "server"]);
    api.addFiles("lib/api.js", ["client", "server"]);
    api.addFiles("lib/Authenticators.js", ["client", "server"]);
    api.addFiles("lib/AuthRedirect.js", "server");
    api.addFiles("lib/DefaultScopes.js", ["client", "server"]);
    api.addFiles("lib/Keyset.js", ["server"]);
    api.addFiles("lib/ProxyAPICache.js", ["server"]);
    api.export("Shopify", ["client", "server"]);
});

Package.onTest(function(api) {
    Npm.depends({ "express": "4.12.2" });

    api.use("tinytest");
    api.use("webapp", "server");
    api.use("check");
    api.use("tracker");
    api.use("froatsnook:sleep@1.1.0");
    api.use("froatsnook:shopify");
    api.addFiles("test/shopify-api-simulator.js", ["server"]);
    api.addFiles("test/shopify-tests.js");
});

<|endoftext|>


<commit_before>/* global Package */
Package.describe({
  name: 'hadynz:trademe',
  summary: 'TradeMe OAuth flow',
  version: '1.0.0',
  git: 'https://github.com/hadynz/meteor-trademe.git'
});

Package.onUse(function (api) {
  'use strict';

  api.use('http', ['client', 'server']);
  api.use('templating', 'client');
  api.use('oauth1', ['client', 'server']);
  api.use('oauth', ['client', 'server']);
  api.use('random', 'client');
  api.use('underscore', 'server');
  api.use('service-configuration', ['client', 'server']);

  api.export('TradeMe');

  api.addFiles(['src/trademe_configure.html', 'src/trademe_configure.js'], 'client');

  api.addFiles('src/trademe_server.js', 'server');
  api.addFiles('src/trademe_client.js', 'client');
});
<commit_msg>Specify Meteor `versionsFrom`<commit_after>/* global Package */
Package.describe({
  name: 'hadynz:trademe',
  summary: 'TradeMe OAuth flow',
  version: '1.0.0',
  git: 'https://github.com/hadynz/meteor-trademe.git'
});

Package.onUse(function (api) {
  'use strict';

  api.versionsFrom('0.9.0');
  api.use('http', ['client', 'server']);
  api.use('templating', 'client');
  api.use('oauth1', ['client', 'server']);
  api.use('oauth', ['client', 'server']);
  api.use('random', 'client');
  api.use('underscore', 'server');
  api.use('service-configuration', ['client', 'server']);

  api.export('TradeMe');

  api.addFiles(['src/trademe_configure.html', 'src/trademe_configure.js'], 'client');

  api.addFiles('src/trademe_server.js', 'server');
  api.addFiles('src/trademe_client.js', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  git: 'https://github.com/zimme/meteor-collection-softremovable.git',
  name: 'zimme:collection-softremovable',
  summary: 'Add soft remove to collections',
  version: '1.0.3-rc.1'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use([
    'coffeescript',
    'underscore'
  ]);

  api.use([
    'matb33:collection-hooks@0.7.6',
    'zimme:collection-behaviours@1.0.2'
  ]);

  api.use([
    'aldeed:autoform@4.0.0',
    'aldeed:collection2@2.0.0',
    'aldeed:simple-schema@1.0.3'
  ], ['client', 'server'], {weak: true});

  api.imply('zimme:collection-behaviours');

  api.addFiles('softremovable.coffee');
});
<commit_msg>Version bump<commit_after>Package.describe({
  git: 'https://github.com/zimme/meteor-collection-softremovable.git',
  name: 'zimme:collection-softremovable',
  summary: 'Add soft remove to collections',
  version: '1.0.3'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');

  api.use([
    'coffeescript',
    'underscore'
  ]);

  api.use([
    'matb33:collection-hooks@0.7.6',
    'zimme:collection-behaviours@1.0.2'
  ]);

  api.use([
    'aldeed:autoform@4.0.0',
    'aldeed:collection2@2.0.0',
    'aldeed:simple-schema@1.0.3'
  ], ['client', 'server'], {weak: true});

  api.imply('zimme:collection-behaviours');

  api.addFiles('softremovable.coffee');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'astrocoders:publish',
  version: '0.0.3',
  summary: 'Smart re-use your publications.',
  git: 'https://github.com/Astrocoders/meteor-astrocoders-publish',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.2.0.2');
  api.use([
    'ecmascript',
    'meteor-platform',
    'mongo'
  ]);

  api.addFiles([
    'publish.js',
  ]);

  api.addFiles([
    'mongo_rules.js',
    'methods.js',
    'query.js'
  ], 'server');

  api.export('AstroPublish', 'server');
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');
  api.use('astrocoders:publish');
  api.addFiles('publish-tests.js');
});
<commit_msg>Bump version<commit_after>Package.describe({
  name: 'astrocoders:publish',
  version: '0.0.4',
  summary: 'Smart re-use your publications.',
  git: 'https://github.com/Astrocoders/meteor-astrocoders-publish',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.2.0.2');
  api.use([
    'ecmascript',
    'meteor-platform',
    'mongo'
  ]);

  api.addFiles([
    'publish.js',
  ]);

  api.addFiles([
    'mongo_rules.js',
    'methods.js',
    'query.js'
  ], 'server');

  api.export('AstroPublish', 'server');
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');
  api.use('astrocoders:publish');
  api.addFiles('publish-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Reaction Rental Products - Enable rental and for-hire products',
  name: 'getoutfitted:reaction-rental-products',
  version: '0.0.1',
  git: 'https://github.com/getoutfitted/reaction-rental-products.git'
});

Package.onUse(function (api, where) {
  api.versionsFrom('METEOR@1.0');
  api.use('templating');
  api.use('coffeescript');
  api.use('less');
  api.use('underscore');
  api.use('dburles:factory@0.3.10');
  api.use('matb33:collection-hooks');
  api.use('meteor-platform@1.2.1');
  api.use('reactioncommerce:core@0.6.0', ['client', 'server']);

  api.imply('dburles:factory');
  api.imply('matb33:collection-hooks');

  api.addFiles([
    'server/register.coffee'
  ] ,['server']); // register as a reaction package

  api.addFiles([
    'server/factories.coffee',
    'server/methods/rentalProducts.coffee'
  ], ['server']);

  api.addFiles([
    'common/schemas.coffee', // Schema for rental products
    'common/hooks.coffee'
  ],['client', 'server']);
  });

Package.onTest(function(api) {
  api.use('coffeescript');
  api.use('underscore');
  api.use('sanjo:jasmine@0.15.2');
  api.use('velocity:html-reporter@0.7.1');
  api.use('velocity:console-reporter@0.1.2');

  api.use('reactioncommerce:core');
  api.use('getoutfitted:reaction-rental-products');
  api.use('reactioncommerce:bootstrap-theme');

  api.addFiles('tests/jasmine/server/integration/rentalProducts.coffee', 'server');

});
<commit_msg>Add moment and twix for date and date range manipulation.<commit_after>Package.describe({
  summary: 'Reaction Rental Products - Enable rental and for-hire products',
  name: 'getoutfitted:reaction-rental-products',
  version: '0.0.1',
  git: 'https://github.com/getoutfitted/reaction-rental-products.git'
});

Package.onUse(function (api, where) {
  api.versionsFrom('METEOR@1.0');
  api.use('templating');
  api.use('coffeescript');
  api.use('less');
  api.use('underscore');
  api.use('momentjs:moment@2.10.6');
  api.use('momentjs:twix@0.7.0');
  api.use('dburles:factory@0.3.10');
  api.use('matb33:collection-hooks');
  api.use('meteor-platform@1.2.1');
  api.use('reactioncommerce:core@0.6.0', ['client', 'server']);

  api.imply('dburles:factory');
  api.imply('matb33:collection-hooks');
  api.imply('momentjs:moment');

  api.addFiles([
    'server/register.coffee'
  ] ,['server']); // register as a reaction package

  api.addFiles([
    'server/factories.coffee',
    'server/methods/rentalProducts.coffee'
  ], ['server']);

  api.addFiles([
    'common/schemas.coffee', // Schema for rental products
    'common/hooks.coffee'
  ],['client', 'server']);
  });

Package.onTest(function(api) {
  api.use('coffeescript');
  api.use('underscore');
  api.use('sanjo:jasmine@0.15.2');
  api.use('velocity:html-reporter@0.7.1');
  api.use('velocity:console-reporter@0.1.2');

  api.use('reactioncommerce:core');
  api.use('getoutfitted:reaction-rental-products');
  api.use('reactioncommerce:bootstrap-theme');

  api.addFiles('tests/jasmine/server/integration/rentalProducts.coffee', 'server');

});
<|endoftext|>


<commit_before>Package.describe({
  name: 'mike:mocha',
  summary: "Run mocha tests in the browser",
  version: "0.5.1",
  debugOnly: true,
  git: "https://github.com/mad-eye/meteor-mocha-web"
});

Npm.depends({
  mocha: "1.17.1",
  chai: "1.9.0",
  mkdirp: "0.5.0"
});

//TODO break this out into a separate package and depend weakly
//Require npm assertion library if it doesn't exist..
//Npm.depends({chai: "1.9.0"});

Package.on_use(function (api, where) {
  api.use(['velocity:core@0.4.5'], "server");
  api.use(['velocity:html-reporter@0.3.2'], "client");
  api.use(['templating@1.0.6'], "client");
  api.use(['velocity:shim@0.1.0'], ["client", "server"]);
  api.use("velocity:node-soft-mirror@0.2.3", {unordered: true});

  api.add_files(["reporter.js", "server.js"], "server");
  api.add_files(["client.html", "mocha.js", "reporter.js", "client.js", "chai.js"], "client");

  api.add_files(["sample-tests/client.js","sample-tests/server.js"], "server", {isAsset: true});

  api.export("MochaWeb", ["client", "server"]);
  api.export("MeteorCollectionTestReporter", ["client", "server"]);
});
<commit_msg>bumping versions<commit_after>Package.describe({
  name: 'mike:mocha',
  summary: "Run mocha tests in the browser",
  version: "0.5.1",
  debugOnly: true,
  git: "https://github.com/mad-eye/meteor-mocha-web"
});

Npm.depends({
  mocha: "1.17.1",
  chai: "1.9.0",
  mkdirp: "0.5.0"
});

//TODO break this out into a separate package and depend weakly
//Require npm assertion library if it doesn't exist..
//Npm.depends({chai: "1.9.0"});

Package.on_use(function (api, where) {
  api.use(['velocity:core@0.4.5'], "server");
  api.use(['velocity:html-reporter@0.3.2'], "client");
  api.use(['templating@1.0.6'], "client");
  api.use(['velocity:shim@0.1.0'], ["client", "server"]);
  api.use("velocity:node-soft-mirror@0.2.4", {unordered: true});

  api.add_files(["reporter.js", "server.js"], "server");
  api.add_files(["client.html", "mocha.js", "reporter.js", "client.js", "chai.js"], "client");

  api.add_files(["sample-tests/client.js","sample-tests/server.js"], "server", {isAsset: true});

  api.export("MochaWeb", ["client", "server"]);
  api.export("MeteorCollectionTestReporter", ["client", "server"]);
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "An iron-router module that gives you the ability to configure your routes so that only allow authenticated users may access them"
});

Package.on_use(function(api){
    api.use([
    'iron-router'
    ], 'client');

    api.add_files([
        'LICENSE',
        'lib/iron-router-auth.js'
    ], 'client');
});
<commit_msg>fixing deps<commit_after>Package.describe({
    summary: "An iron-router module that gives you the ability to configure your routes so that only allow authenticated users may access them"
});

Package.on_use(function(api){
    api.use([
    'iron-router', 'session', 'underscore'
    ], 'client');

    api.add_files([
        'LICENSE',
        'lib/iron-router-auth.js'
    ], 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'gsklee:ngstorage',
  version: '0.3.0',
  summary: 'ngStorage package for Meteor',
  git: 'https://github.com/gsklee/ngStorage',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@0.9.0.1');
  api.use('urigo:angular@0.8.4', 'client');
  api.addFiles('ngStorage.js', 'client');
});
<commit_msg>Bump version in 0.3.4.<commit_after>Package.describe({
  name: 'gsklee:ngstorage',
  version: '0.3.4',
  summary: 'ngStorage package for Meteor',
  git: 'https://github.com/gsklee/ngStorage',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@0.9.0.1');
  api.use('urigo:angular@0.8.4', 'client');
  api.addFiles('ngStorage.js', 'client');
});
<|endoftext|>