<commit_before>Package.describe({
  name: 'typ:accounts-ldap',
  version: '1.0.1',
  summary: 'Accounts login for LDAP using ldapjs. Supports anonymous DN search & LDAPS.',
  git: 'https://github.com/typ90/meteor-accounts-ldap',
  documentation: 'README.md'
});

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

  api.use(['templating'], 'client');
  api.use(['typ:ldapjs@0.7.3'], 'server');

  api.use('accounts-base', 'server');
  api.imply('accounts-base', 'accounts-password', ['client', 'server']);

  api.use('check');

  api.addFiles(['ldap_client.js'], 'client');
  api.addFiles(['ldap_server.js'], 'server');

  api.export('LDAP', 'server');
  api.export('LDAP_DEFAULTS', 'server');
});
<commit_msg>Bumped version<commit_after>Package.describe({
  name: 'typ:accounts-ldap',
  version: '1.1.0',
  summary: 'Accounts login for LDAP using ldapjs. Supports anonymous DN search & LDAPS.',
  git: 'https://github.com/typ90/meteor-accounts-ldap',
  documentation: 'README.md'
});

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

  api.use(['templating'], 'client');
  api.use(['typ:ldapjs@0.7.3'], 'server');

  api.use('accounts-base', 'server');
  api.imply('accounts-base', 'accounts-password', ['client', 'server']);

  api.use('check');

  api.addFiles(['ldap_client.js'], 'client');
  api.addFiles(['ldap_server.js'], 'server');

  api.export('LDAP', 'server');
  api.export('LDAP_DEFAULTS', 'server');
});
<|endoftext|>


<commit_before>import _ from 'underscore';
import db from 'dbContext';

import partialHelper from '../views/helpers/partialsHelper.js';
import templatesHelper from '../views/helpers/templatesHelper.js';
import pagesHelper from '../views/helpers/pagesHelper.js';

import bookModel from '../models/bookModel.js';

class libraryController {
    load(sammy) {
        pagesHelper.append('library');

        bookModel.getBooks().find()
            .then(function(allBooks) {
                return templatesHelper.append('libraryBookTemplate', allBooks, '#library-content');
            })
            .then(function() {
                var libraryBookContent = $('#library-content div.inner img');
                libraryBookContent.on('click', function() {
                    var id = $(this).attr('data-id');
                    sammy.redirect('#/library/detailed/' + id);
                });
            });
    }

    categories() {

    }

    detailed(sammy) {
        pagesHelper.append('libraryDetailed');
        var id = sammy.params['bookId'];

        var selectedBook = bookModel.getBooks().get(id, {
            success: function(result) {
                templatesHelper.append('bookDetailedTemplate', [result], '#library-content');
            },
            error: function(object, error) {
                console.log('Cannot access the given book' + object);
                console.log(error);
            }
        });

    }

    search(sammy) {
        pagesHelper.append('librarySearch');

        // TODO: Extract common functions from promises?
        bookModel.getBooks().find()
            .then(function(allBooks) {
                return templatesHelper.append('libraryBookTemplate', allBooks, '#library-content');
            })
            .then(function() {
                var libraryBookContent = $('#library-content div.inner img');
                libraryBookContent.on('click', function() {
                    var id = $(this).attr('data-id');
                    sammy.redirect('#/library/detailed/' + id);
                });
            });
    }

    top() {

    }
}

export default new libraryController;<commit_msg>Optimized click event listener in "libraryController.js"<commit_after>import _ from 'underscore';
import db from 'dbContext';

import partialHelper from '../views/helpers/partialsHelper.js';
import templatesHelper from '../views/helpers/templatesHelper.js';
import pagesHelper from '../views/helpers/pagesHelper.js';

import bookModel from '../models/bookModel.js';

class libraryController {
    load(sammy) {
        pagesHelper.append('library');

        bookModel.getBooks().find()
            .then(function(allBooks) {
                return templatesHelper.append('libraryBookTemplate', allBooks, '#library-content');
            })
            .then(function() {
                var libraryBookContent = $('#library-content');
                libraryBookContent.on('click', 'div.inner img', function() {
                    var id = $(this).attr('data-id');
                    sammy.redirect('#/library/detailed/' + id);
                });
            });
    }

    categories() {

    }

    detailed(sammy) {
        pagesHelper.append('libraryDetailed');
        var id = sammy.params['bookId'];

        var selectedBook = bookModel.getBooks().get(id, {
            success: function(result) {
                templatesHelper.append('bookDetailedTemplate', [result], '#library-content');
            },
            error: function(object, error) {
                console.log('Cannot access the given book' + object);
                console.log(error);
            }
        });

    }

    search(sammy) {
        pagesHelper.append('librarySearch');

        // TODO: Extract common functions from promises?
        bookModel.getBooks().find()
            .then(function(allBooks) {
                return templatesHelper.append('libraryBookTemplate', allBooks, '#library-content');
            })
            .then(function() {
                var libraryBookContent = $('#library-content');
                libraryBookContent.on('click', 'div.inner img', function() {
                    var id = $(this).attr('data-id');
                    sammy.redirect('#/library/detailed/' + id);
                });
            });
    }

    top() {

    }
}

export default new libraryController;<|endoftext|>


<commit_before>var _ = require('underscore');
var $ = require('jquery');
var Loader = require('../../../src/core/loader');
var createVis = require('../../../src/api/create-vis');
var fakeVizJSON = require('./fake-vizjson');

describe('src/api/create-vis', function () {
  it('should throw errors if required params are not set', function () {
    expect(function () {
      createVis();
    }).toThrowError('a DOM element must be provided');

    expect(function () {
      createVis('something');
    }).toThrowError('a vizjson URL or object must be provided');

    expect(function () {
      createVis('domId', 'http://example.com/vizjson');
    }).not.toThrowError();
  });

  it('should load the vizjson file from a URL', function (done) {
    spyOn(Loader, 'get');
    var vis = createVis('domId', 'http://example.com/vizjson');

    // Simulate a successful response from Loader.get
    var loaderCallback = Loader.get.calls.mostRecent().args[1];
    loaderCallback(fakeVizJSON);

    vis.done(function (vis, layers) {
      expect(vis).toBeDefined();
      expect(layers).toBeDefined();
      done();
    });
  });

  it('should use the given vizjson object', function () {
    spyOn(Loader, 'get');
    var vis = createVis('domId', fakeVizJSON);
    expect(Loader.get).not.toHaveBeenCalled();
    vis.done(function (vis, layers) {
      expect(vis).toBeDefined();
      expect(layers).toBeDefined();
    });
  });

  it('should set the given center if values are correct', function () {
    var opts = {
      center_lat: 43.3,
      center_lon: '89'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('center')).toEqual([43.3, 89.0]);
  });

  it('should not set the center if values are not correct', function () {
    var opts = {
      center_lat: 43.3,
      center_lon: 'ham'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('center')).toEqual([ 41.40578459184651, 2.2230148315429688 ]);
  });

  it('should parse bounds values if they are correct', function () {
    var opts = {
      sw_lat: 43.3,
      sw_lon: 12,
      ne_lat: 12,
      ne_lon: '0'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('view_bounds_sw')).toEqual([43.3, 12]);
    expect(vis.map.get('view_bounds_ne')).toEqual([12, 0]);
  });

  it('should not parse bounds values if they are not correct', function () {
    var opts = {
      sw_lat: 43.3,
      sw_lon: 12,
      ne_lat: 'jamon',
      ne_lon: '0'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('view_bounds_sw')).toEqual([
      41.340989240001214,
      2.0194244384765625
    ]);
    expect(vis.map.get('view_bounds_ne')).toEqual([
      41.47051539294297,
      2.426605224609375
    ]);
  });

  it('should add header', function () {
    fakeVizJSON.title = 'title';

    var opts = {
      title: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);
    expect(vis.$('.cartodb-header').length).toEqual(1);
  });

  it('should add layer selector', function () {
    var opts = {
      title: true,
      layer_selector: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.cartodb-layer-selector-box').length).toEqual(1);
  });

  it('should add header without link in the title', function () {
    fakeVizJSON.title = 'title';
    fakeVizJSON.url = null;

    var opts = {
      title: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.cartodb-header').length).toEqual(1);
    expect(vis.$('.cartodb-header h1 > a').length).toEqual(0);
  });

  it('should add zoom', function () {
    fakeVizJSON.overlays = [{ type: 'zoom', order: 7, options: { x: 20, y: 20 }, template: 'test' }];

    var vis = createVis('domId', fakeVizJSON, {});

    expect(vis.$('.CDB-Zoom').length).toEqual(1);
  });

  it("should enable zoom if it's specified by zoomControl option", function () {
    fakeVizJSON.overlays = [{ type: 'zoom', order: 7, options: { x: 20, y: 20 }, template: 'test' }];
    var opts = {
      zoomControl: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Zoom').length).toEqual(1);
  });

  it("should disable zoom if it's specified by zoomControl option", function () {
    fakeVizJSON.overlays = [{ type: 'zoom', order: 7, options: { x: 20, y: 20 }, template: 'test' }];
    var opts = {
      zoomControl: false
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Zoom').length).toEqual(0);
  });

  it('should add search', function () {
    fakeVizJSON.overlays = [{ type: 'search' }];

    var vis = createVis('domId', fakeVizJSON, {});

    expect(vis.$('.CDB-Search').length).toEqual(1);
  });

  it("should enable search if it's specified by searchControl", function () {
    fakeVizJSON.overlays = [{ type: 'search' }];

    var opts = {
      searchControl: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Search').length).toEqual(1);
  });

  it("should disable search if it's specified by searchControl", function () {
    fakeVizJSON.overlays = [{ type: 'search' }];

    var opts = {
      searchControl: false
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Search').length).toEqual(0);
  });

  it('should use zoom', function () {
    var opts = {
      zoom: 10,
      bounds: [[24.206889622398023, -84.0234375], [76.9206135182968, 169.1015625]]
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.getZoom()).toEqual(10);
  });

  it('should force GMaps', function () {
    fakeVizJSON.map_provider = 'leaflet';
    fakeVizJSON.layers = [{
      type: 'tiled',
      options: {
        urlTemplate: 'https://dnv9my2eseobd.cloudfront.net/v3/{z}/{x}/{y}.png'
      }
    }];

    var opts = {
      gmaps_base_type: 'dark_roadmap'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.layers.at(0).get('type')).toEqual('GMapsBase');
  });

  var mapInstantiationRequestDone = function () {
    throw new Error($.ajax.calls.allArgs()[0][0].url);
  };

  describe('map instantiation', function () {
    beforeEach(function () {
      jasmine.clock().install();
      spyOn($, 'ajax');
    });

    it('should instantiate map', function () {
      this.vis = createVis('domId', fakeVizJSON, {});

      jasmine.clock().tick(500);

      expect(mapInstantiationRequestDone()).toEqual(true);
    });

    it('should NOT instantiate map if skipMapInstantiation options is set', function () {
      this.vis = createVis('domId', fakeVizJSON, {
        skipMapInstantiation: true
      });

      jasmine.clock().tick(500);

      expect(mapInstantiationRequestDone()).toEqual(false);
    });

    afterEach(function () {
      jasmine.clock().uninstall();
    });
  });
});
<commit_msg>Throw exception in test temporarily to debug issue in CI<commit_after>// var _ = require('underscore');
var $ = require('jquery');
var Loader = require('../../../src/core/loader');
var createVis = require('../../../src/api/create-vis');
var fakeVizJSON = require('./fake-vizjson');

describe('src/api/create-vis', function () {
  it('should throw errors if required params are not set', function () {
    expect(function () {
      createVis();
    }).toThrowError('a DOM element must be provided');

    expect(function () {
      createVis('something');
    }).toThrowError('a vizjson URL or object must be provided');

    expect(function () {
      createVis('domId', 'http://example.com/vizjson');
    }).not.toThrowError();
  });

  it('should load the vizjson file from a URL', function (done) {
    spyOn(Loader, 'get');
    var vis = createVis('domId', 'http://example.com/vizjson');

    // Simulate a successful response from Loader.get
    var loaderCallback = Loader.get.calls.mostRecent().args[1];
    loaderCallback(fakeVizJSON);

    vis.done(function (vis, layers) {
      expect(vis).toBeDefined();
      expect(layers).toBeDefined();
      done();
    });
  });

  it('should use the given vizjson object', function () {
    spyOn(Loader, 'get');
    var vis = createVis('domId', fakeVizJSON);
    expect(Loader.get).not.toHaveBeenCalled();
    vis.done(function (vis, layers) {
      expect(vis).toBeDefined();
      expect(layers).toBeDefined();
    });
  });

  it('should set the given center if values are correct', function () {
    var opts = {
      center_lat: 43.3,
      center_lon: '89'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('center')).toEqual([43.3, 89.0]);
  });

  it('should not set the center if values are not correct', function () {
    var opts = {
      center_lat: 43.3,
      center_lon: 'ham'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('center')).toEqual([ 41.40578459184651, 2.2230148315429688 ]);
  });

  it('should parse bounds values if they are correct', function () {
    var opts = {
      sw_lat: 43.3,
      sw_lon: 12,
      ne_lat: 12,
      ne_lon: '0'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('view_bounds_sw')).toEqual([43.3, 12]);
    expect(vis.map.get('view_bounds_ne')).toEqual([12, 0]);
  });

  it('should not parse bounds values if they are not correct', function () {
    var opts = {
      sw_lat: 43.3,
      sw_lon: 12,
      ne_lat: 'jamon',
      ne_lon: '0'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.get('view_bounds_sw')).toEqual([
      41.340989240001214,
      2.0194244384765625
    ]);
    expect(vis.map.get('view_bounds_ne')).toEqual([
      41.47051539294297,
      2.426605224609375
    ]);
  });

  it('should add header', function () {
    fakeVizJSON.title = 'title';

    var opts = {
      title: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);
    expect(vis.$('.cartodb-header').length).toEqual(1);
  });

  it('should add layer selector', function () {
    var opts = {
      title: true,
      layer_selector: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.cartodb-layer-selector-box').length).toEqual(1);
  });

  it('should add header without link in the title', function () {
    fakeVizJSON.title = 'title';
    fakeVizJSON.url = null;

    var opts = {
      title: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.cartodb-header').length).toEqual(1);
    expect(vis.$('.cartodb-header h1 > a').length).toEqual(0);
  });

  it('should add zoom', function () {
    fakeVizJSON.overlays = [{ type: 'zoom', order: 7, options: { x: 20, y: 20 }, template: 'test' }];

    var vis = createVis('domId', fakeVizJSON, {});

    expect(vis.$('.CDB-Zoom').length).toEqual(1);
  });

  it("should enable zoom if it's specified by zoomControl option", function () {
    fakeVizJSON.overlays = [{ type: 'zoom', order: 7, options: { x: 20, y: 20 }, template: 'test' }];
    var opts = {
      zoomControl: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Zoom').length).toEqual(1);
  });

  it("should disable zoom if it's specified by zoomControl option", function () {
    fakeVizJSON.overlays = [{ type: 'zoom', order: 7, options: { x: 20, y: 20 }, template: 'test' }];
    var opts = {
      zoomControl: false
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Zoom').length).toEqual(0);
  });

  it('should add search', function () {
    fakeVizJSON.overlays = [{ type: 'search' }];

    var vis = createVis('domId', fakeVizJSON, {});

    expect(vis.$('.CDB-Search').length).toEqual(1);
  });

  it("should enable search if it's specified by searchControl", function () {
    fakeVizJSON.overlays = [{ type: 'search' }];

    var opts = {
      searchControl: true
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Search').length).toEqual(1);
  });

  it("should disable search if it's specified by searchControl", function () {
    fakeVizJSON.overlays = [{ type: 'search' }];

    var opts = {
      searchControl: false
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.$('.CDB-Search').length).toEqual(0);
  });

  it('should use zoom', function () {
    var opts = {
      zoom: 10,
      bounds: [[24.206889622398023, -84.0234375], [76.9206135182968, 169.1015625]]
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.getZoom()).toEqual(10);
  });

  it('should force GMaps', function () {
    fakeVizJSON.map_provider = 'leaflet';
    fakeVizJSON.layers = [{
      type: 'tiled',
      options: {
        urlTemplate: 'https://dnv9my2eseobd.cloudfront.net/v3/{z}/{x}/{y}.png'
      }
    }];

    var opts = {
      gmaps_base_type: 'dark_roadmap'
    };

    var vis = createVis('domId', fakeVizJSON, opts);

    expect(vis.map.layers.at(0).get('type')).toEqual('GMapsBase');
  });

  var mapInstantiationRequestDone = function () {
    throw new Error($.ajax.calls.allArgs()[0][0].url);
  };

  describe('map instantiation', function () {
    beforeEach(function () {
      jasmine.clock().install();
      spyOn($, 'ajax');
    });

    it('should instantiate map', function () {
      this.vis = createVis('domId', fakeVizJSON, {});

      jasmine.clock().tick(500);

      expect(mapInstantiationRequestDone()).toEqual(true);
    });

    it('should NOT instantiate map if skipMapInstantiation options is set', function () {
      this.vis = createVis('domId', fakeVizJSON, {
        skipMapInstantiation: true
      });

      jasmine.clock().tick(500);

      expect(mapInstantiationRequestDone()).toEqual(false);
    });

    afterEach(function () {
      jasmine.clock().uninstall();
    });
  });
});
<|endoftext|>


<commit_before>/* istanbul ignore if */
if (typeof define !== 'function') { var define = require('amdefine')(module); }
define([
  './util/construct',
  './Class',
  './View',
  './Model',
  './trait/pubsub'
], function(construct, Class, View, Model, pubsub) {
  'use strict';

  var constructor = Class.extend({
    init: function() {
      this._initModel.apply(this, arguments);
      this.requestView();
    },

    render: function($parent, ViewClass) {
      this.requestView(ViewClass);
      return this._view.render($parent);
    },

    destroy: function() {
      if (this._view) { this._view.destroy(); }
      this._model.destroy();
      this._model = this._view = null;
      this.trigger('destroy').stopListening().off();
    },

    _initModel: function() {
      var ModelClass = this.Model || this.constructor.MODEL_CLASS;
      this._model = construct.apply(ModelClass, arguments);
    },

    _initView: function() {
      var ViewClass = Array.prototype.shift.call(arguments);
      this._view = construct.apply(ViewClass, arguments);
      this._view._controller = this;
    },

    switchView: function() {
      var existing = this._view;
      this._initView.apply(this, arguments);

      if (!existing) { return; }

      if (existing.$view) {
        this._view.$view = existing.$view;
        this._view.render();
      }

      existing.destroy();
    },

    requestView: function(ViewClass) {
      ViewClass = ViewClass || this.View || this.constructor.VIEW_CLASS;

      if (typeof ViewClass === 'string') {
        ViewClass = this.constructor.VIEW_CLASS[ViewClass];
      }
      if (typeof ViewClass !== 'function' || this._view instanceof ViewClass) {
        return;
      }
      this.switchView(ViewClass, this._model);
    },

    toJSON: function() {
      return this._model.toJSON();
    }
  }, {
    displayName: 'Controller',
    // Corresponding Entity View class
    VIEW_CLASS: View,

    // Corresponding Entity Model class
    MODEL_CLASS: Model
  })
  .mixin(pubsub);

  return constructor;
});
<commit_msg>Controller: forces a Promise from #render<commit_after>/* istanbul ignore if */
if (typeof define !== 'function') { var define = require('amdefine')(module); }
define([
  './util/construct',
  './Class',
  './View',
  './Model',
  './Promise',
  './trait/pubsub'
], function(construct, Class, View, Model, Promise, pubsub) {
  'use strict';

  var constructor = Class.extend({
    init: function() {
      this._initModel.apply(this, arguments);
      this.requestView();
    },

    render: function($parent, ViewClass) {
      this.requestView(ViewClass);
      return new Promise(function(resolve) {
        resolve(this._view.render($parent));
      });
    },

    destroy: function() {
      if (this._view) { this._view.destroy(); }
      this._model.destroy();
      this._model = this._view = null;
      this.trigger('destroy').stopListening().off();
    },

    _initModel: function() {
      var ModelClass = this.Model || this.constructor.MODEL_CLASS;
      this._model = construct.apply(ModelClass, arguments);
    },

    _initView: function() {
      var ViewClass = Array.prototype.shift.call(arguments);
      this._view = construct.apply(ViewClass, arguments);
      this._view._controller = this;
    },

    switchView: function() {
      var existing = this._view;
      this._initView.apply(this, arguments);

      if (!existing) { return; }

      if (existing.$view) {
        this._view.$view = existing.$view;
        this._view.render();
      }

      existing.destroy();
    },

    requestView: function(ViewClass) {
      ViewClass = ViewClass || this.View || this.constructor.VIEW_CLASS;

      if (typeof ViewClass === 'string') {
        ViewClass = this.constructor.VIEW_CLASS[ViewClass];
      }
      if (typeof ViewClass !== 'function' || this._view instanceof ViewClass) {
        return;
      }
      this.switchView(ViewClass, this._model);
    },

    toJSON: function() {
      return this._model.toJSON();
    }
  }, {
    displayName: 'Controller',
    // Corresponding Entity View class
    VIEW_CLASS: View,

    // Corresponding Entity Model class
    MODEL_CLASS: Model
  })
  .mixin(pubsub);

  return constructor;
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'elmarti:video-chat',
  version: '1.0.10',
  // Brief, one-line summary of the package.
  summary: 'Simple WebRTC Video Chat for your app.',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/elmarti/meteor-video-chat',
  // 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(api => {
  api.versionsFrom('1.5');
  api.use('ecmascript');
  api.use("rocketchat:streamer@0.5.0");
  api.use("mizzao:user-status@0.6.6");
  api.addFiles(['services/server.js', 'services/publish.js'], "server");
  api.addFiles(['services/client.js', 'services/adapter.js'], "client");
});
Package.onTest(api => {
  api.use('ecmascript');
  api.use('tinytest');

  api.addFiles('video-chat-tests.js');
  api.export([]);
});
<commit_msg>update version<commit_after>Package.describe({
  name: 'elmarti:video-chat',
  version: '1.1.0',
  // Brief, one-line summary of the package.
  summary: 'Simple WebRTC Video Chat for your app.',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/elmarti/meteor-video-chat',
  // 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(api => {
  api.versionsFrom('1.5');
  api.use('ecmascript');
  api.use("rocketchat:streamer@0.5.0");
  api.use("mizzao:user-status@0.6.6");
  api.addFiles(['services/server.js', 'services/publish.js'], "server");
  api.addFiles(['services/client.js', 'services/adapter.js'], "client");
});
Package.onTest(api => {
  api.use('ecmascript');
  api.use('tinytest');

  api.addFiles('video-chat-tests.js');
  api.export([]);
});
<|endoftext|>


<commit_before>angular.module('ocWebGui.stats.status.service', ['ngResource'])
  .factory('AgentStatusStats', function ($http) {
    return {
      stats: function (startDate, endDate, reportType) {
        // swap dates other way around if startDate is after endDate
        if (Date.parse(startDate) > Date.parse(endDate)) {
          [startDate, endDate] = [endDate, startDate];
        }
        return $http.post('agent_statuses/stats', {
          report_type: reportType,
          team_name: 'Helpdesk',
          start_date: startDate,
          end_date: endDate
        });
      }
    };
  });
<commit_msg>nice date split<commit_after>angular.module('ocWebGui.stats.status.service', ['ngResource'])
  .factory('AgentStatusStats', function ($http) {
    return {
      stats: function (startDate, endDate, reportType) {
        // swap dates other way around if startDate is after endDate
        var startDateParts = startDate.split(".");
        var startDateObject = new Date(startDateParts[2], startDateParts[1] - 1, startDateParts[0]);

        var endDateParts = endDate.split(".");
        var endDateObject = new Date(endDateParts[2], endDateParts[1] - 1, endDateParts[0]);

        if (startDateObject > endDateObject) {
          [startDate, endDate] = [endDate, startDate];
        }
        return $http.post('agent_statuses/stats', {
          report_type: reportType,
          team_name: 'Helpdesk',
          start_date: startDate,
          end_date: endDate
        });
      }
    };
  });
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Flow Components',
  version: '0.0.19',
  git: 'https://github.com/meteorhacks/flow-components',
  name: "meteorhacks:flow-components"
});

Package.onUse(function (api) {
  api.versionsFrom('METEOR@0.9.2');
  api.use('ui');
  api.use('templating');
  api.use('reactive-var');
  api.use('reactive-dict');
  api.use('underscore');
  api.use('raix:eventemitter@0.1.1');

  api.addFiles('lib/client/utils.js', 'client');
  api.addFiles('lib/client/action_hub.js', 'client');
  api.addFiles('lib/client/component.js', 'client');
  api.addFiles('lib/client/component_instance.js', 'client');
  api.addFiles('lib/client/api.js', 'client');
  api.addFiles('lib/client/lookup.js', 'client');
  api.addFiles('lib/client/render.js', 'client');
  api.export(['FlowComponents']);
});
<commit_msg>version bumped<commit_after>Package.describe({
  summary: 'Flow Components',
  version: '0.0.20',
  git: 'https://github.com/meteorhacks/flow-components',
  name: "meteorhacks:flow-components"
});

Package.onUse(function (api) {
  api.versionsFrom('METEOR@0.9.2');
  api.use('ui');
  api.use('templating');
  api.use('reactive-var');
  api.use('reactive-dict');
  api.use('underscore');
  api.use('raix:eventemitter@0.1.1');

  api.addFiles('lib/client/utils.js', 'client');
  api.addFiles('lib/client/action_hub.js', 'client');
  api.addFiles('lib/client/component.js', 'client');
  api.addFiles('lib/client/component_instance.js', 'client');
  api.addFiles('lib/client/api.js', 'client');
  api.addFiles('lib/client/lookup.js', 'client');
  api.addFiles('lib/client/render.js', 'client');
  api.export(['FlowComponents']);
});
<|endoftext|>


<commit_before>
var assert = require('assert')
  , run = require('comandante')
  , path = require('path')
  , cheerio = require('cheerio')
  , root = path.join(__dirname, 'template-data')
  , reader = require('../helpers/reader')
  , read = reader({ cwd: root })

describe('template/mustache data', function(){
  before(function(done){
    run('haiku', [ 'build' ], { cwd: root })
    .on('error', done)
    .on('end', done)
  })

  describe('{{#content}}', function(){
    var $

    before(function(done){
      // Wrap this in a promise?
      read('/content-list.html', function(err, data){
        if (err) return done(err)
        else done(null, $ = cheerio.load(data))
      })
    })

    it('lists pages inside the --content-dir')

    it('does not include the index files')

    it('sorts by date')
  })

  describe('{{#content/sub-directories}}', function(){
    it('lists pages in the --content-dir sub-directories')
  })

  describe('{{#content/direct-page-access.md}}', function(){
    it('renders a block for the keyed page')
  })

  describe('{{#pages}}', function(){
    it('lists all pages recursively')
  })
})
<commit_msg>Uses the bin directly<commit_after>
var assert = require('assert')
  , run = require('comandante')
  , path = require('path')
  , root = path.join(__dirname, 'template-data')
  , haiku = path.join(__dirname, '..', '..', 'bin', 'haiku')
  , cheerio = require('cheerio')
  , reader = require('../helpers/reader')
  , read = reader({ cwd: root })

describe('template/mustache data', function(){
  before(function(done){
    run(haiku, [ 'build' ], { cwd: root })
    .on('error', done)
    .on('end', done)
  })

  describe('{{#content}}', function(){
    var $

    before(function(done){
      // Wrap this in a promise?
      read('/content-list.html', function(err, data){
        if (err) return done(err)
        else done(null, $ = cheerio.load(data))
      })
    })

    it('lists pages inside the --content-dir')

    it('does not include the index files')

    it('sorts by date')
  })

  describe('{{#content/sub-directories}}', function(){
    it('lists pages in the --content-dir sub-directories')
  })

  describe('{{#content/direct-page-access.md}}', function(){
    it('renders a block for the keyed page')
  })

  describe('{{#pages}}', function(){
    it('lists all pages recursively')
  })
})
<|endoftext|>


<commit_before>describe('cloverleaf.BackingStore', () => {
  it('should throw if constructed directly');
  context('when extended by another class', () => {
    it('should throw if select method is not defined by child class');
    it('should throw if property select is not a function in child class');
    it('should throw if commit method is not defined by child class');
    it('should throw if property commit is not a function in child class');
    it('should throw if discard method is not defined by child class');
    it('should throw if property discard is not a function in child class');
  });
});
<commit_msg>Add some more clarity to the BackingStore tests<commit_after>describe('cloverleaf.BackingStore', () => {
  it('should throw if constructed directly');
  context('when extended by another class', () => {
    describe('constructor', () => {
      it('should throw if select method is not defined by child class');
      it('should throw if property select is not a function in child class');
      it('should throw if commit method is not defined by child class');
      it('should throw if property commit is not a function in child class');
      it('should throw if discard method is not defined by child class');
      it('should throw if property discard is not a function in child class');
    });
  });
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'ox2:auto-login',
  version: '0.1.1',
  // Brief, one-line summary of the package.
  summary: 'DO NOT USE',
  // 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: '',
  debugOnly: true
});

var C = 'client';
var S = 'server';
var CS = [C, S];

Package.onUse(function(api) {
    api.versionsFrom('1.2.1');
    // Core
    api.use([
      'templating',
      'ecmascript'
    ]);
    // 3rd party
    api.use([
      'lauricio:less-autoprefixer@2.5.0_3',
      'mquandalle:jade@0.4.5', 'mousetrap:mousetrap@1.4.6_1'
    ]);
    api.addFiles('lib/client/oo-auto-login.jade', C);
    api.addFiles('lib/client/oo-auto-login.less', C);
    api.addFiles('lib/client/oo-auto-login.js', C);
    api.addFiles('lib/server/oo-auto-login.js', S);
});

Npm.depends({
  'faker': '3.0.1'
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');
  api.use('ox2:auto-login');
  api.addFiles('tests/package-tests.js');
});
<commit_msg>remove autoprefixer<commit_after>Package.describe({
  name: 'ox2:auto-login',
  version: '0.1.1',
  // Brief, one-line summary of the package.
  summary: 'DO NOT USE',
  // 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: '',
  debugOnly: true
});

var C = 'client';
var S = 'server';
var CS = [C, S];

Package.onUse(function(api) {
    api.versionsFrom('1.2.1');
    // Core
    api.use([
      'templating',
      'ecmascript',
      'less'
    ]);
    // 3rd party
    api.use([
      'mquandalle:jade@0.4.9', 'mousetrap:mousetrap@1.4.6_1'
    ]);
    api.addFiles('lib/client/oo-auto-login.jade', C);
    api.addFiles('lib/client/oo-auto-login.less', C);
    api.addFiles('lib/client/oo-auto-login.js', C);
    api.addFiles('lib/server/oo-auto-login.js', S);
});

Npm.depends({
  'faker': '3.0.1'
});

Package.onTest(function(api) {
  api.use('ecmascript');
  api.use('tinytest');
  api.use('ox2:auto-login');
  api.addFiles('tests/package-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'meteorhacks:flow-router',
  summary: 'Router for Flow Architecture',
  version: '0.0.12',
  git: 'https://github.com/meteorhacks/flow-router.git'
});

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

  api.use('underscore');
  api.use('tracker');

  api.use('meteorhacks:fast-render@2.0.0', ['client', 'server'], {weak: true});

  api.addFiles('client/vendor/page.js', 'client');
  api.addFiles('client/vendor/query.js', 'client');
  api.addFiles('client/router.js', 'client');
  api.addFiles('client/route.js', 'client');
  api.addFiles('client/_init.js', 'client');
  api.addFiles('server/router.js', 'server');
  api.addFiles('server/route.js', 'server');
  api.addFiles('server/_init.js', 'server');

  api.addFiles('server/plugins/fast-render.js', 'server');

  api.export('FlowRouter');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('meteorhacks:flow-router');
  api.use('practicalmeteor:sinon');

  api.addFiles('test/client/_helpers.js', 'client');
  api.addFiles('test/server/_helpers.js', 'server');

  api.addFiles('test/client/loader.spec.js', 'client');
  api.addFiles('test/client/router.test.js', 'client');
  api.addFiles('test/client/router.spec.js', 'client');
  api.addFiles('test/client/route.test.js', 'client');
  api.addFiles('test/client/route.spec.js', 'client');
});
<commit_msg>version bumped<commit_after>Package.describe({
  name: 'meteorhacks:flow-router',
  summary: 'Router for Flow Architecture',
  version: '0.0.13',
  git: 'https://github.com/meteorhacks/flow-router.git'
});

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

  api.use('underscore');
  api.use('tracker');

  api.use('meteorhacks:fast-render@2.0.0', ['client', 'server'], {weak: true});

  api.addFiles('client/vendor/page.js', 'client');
  api.addFiles('client/vendor/query.js', 'client');
  api.addFiles('client/router.js', 'client');
  api.addFiles('client/route.js', 'client');
  api.addFiles('client/_init.js', 'client');
  api.addFiles('server/router.js', 'server');
  api.addFiles('server/route.js', 'server');
  api.addFiles('server/_init.js', 'server');

  api.addFiles('server/plugins/fast-render.js', 'server');

  api.export('FlowRouter');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('meteorhacks:flow-router');
  api.use('practicalmeteor:sinon');

  api.addFiles('test/client/_helpers.js', 'client');
  api.addFiles('test/server/_helpers.js', 'server');

  api.addFiles('test/client/loader.spec.js', 'client');
  api.addFiles('test/client/router.test.js', 'client');
  api.addFiles('test/client/router.spec.js', 'client');
  api.addFiles('test/client/route.test.js', 'client');
  api.addFiles('test/client/route.spec.js', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Meteor package to wrap redis driver. Includes hiredis.'
});

Package.on_use(function(api, where) {
  api.add_files('meteor-redis.js', 'server');
});

Npm.depends({
  hiredis: '0.1.15',
  redis: '0.8.3'
});<commit_msg>upgrading redis version to 0.8.4<commit_after>Package.describe({
  summary: 'Meteor package to wrap redis driver. Includes hiredis.'
});

Package.on_use(function(api, where) {
  api.add_files('meteor-redis.js', 'server');
});

Npm.depends({
  hiredis: '0.1.15',
  redis: '0.8.4'
});
<|endoftext|>


<commit_before>var where = 'server';

Package.describe({
  name: 'lookback:emails',
  summary: 'Send emails with server side templates.',
  version: '0.0.2'
});

Npm.depends({
  'node-sass': '2.0.0',
  'juice': '1.0.0'
});

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

  api.use([
    'check',
    'underscore',
    'coffeescript',
    'email',
    'iron:router',
    'meteorhacks:ssr@2.1.2'
  ], where);

  api.addFiles([
    'utils.coffee',
    'emails.coffee'
  ], where);

  api.export('Mailer', where);
});
<commit_msg>Version 0.0.3<commit_after>var where = 'server';

Package.describe({
  name: 'lookback:emails',
  summary: 'Send emails with server side templates.',
  version: '0.0.3'
});

Npm.depends({
  'node-sass': '2.0.0',
  'juice': '1.0.0'
});

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

  api.use([
    'check',
    'underscore',
    'coffeescript',
    'email',
    'iron:router',
    'meteorhacks:ssr@2.1.2'
  ], where);

  api.addFiles([
    'utils.coffee',
    'emails.coffee'
  ], where);

  api.export('Mailer', where);
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Soft remove behavior for Meteor Astronomy',
  version: '0.3.1',
  name: 'jagi:astronomy-softremove-behavior',
  git: 'https://github.com/jagi/meteor-astronomy-softremove-behavior.git'
});

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

  api.use('jagi:astronomy-behaviors@0.6.0');
  api.use('jagi:astronomy-query-builder@0.1.0');
  api.use('underscore');

  // Behavior.
  api.addFiles('lib/behavior/events.js', ['client', 'server']);
  api.addFiles('lib/behavior/methods.js', ['client', 'server']);
  api.addFiles('lib/behavior/behavior.js', ['client', 'server']);
});
<commit_msg>Remove query builder dependency<commit_after>Package.describe({
  summary: 'Soft remove behavior for Meteor Astronomy',
  version: '0.3.1',
  name: 'jagi:astronomy-softremove-behavior',
  git: 'https://github.com/jagi/meteor-astronomy-softremove-behavior.git'
});

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

  api.use('jagi:astronomy-behaviors@0.6.0');
  api.use('underscore');

  // Behavior.
  api.addFiles('lib/behavior/events.js', ['client', 'server']);
  api.addFiles('lib/behavior/methods.js', ['client', 'server']);
  api.addFiles('lib/behavior/behavior.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Accounts Templates styled for Zurb Foundation for Sites.',
  version: '1.14.1',
  name: 'useraccounts:foundation-sites',
  git: 'https://github.com/meteor-useraccounts/foundation-sites.git',
});

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

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

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

  // Requires all routing packages loads before this asking for weak dependencies.
  api.use('useraccounts:flow-routing@1.14.1', ['client', 'server'], {weak: true});
  api.use('useraccounts:iron-routing@1.14.1', ['client', 'server'], {weak: true});

  api.imply([
    'useraccounts:core@1.14.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_message.html',
    'lib/at_message.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_foundation.css'
  ], ['client']);
});

Package.on_test(function(api) {
  api.use([
    'useraccounts:foundation-sites',
    'useraccounts:core@1.14.1',
  ]);

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

  api.add_files([
    'tests/tests.js'
  ], ['client', 'server']);
});
<commit_msg>patch release - Bump to version 1.14.2<commit_after>Package.describe({
  summary: 'Accounts Templates styled for Zurb Foundation for Sites.',
  version: '1.14.2',
  name: 'useraccounts:foundation-sites',
  git: 'https://github.com/meteor-useraccounts/foundation-sites.git',
});

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

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

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

  // Requires all routing packages loads before this asking for weak dependencies.
  api.use('useraccounts:flow-routing@1.14.2', ['client', 'server'], {weak: true});
  api.use('useraccounts:iron-routing@1.14.2', ['client', 'server'], {weak: true});

  api.imply([
    'useraccounts:core@1.14.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_message.html',
    'lib/at_message.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_foundation.css'
  ], ['client']);
});

Package.on_test(function(api) {
  api.use([
    'useraccounts:foundation-sites',
    'useraccounts:core@1.14.2',
  ]);

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

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


<commit_before>Package.describe({
  summary: "Authorize users based on their github username or organization membership",
  version: "0.1.0",
  git: "https://github.com/CXInc/meteor-github-authorization"
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@0.9.1.1');

  api.use('bruz:github-api@0.2.2', ['server']);
  api.use('coffeescript', ['server']);
  api.use('accounts-base', ['server']);

  api.addFiles(['server/authorization.coffee'], ['server']);
  api.addFiles(['server/users.coffee'], 'server');
  api.addFiles(['client/account_permissions.coffee'], 'client');

  api.export('Authorization', ['server']);
});
<commit_msg>Bump version<commit_after>Package.describe({
  summary: "Authorize users based on their github username or organization membership",
  version: "0.2.0",
  git: "https://github.com/CXInc/meteor-github-authorization"
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@0.9.1.1');

  api.use('bruz:github-api@0.2.2', ['server']);
  api.use('coffeescript', ['server']);
  api.use('accounts-base', ['server']);

  api.addFiles(['server/authorization.coffee'], ['server']);
  api.addFiles(['server/users.coffee'], 'server');
  api.addFiles(['client/account_permissions.coffee'], 'client');

  api.export('Authorization', ['server']);
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'lookback:tooltips',
  summary: 'Reactive tooltips.',
  version: '0.6',
  git: 'https://github.com/lookback/meteor-tooltips.git'
});

Package.on_use(function(api) {
  api.versionsFrom('1.0.4');
  api.use('coffeescript reactive-var jquery templating tracker'.split(' '), 'client');

  api.add_files('tooltips.html tooltips.coffee'.split(' '), 'client');
  api.export('Tooltips', 'client');
});
<commit_msg>Fixed version format<commit_after>Package.describe({
  name: 'lookback:tooltips',
  summary: 'Reactive tooltips.',
  version: '0.6.0',
  git: 'https://github.com/lookback/meteor-tooltips.git'
});

Package.on_use(function(api) {
  api.versionsFrom('1.0.4');
  api.use('coffeescript reactive-var jquery templating tracker'.split(' '), 'client');

  api.add_files('tooltips.html tooltips.coffee'.split(' '), 'client');
  api.export('Tooltips', 'client');
});
<|endoftext|>


<commit_before>/*!
 * @author:    Divio AG
 * @copyright: http://www.divio.ch
 */

//######################################################################################################################
// #NAMESPACES#
var Cl = window.Cl || {};

//######################################################################################################################
// #UTILS#
(function ($) {
    'use strict';

    Cl.newsBlog = {

        // INFO: autoinit certain functionalities
        init: function () {
            var that = this;

            $('.js-aldryn-newsblog-article-search').each(function () {
                that._search($(this));
            });
        },

        // INFO: handles search form
        _search: function (container) {
            var form = container.find('form');

            form.on('submit', function (e) {
                e.preventDefault();

                $.ajax({
                    'type': 'get',
                    'url': form.prop('action'),
                    'data': form.serialize()
                }).always(function (data) {
                    form.siblings('.js-search-results').html(data);
                });
            });
        }

    };

    // autoload
    if ($('.js-aldryn-newsblog-article-search').length) {
        Cl.newsBlog.init();
    }

})(jQuery);
<commit_msg>adapt to feedback<commit_after>/*!
 * @author:    Divio AG
 * @copyright: http://www.divio.ch
 */

//######################################################################################################################
// #NAMESPACES#
var Cl = window.Cl || {};

//######################################################################################################################
// #UTILS#
(function ($) {
    'use strict';

    Cl.newsBlog = {

        // INFO: autoinit certain functionalities
        init: function () {
            var that = this;

            $('.js-aldryn-newsblog-article-search').each(function () {
                that._search($(this));
            });
        },

        // INFO: handles search form
        _search: function (container) {
            var form = container.find('form');

            form.on('submit', function (e) {
                e.preventDefault();

                $.ajax({
                    type: 'GET',
                    url: form.prop('action'),
                    data: form.serialize()
                }).always(function (data) {
                    form.siblings('.js-search-results').html(data);
                });
            });
        }

    };

    // autoload
    if ($('.js-aldryn-newsblog-article-search').length) {
        Cl.newsBlog.init();
    }

})(jQuery);
<|endoftext|>


<commit_before>Package.describe({
  name: "practicalmeteor:loglevel",
  summary: "Simple logger with app and per-package log levels and line number preserving output.",
  version: "1.1.0_3",
  git: "https://github.com/practicalmeteor/meteor-loglevel.git"
});

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

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

  api.use(['practicalmeteor:chai@1.9.2_3']);

  api.addFiles('loglevel-1.2.0.js');
  api.addFiles('LoggerFactory.coffee');

  api.export('loglevel');
});

Package.onTest(function(api) {
  api.use(['coffeescript', 'practicalmeteor:loglevel', 'practicalmeteor:munit@2.1.2']);
  api.addFiles('tests/LoggerFactoryTest.coffee');
});
<commit_msg>Update package version to 1.2.0_1<commit_after>Package.describe({
  name: "practicalmeteor:loglevel",
  summary: "Simple logger with app and per-package log levels and line number preserving output.",
  version: "1.2.0_1",
  git: "https://github.com/practicalmeteor/meteor-loglevel.git"
});

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

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

  api.use(['practicalmeteor:chai@1.9.2_3']);

  api.addFiles('loglevel-1.2.0.js');
  api.addFiles('LoggerFactory.coffee');

  api.export('loglevel');
});

Package.onTest(function(api) {
  api.use(['coffeescript', 'practicalmeteor:loglevel', 'practicalmeteor:munit@2.1.2']);
  api.addFiles('tests/LoggerFactoryTest.coffee');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Soft remove behavior for Meteor Astronomy',
  version: '1.0.0',
  name: 'jagi:astronomy-softremove-behavior',
  git: 'https://github.com/jagi/meteor-astronomy-softremove-behavior.git'
});

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

  api.use('jagi:astronomy@1.0.0');
  api.use('underscore');

  // Behavior.
  api.addFiles('lib/behavior/events.js', ['client', 'server']);
  api.addFiles('lib/behavior/methods.js', ['client', 'server']);
  api.addFiles('lib/behavior/behavior.js', ['client', 'server']);
});
<commit_msg>Bump version to 1.0.1<commit_after>Package.describe({
  summary: 'Soft remove behavior for Meteor Astronomy',
  version: '1.0.1',
  name: 'jagi:astronomy-softremove-behavior',
  git: 'https://github.com/jagi/meteor-astronomy-softremove-behavior.git'
});

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

  api.use('jagi:astronomy@1.0.0');
  api.use('underscore');

  // Behavior.
  api.addFiles('lib/behavior/events.js', ['client', 'server']);
  api.addFiles('lib/behavior/methods.js', ['client', 'server']);
  api.addFiles('lib/behavior/behavior.js', ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  name: "sergeyt:dimple",
  summary: "dimple - an object-oriented API for business analytics powered by d3.",
  git: "https://github.com/sergeyt/meteor-dimple.git",
  version: "2.1.0_1"
});

Package.onUse(function(api){
  var client = ["client"];
  api.versionsFrom("METEOR@1.0");
  api.use(['d3js:d3'], 'client');
  api.addFiles("dimple.js", client);
});
<commit_msg>fixed d3js:d3 version constraint (#3)<commit_after>Package.describe({
  name: "sergeyt:dimple",
  summary: "dimple - an object-oriented API for business analytics powered by d3.",
  git: "https://github.com/sergeyt/meteor-dimple.git",
  version: "2.1.0_1"
});

Package.onUse(function(api){
  var client = ["client"];
  api.versionsFrom("METEOR@1.0");
  api.use(['d3js:d3@3.4.13'], 'client');
  api.addFiles("dimple.js", client);
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'jmusacchio:vertxbus',
  version: '0.0.3',
  // Brief, one-line summary of the package.
  summary: 'The Vert.x Event Bus Package allows any meteor app to be able to connect to Vert.x Components',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/jmusacchio/vertxbus',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Npm.depends({
  'sockjs-client': '1.0.3',
  'vertx3-eventbus-client': '3.1.0'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.use('mquandalle:bower', 'client');
  api.addFiles('bower.json', 'client');
  api.addFiles('npm.js', 'server');
  api.addFiles('export.js');
  if (api.export)
    api.export('Vertx');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('jmusacchio:vertxbus');
  api.addFiles('vertxbus-tests.js');
});<commit_msg>Added mquandalle:bower pacakge version.<commit_after>Package.describe({
  name: 'jmusacchio:vertxbus',
  version: '0.0.3',
  // Brief, one-line summary of the package.
  summary: 'The Vert.x Event Bus Package allows any meteor app to be able to connect to Vert.x Components',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/jmusacchio/vertxbus',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

Npm.depends({
  'sockjs-client': '1.0.3',
  'vertx3-eventbus-client': '3.1.0'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.use('mquandalle:bower@0.1.11', 'client');
  api.addFiles('bower.json', 'client');
  api.addFiles('npm.js', 'server');
  api.addFiles('export.js');
  if (api.export)
    api.export('Vertx');
});

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


<commit_before>Package.describe({
  name: 'em0ney:stub-collection',
  version: '0.1.0',
  summary: 'A class to stub out your collections when writing unit tests',
  git: 'git@github.com:em0ney/meteor-stub-collection.git',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.use([
    'ecmascript',
    'underscore',
    'random'
  ]);

  api.addFiles([
    'match-items.js',
    'stub-collection.js'
  ]);

  api.export('StubCollection');
});

Package.onTest(function(api) {
  api.use(['tinytest', 'ecmascript', 'underscore', 'random']);
  api.addFiles([
    'match-items.js',
    'stub-collection.js'
  ]);
  api.addFiles('stub-collection-tests.js');
});
<commit_msg>adding ecmascript version constraint<commit_after>Package.describe({
  name: 'em0ney:stub-collection',
  version: '0.1.0',
  summary: 'A class to stub out your collections when writing unit tests',
  git: 'git@github.com:em0ney/meteor-stub-collection.git',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.use([
    'ecmascript@0.1.6',
    'underscore',
    'random'
  ]);

  api.addFiles([
    'match-items.js',
    'stub-collection.js'
  ]);

  api.export('StubCollection');
});

Package.onTest(function(api) {
  api.use(['tinytest', 'ecmascript@0.1.6', 'underscore', 'random']);
  api.addFiles([
    'match-items.js',
    'stub-collection.js'
  ]);
  api.addFiles('stub-collection-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  name: "ground:db",
  version: "0.2.5",
  summary: "Ground Meteor.Collections offline",
  git: "https://github.com/GroundMeteor/db.git"
});

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

  api.use('meteor-platform', ['client', 'server']);

  api.use([
    'meteor',
    'underscore',
    'minimongo',
    'ejson',
    'ground:util@0.1.7',
    'ground:servertime@0.0.3',
    //'ground:minimax@1.0.1', // Its implied by ground:util
    'ground:localstorage@0.1.7',
    'raix:eventemitter@0.1.1',
    'raix:stubfence@1.0.1',
    'raix:onetimeout@1.0.3'
  ], ['client', 'server']);

  // Make sure any storage adapters are loaded first
  // api.use([
  //   'ground:localstorage'
  // ], 'client', { weak: true });

  api.export('Ground');
  api.export('GroundDB');

  api.use(['tracker'], 'client');

  //api.use([], 'server');
  //api.use(['localstorage', 'ejson'], 'client');
  api.addFiles([
    'groundDB.client.js',
    'wrap.collection.js',
    'wrap.eventemitter.js',
    'wrap.proto.eventemitter.js',
    ], 'client');
  api.addFiles('groundDB.server.js', 'server');
});

Package.onTest(function (api) {
  api.use('ground:db', ['client']);
  api.use('test-helpers', 'client');
  api.use(['tinytest', 'underscore', 'ejson', 'ordered-dict',
           'random', 'tracker']);

  api.addFiles('groundDB.client.tests.js', 'client');
  api.addFiles('groundDB.server.tests.js', 'server');
});
<commit_msg>bump deps<commit_after>Package.describe({
  name: "ground:db",
  version: "0.2.5",
  summary: "Ground Meteor.Collections offline",
  git: "https://github.com/GroundMeteor/db.git"
});

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

  api.use('meteor-platform', ['client', 'server']);

  api.use([
    'meteor',
    'underscore',
    'minimongo',
    'ejson',
    'ground:util@0.1.8',
    'ground:servertime@0.0.3',
    //'ground:minimax@1.0.1', // Its implied by ground:util
    'ground:localstorage@0.1.7',
    'raix:eventemitter@0.1.1',
    'raix:stubfence@1.0.1',
    'raix:onetimeout@1.0.3'
  ], ['client', 'server']);

  // Make sure any storage adapters are loaded first
  // api.use([
  //   'ground:localstorage'
  // ], 'client', { weak: true });

  api.export('Ground');
  api.export('GroundDB');

  api.use(['tracker'], 'client');

  //api.use([], 'server');
  //api.use(['localstorage', 'ejson'], 'client');
  api.addFiles([
    'groundDB.client.js',
    'wrap.collection.js',
    'wrap.eventemitter.js',
    'wrap.proto.eventemitter.js',
    ], 'client');
  api.addFiles('groundDB.server.js', 'server');
});

Package.onTest(function (api) {
  api.use('ground:db', ['client']);
  api.use('test-helpers', 'client');
  api.use(['tinytest', 'underscore', 'ejson', 'ordered-dict',
           'random', 'tracker']);

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


<commit_before>/* global Package:false, Npm:false */

Package.describe({
  name: 'meson:electron',
  summary: "Electron",
  version: "0.1.4",
  git: "https://github.com/electron-webapps/meteor-electron"
});

Npm.depends({
  "electron-packager": "https://github.com/mixmaxhq/electron-packager/archive/f511e2680efa39c014d8bedca872168e585f8daf.tar.gz",
  "is-running": "1.0.5",
  "lucy-dirsum": "https://github.com/mixmaxhq/lucy-dirsum/archive/08299b483cd0f79d18cd0fa1c5081dcab67c5649.tar.gz",
  "mkdirp": "0.5.1",
  "ncp": "2.0.0",
  "rimraf": "2.4.4",
  "semver": "5.1.0",
  "url-join": "0.0.1",
  "electron-rebuild": "1.0.1"
});

Package.onUse(function (api) {
  api.versionsFrom("METEOR@1.0");
  api.use(["mongo-livedata", "webapp", "ejson", "promise"], "server");
  api.use("underscore", ["server", "client"]);
  api.use(["iron:router@0.9.4||1.0.0"], {weak: true});
  api.use("meteorhacks:picker@1.0.0", "server", {weak: true});

  api.addFiles([
    'server/createBinaries.js',
    'server/downloadUrls.js',
    'server/launchApp.js',
    'server/serve.js',
    'server/serveDownloadUrl.js',
    'server/serveUpdateFeed.js',
    // Must go last so that its dependencies have been defined.
    'server/index.js'
  ], 'server');

  var assets = [
    "app/autoUpdater.js",
    "app/main.js",
    "app/menu.js",
    "app/package.json",
    "app/preload.js",
    "app/proxyWindowEvents.js"
  ];

  // Use Meteor 1.2+ API, but fall back to the pre-1.2 API if necessary
  if (api.addAssets) {
    api.addAssets(assets, "server");
  } else {
    api.addFiles(assets, "server", {isAsset: true});
  }

  api.addFiles(['client/index.js'], "client");

  // Test exports.
  api.export([
    'parseMacDownloadUrl',
    'parseWindowsDownloadUrls'
  ], 'server', {
    testOnly: true
  });

  // Public exports.
  api.export("Electron", ["client"]);
});

Package.onTest(function(api) {
  api.use(['meson:electron', 'tinytest']);

  api.addFiles('tests/server/downloadUrlsTest.js', 'server');
});
<commit_msg>Add version constraint for `promise`<commit_after>/* global Package:false, Npm:false */

Package.describe({
  name: 'meson:electron',
  summary: "Electron",
  version: "0.1.4",
  git: "https://github.com/electron-webapps/meteor-electron"
});

Npm.depends({
  "electron-packager": "https://github.com/mixmaxhq/electron-packager/archive/f511e2680efa39c014d8bedca872168e585f8daf.tar.gz",
  "is-running": "1.0.5",
  "lucy-dirsum": "https://github.com/mixmaxhq/lucy-dirsum/archive/08299b483cd0f79d18cd0fa1c5081dcab67c5649.tar.gz",
  "mkdirp": "0.5.1",
  "ncp": "2.0.0",
  "rimraf": "2.4.4",
  "semver": "5.1.0",
  "url-join": "0.0.1",
  "electron-rebuild": "1.0.1"
});

Package.onUse(function (api) {
  api.versionsFrom("METEOR@1.0");
  api.use(["mongo-livedata", "webapp", "ejson", "promise@0.6.7"], "server");
  api.use("underscore", ["server", "client"]);
  api.use(["iron:router@0.9.4||1.0.0"], {weak: true});
  api.use("meteorhacks:picker@1.0.0", "server", {weak: true});

  api.addFiles([
    'server/createBinaries.js',
    'server/downloadUrls.js',
    'server/launchApp.js',
    'server/serve.js',
    'server/serveDownloadUrl.js',
    'server/serveUpdateFeed.js',
    // Must go last so that its dependencies have been defined.
    'server/index.js'
  ], 'server');

  var assets = [
    "app/autoUpdater.js",
    "app/main.js",
    "app/menu.js",
    "app/package.json",
    "app/preload.js",
    "app/proxyWindowEvents.js"
  ];

  // Use Meteor 1.2+ API, but fall back to the pre-1.2 API if necessary
  if (api.addAssets) {
    api.addAssets(assets, "server");
  } else {
    api.addFiles(assets, "server", {isAsset: true});
  }

  api.addFiles(['client/index.js'], "client");

  // Test exports.
  api.export([
    'parseMacDownloadUrl',
    'parseWindowsDownloadUrls'
  ], 'server', {
    testOnly: true
  });

  // Public exports.
  api.export("Electron", ["client"]);
});

Package.onTest(function(api) {
  api.use(['meson:electron', 'tinytest']);

  api.addFiles('tests/server/downloadUrlsTest.js', 'server');
});
<|endoftext|>


<commit_before>import React from 'react';

class TodosBody extends React.Component {
  static propsType = {
    todos: React.PropTypes.array.isRequired,
    removeTodo: React.PropTypes.func.isRequired,
    completeTodo: React.PropTypes.func.isRequired
  }

  render() {
    const todos = renderTodos(
      this.props.todos,
      this.props.removeTodo,
      this.props.completeTodo
    );

    return (

            {todos}

    );
  }
}

function renderTodos(todos: Array, removeTodo: Function, completeTodo: Function) {
  return todos.map((todo: Object, index) => {
    const text = todo.complete ? <s>{todo.text}</s> : {todo.text}

    return (

        {index + 1}
        {text}

          <button type='button' className='btn btn-xs btn-success' onClick={completeTodo.bind(null, index)}>

          </button>

          <button type='button' className='btn btn-xs btn-danger' onClick={removeTodo.bind(null, index)}>

          </button>

    );
  });
}

export default TodosBody;
<commit_msg>Update coding style<commit_after>import React from 'react';

class TodosBody extends React.Component {
  static propsType = {
    todos: React.PropTypes.array.isRequired,
    removeTodo: React.PropTypes.func.isRequired,
    completeTodo: React.PropTypes.func.isRequired
  }

  render() {
    const todos = renderTodos(
      this.props.todos,
      this.props.removeTodo,
      this.props.completeTodo
    );

    return (

            {todos}

    );
  }
}

function renderTodos(todos: Array, removeTodo: Function, completeTodo: Function) {
  return todos.map((todo: Object, index) => {
    const text = todo.complete ? <s>{todo.text}</s> : {todo.text};

    return (

        {index + 1}
        {text}

          <button type='button' className='btn btn-xs btn-success' onClick={completeTodo.bind(null, index)}>

          </button>

          <button type='button' className='btn btn-xs btn-danger' onClick={removeTodo.bind(null, index)}>

          </button>

    );
  });
}

export default TodosBody;
<|endoftext|>


<commit_before>Package.describe({
  name: 'hb5:drupal-ddp',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: '',
  // 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', ['client', 'server']);
  api.addFiles('server.js', ['server']);
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.addFiles('server.js', ['server']);
  api.addFiles('tests.js');
});
<commit_msg>Adding collections.js file to server and client<commit_after>Package.describe({
  name: 'hb5:drupal-ddp',
  version: '0.0.1',
  // Brief, one-line summary of the package.
  summary: '',
  // 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', ['client', 'server']);
  api.addFiles('collections.js', ['client', 'server']);
  api.addFiles('server.js', ['server']);
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.addFiles('server.js', ['server']);
  api.addFiles('tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'froala:editor-reactive',
  summary: 'A Meteor reactive template wrapper around Froala WYSIWYG HTML Rich Text Editor.',
  version: '2.0.0-rc.3',
  git: 'https://github.com/froala/froala-reactive.git'
});

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

  // Declare package dependencies
  api.use([
    'froala:editor@2.0.0-rc.3-1',
    'templating',
    'underscore'
    ], 'client');

  // package files
  api.addFiles([
    'froala-reactive.html',
    'froala-reactive.js'
    ], 'client');
});

<commit_msg>Update editor version.<commit_after>Package.describe({
  name: 'froala:editor-reactive',
  summary: 'A Meteor reactive template wrapper around Froala WYSIWYG HTML Rich Text Editor.',
  version: '2.0.0-rc.3',
  git: 'https://github.com/froala/froala-reactive.git'
});

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

  // Declare package dependencies
  api.use([
    'froala:editor@2.0.0-rc.3-2',
    'templating',
    'underscore'
    ], 'client');

  // package files
  api.addFiles([
    'froala-reactive.html',
    'froala-reactive.js'
    ], 'client');
});

<|endoftext|>


<commit_before>var assert = require('assert');
var http = require('http');
var zetta = require('../zetta');
var MemRegistry = require('./fixture/mem_registry');
var MemPeerRegistry = require('./fixture/mem_peer_registry');
var request = require('supertest');
var PeerRegistry = require('../lib/peer_registry');
var Query = require('calypso').Query;
var querystring = require('querystring');

function deleteRequest(port, connectionId) {
  var opts = {
    host: 'localhost',
    port: port,
    method: 'DELETE',
    path: '/peer-management/' + connectionId
  }

  var req = http.request(opts);
  req.end();
}

function putRequest(port, connectionId, url) {
  var qs = {
    url: url
  };
  var string = querystring.stringify(qs);
  var opts = {
    host: 'localhost',
    port: port,
    method: 'PUT',
    path: '/peer-management/' + connectionId,
    headers: {
      'Content-Length': string.length
    }
  };

  var req = http.request(opts);
  req.write(string);
  req.end();
}

function getHttpServer(app) {
  return app.httpServer.server;
}

function getBody(fn) {
  return function(res) {
    try {
      if(res.text) {
        var body = JSON.parse(res.text);
      } else {
        var body = '';
      }
    } catch(err) {
      throw new Error('Failed to parse json body');
    }

    fn(res, body);
  }
}

describe('Peer Connection API', function() {
  describe('/peer-management embedded entities', function() {
    var peerRegistry = null;
    var app = null;

    beforeEach(function(done) {
      peerRegistry = new MemPeerRegistry();
      app = zetta({ registry: new MemRegistry(), peerRegistry: peerRegistry })
        .silent()
        .name('local')
        ._run(done);
    });

    it('exposes actions on the embedded entity', function(done) {
      peerRegistry.save({id:'foo', connectionId:'12345'}, function() {
        var url = '/peer-management';
        request(getHttpServer(app))
          .get(url)
          .expect(getBody(function(res, body) {
            assert.equal(body.entities.length, 1);
            assert.equal(body.entities[0].actions.length, 2);
            body.entities[0].actions.forEach(function(action) {
              assert.ok(action.href.indexOf('/peer-management/12345') !== -1);
            })
           }))
           .end(done);
       });
    });

    it('exposes actions on the full entity', function(done) {
      peerRegistry.save({id:'foo', connectionId:'12345'}, function() {
        var url = '/peer-management/foo';
        request(getHttpServer(app))
          .get(url)
          .expect(getBody(function(res, body) {
            assert.equal(body.actions.length, 2);
            body.actions.forEach(function(action) {
              assert.ok(action.href.indexOf('/peer-management/12345') !== -1);
            });
           }))
           .end(done);
       });
    });
  });

  describe('/peer-management disconnection API', function() {
    var cloud = null;
    var cloudUrl = null;
    var cloudPort = null;
    var db1 = null;
    var db2 = null;

    beforeEach(function(done) {

      cloud = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      cloud.name('cloud');
      cloud.silent();

      cloud.listen(0, function(err) {
        if(err) {
          return done(err);
        }

        cloudPort = cloud.httpServer.server.address().port;
        cloudUrl = 'http://localhost:' + cloudPort;
        done();
      });
    });

    afterEach(function(done) {
      cloud.httpServer.server.close();
      done();
    });

    it('will return 404 if connection does not exist', function(done) {
      var url = '/peer-management/1234';
      request(getHttpServer(cloud))
        .del(url)
        .expect(404, done);
    });

    it('will proxy a disconnection between two peers', function(done) {
      //Had to increase the timeout. The standard two seconds may not be long enough for a connection to be established.
      this.timeout(10000);
      var connected = false;
      var z = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      z.name('local');
      var connectionId = null;

      z.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
        done();
      });

      cloud.pubsub.subscribe('_peer/connect', function(topic, data) {
        assert.equal(connected, true);
        connectionId = data.peer.connectionId;
        deleteRequest(cloudPort, connectionId);
      });
      z.pubsub.subscribe('_peer/connect', function(topic, data) {
        connected = true;
      });

      z.silent();
      z.link(cloudUrl);
      z.listen(0);

    });

    it('will disconnect two peers', function(done) {
      this.timeout(10000);
      var connected = false;
      var localPort = null;
      var z = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      z.name('local');

      var connectionId = null;

      z.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
        done();
      });

      cloud.pubsub.subscribe('_peer/connect', function(topic, data) {
        assert.equal(connected, true);
        connectionId = data.peer.connectionId;
        deleteRequest(localPort, connectionId);
      });

      z.pubsub.subscribe('_peer/connect', function(topic, data) {
        connected = true;
      });

      z.silent();
      z.link(cloudUrl);
      z.listen(0, function(err) {
        if(err) {
          done(err);
        }

        localPort = z.httpServer.server.address().port;
      });

    });
  });

  describe('/peer-management update API', function() {
    var cloud = null;
    var localOne = null;
    var cloudPort = null;
    var localOnePort = null;
    var connectionId = null;

    beforeEach(function(done) {
      this.timeout(10000);
      cloud = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      cloud.name('cloud');
      cloud.silent();

      localOne = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      localOne.name('localOne');
      localOne.silent();

      cloud.pubsub.subscribe('_peer/connect', function(topic, data) {
        connectionId = data.peer.connectionId;
        done();
      });

      cloud.listen(0, function(err) {
        if(err) {
          return done(err);
        }

        cloudPort = cloud.httpServer.server.address().port;
        var cloudUrl = 'http://localhost:' + cloudPort;

        localOne.link(cloudUrl);
        localOne.listen(0, function(err) {
          if(err) {
            done(err);
          }

          localPort = localOne.httpServer.server.address().port;
        });
      });
    });

    afterEach(function(done) {
      cloud.httpServer.server.close();
      localOne.httpServer.server.close();
      done();
    });

    it('will return 404 if connection does not exist', function(done) {
      var url = '/peer-management/1234';
      request(getHttpServer(cloud))
        .put(url)
        .set('Content-Type', 'application/x-www-form-urlencoded')
        .send({ url: 'http://localhost:1234' })
        .expect(404, done);
    });

    it('will proxy a connection update between two peers', function(done) {
      this.timeout(10000);
      var localTwoPort = null;
      var localTwo = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      localTwo.name('localTwo');
      localTwo.silent();

      var url = 'http://localhost:';

      cloud.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
      });

      localTwo.pubsub.subscribe('_peer/connect', function(topic, data) {
        done();
      });

      localTwo.listen(0, function(err) {
        if(err) {
          return done(err);
        }

        localTwoPort = localTwo.httpServer.server.address().port;
        var serverUrl = url + localTwoPort;
        putRequest(cloudPort, connectionId, serverUrl);
      });
    });

    it('will update a connection between two peers', function(done) {
      this.timeout(10000);
      var localTwoPort = null;
      var localTwo = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      localTwo.name('localTwo');
      localTwo.silent();

      var url = 'http://localhost:';

      cloud.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
      });

      localTwo.pubsub.subscribe('_peer/connect', function(topic, data) {
        done();
      });

      localTwo.listen(0, function(err) {
        if(err) {
          done(err);
        }

        localTwoPort = localTwo.httpServer.server.address().port;
        var serverUrl = url + localTwoPort;
        putRequest(localPort, connectionId, serverUrl);
      });
    });
  });
});
<commit_msg>Added test to check rels of connected peers.<commit_after>var assert = require('assert');
var http = require('http');
var zetta = require('../zetta');
var MemRegistry = require('./fixture/mem_registry');
var MemPeerRegistry = require('./fixture/mem_peer_registry');
var request = require('supertest');
var PeerRegistry = require('../lib/peer_registry');
var Query = require('calypso').Query;
var querystring = require('querystring');

function deleteRequest(port, connectionId) {
  var opts = {
    host: 'localhost',
    port: port,
    method: 'DELETE',
    path: '/peer-management/' + connectionId
  }

  var req = http.request(opts);
  req.end();
}

function putRequest(port, connectionId, url) {
  var qs = {
    url: url
  };
  var string = querystring.stringify(qs);
  var opts = {
    host: 'localhost',
    port: port,
    method: 'PUT',
    path: '/peer-management/' + connectionId,
    headers: {
      'Content-Length': string.length
    }
  };

  var req = http.request(opts);
  req.write(string);
  req.end();
}

function getHttpServer(app) {
  return app.httpServer.server;
}

function getBody(fn) {
  return function(res) {
    try {
      if(res.text) {
        var body = JSON.parse(res.text);
      } else {
        var body = '';
      }
    } catch(err) {
      throw new Error('Failed to parse json body');
    }

    fn(res, body);
  }
}

describe('Peer Connection API', function() {
  describe('/peer-management embedded entities', function() {
    var peerRegistry = null;
    var app = null;

    beforeEach(function(done) {
      peerRegistry = new MemPeerRegistry();
      app = zetta({ registry: new MemRegistry(), peerRegistry: peerRegistry })
        .silent()
        .name('local')
        ._run(done);
    });

    it('exposes actions on the embedded entity', function(done) {
      peerRegistry.save({id:'foo', connectionId:'12345'}, function() {
        var url = '/peer-management';
        request(getHttpServer(app))
          .get(url)
          .expect(getBody(function(res, body) {
            assert.equal(body.entities.length, 1);
            assert.equal(body.entities[0].actions.length, 2);
            body.entities[0].actions.forEach(function(action) {
              assert.ok(action.href.indexOf('/peer-management/12345') !== -1);
            })
           }))
           .end(done);
       });
    });

    it('exposes actions on the full entity', function(done) {
      peerRegistry.save({id:'foo', connectionId:'12345'}, function() {
        var url = '/peer-management/foo';
        request(getHttpServer(app))
          .get(url)
          .expect(getBody(function(res, body) {
            assert.equal(body.actions.length, 2);
            body.actions.forEach(function(action) {
              assert.ok(action.href.indexOf('/peer-management/12345') !== -1);
            });
           }))
           .end(done);
       });
    });
  });

  describe('Root API for peers', function() {
    var cloud = null;
    var cloudUrl = null;
    var cloudPort = null;
    var db1 = null;
    var db2 = null;

    beforeEach(function(done) {

      cloud = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      cloud.name('cloud');
      cloud.silent();

      cloud.listen(0, function(err) {
        if(err) {
          return done(err);
        }

        cloudPort = cloud.httpServer.server.address().port;
        cloudUrl = 'http://localhost:' + cloudPort;
        done();
      });
    });

    afterEach(function(done) {
      cloud.httpServer.server.close();
      done();
    });

    it('will have rel of server on peer', function(done) {
      this.timeout(10000);
      var connected = false;
      var z = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      z.name('local');

      cloud.pubsub.subscribe('_peer/connect', function(topic, data) {
        setImmediate(function() {
          var url = '/';
          request(getHttpServer(cloud))
            .get(url)
            .expect(getBody(function(res, body) {
              var peerLinks = body.links.filter(function(link) { return link.rel.indexOf('http://rels.zettajs.io/peer') !== -1; });
              var peerLink = peerLinks[0];
              assert.ok(peerLink.rel.indexOf('http://rels.zettajs.io/server') !== -1);
            }))
            .end(done);
        });
      });

      z.silent();
      z.link(cloudUrl);
      z.listen(0);

    });

  });

  describe('/peer-management disconnection API', function() {
    var cloud = null;
    var cloudUrl = null;
    var cloudPort = null;
    var db1 = null;
    var db2 = null;

    beforeEach(function(done) {

      cloud = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      cloud.name('cloud');
      cloud.silent();

      cloud.listen(0, function(err) {
        if(err) {
          return done(err);
        }

        cloudPort = cloud.httpServer.server.address().port;
        cloudUrl = 'http://localhost:' + cloudPort;
        done();
      });
    });

    afterEach(function(done) {
      cloud.httpServer.server.close();
      done();
    });

    it('will return 404 if connection does not exist', function(done) {
      var url = '/peer-management/1234';
      request(getHttpServer(cloud))
        .del(url)
        .expect(404, done);
    });

    it('will proxy a disconnection between two peers', function(done) {
      //Had to increase the timeout. The standard two seconds may not be long enough for a connection to be established.
      this.timeout(10000);
      var connected = false;
      var z = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      z.name('local');
      var connectionId = null;

      z.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
        done();
      });

      cloud.pubsub.subscribe('_peer/connect', function(topic, data) {
        assert.equal(connected, true);
        connectionId = data.peer.connectionId;
        deleteRequest(cloudPort, connectionId);
      });
      z.pubsub.subscribe('_peer/connect', function(topic, data) {
        connected = true;
      });

      z.silent();
      z.link(cloudUrl);
      z.listen(0);

    });

    it('will disconnect two peers', function(done) {
      this.timeout(10000);
      var connected = false;
      var localPort = null;
      var z = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      z.name('local');

      var connectionId = null;

      z.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
        done();
      });

      cloud.pubsub.subscribe('_peer/connect', function(topic, data) {
        assert.equal(connected, true);
        connectionId = data.peer.connectionId;
        deleteRequest(localPort, connectionId);
      });

      z.pubsub.subscribe('_peer/connect', function(topic, data) {
        connected = true;
      });

      z.silent();
      z.link(cloudUrl);
      z.listen(0, function(err) {
        if(err) {
          done(err);
        }

        localPort = z.httpServer.server.address().port;
      });

    });
  });

  describe('/peer-management update API', function() {
    var cloud = null;
    var localOne = null;
    var cloudPort = null;
    var localOnePort = null;
    var connectionId = null;

    beforeEach(function(done) {
      this.timeout(10000);
      cloud = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      cloud.name('cloud');
      cloud.silent();

      localOne = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      localOne.name('localOne');
      localOne.silent();

      cloud.pubsub.subscribe('_peer/connect', function(topic, data) {
        connectionId = data.peer.connectionId;
        done();
      });

      cloud.listen(0, function(err) {
        if(err) {
          return done(err);
        }

        cloudPort = cloud.httpServer.server.address().port;
        var cloudUrl = 'http://localhost:' + cloudPort;

        localOne.link(cloudUrl);
        localOne.listen(0, function(err) {
          if(err) {
            done(err);
          }

          localPort = localOne.httpServer.server.address().port;
        });
      });
    });

    afterEach(function(done) {
      cloud.httpServer.server.close();
      localOne.httpServer.server.close();
      done();
    });

    it('will return 404 if connection does not exist', function(done) {
      var url = '/peer-management/1234';
      request(getHttpServer(cloud))
        .put(url)
        .set('Content-Type', 'application/x-www-form-urlencoded')
        .send({ url: 'http://localhost:1234' })
        .expect(404, done);
    });

    it('will proxy a connection update between two peers', function(done) {
      this.timeout(10000);
      var localTwoPort = null;
      var localTwo = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      localTwo.name('localTwo');
      localTwo.silent();

      var url = 'http://localhost:';

      cloud.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
      });

      localTwo.pubsub.subscribe('_peer/connect', function(topic, data) {
        done();
      });

      localTwo.listen(0, function(err) {
        if(err) {
          return done(err);
        }

        localTwoPort = localTwo.httpServer.server.address().port;
        var serverUrl = url + localTwoPort;
        putRequest(cloudPort, connectionId, serverUrl);
      });
    });

    it('will update a connection between two peers', function(done) {
      this.timeout(10000);
      var localTwoPort = null;
      var localTwo = zetta({ registry: new MemRegistry(), peerRegistry: new MemPeerRegistry() });
      localTwo.name('localTwo');
      localTwo.silent();

      var url = 'http://localhost:';

      cloud.pubsub.subscribe('_peer/disconnect', function(topic, data) {
        assert.equal(connectionId, data.peer.connectionId);
      });

      localTwo.pubsub.subscribe('_peer/connect', function(topic, data) {
        done();
      });

      localTwo.listen(0, function(err) {
        if(err) {
          done(err);
        }

        localTwoPort = localTwo.httpServer.server.address().port;
        var serverUrl = url + localTwoPort;
        putRequest(localPort, connectionId, serverUrl);
      });
    });
  });
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Layout Manager for Meteor (designed for flow)',
  version: '1.0.0',
  git: 'https://github.com/meteorhacks/flow-layout',
  name: "meteorhacks:flow-layout"
});

Package.onUse(function (api) {
  configure(api);
  api.export(['FlowLayout']);
});

Package.onTest(function(api) {
  configure(api);
  api.use('tinytest');
  api.addFiles('tests/client/init.templates.html', 'client');
  api.addFiles('tests/client/init.templates.js', 'client');
  api.addFiles('tests/client/unit.js', 'client');
  api.addFiles('tests/client/integration.js', 'client');
});

function configure(api) {
  api.versionsFrom('METEOR@0.9.2');
  api.use('ui');
  api.use('templating');
  api.use('reactive-dict');
  api.use('underscore');

  api.addFiles('lib/client/namespace.js', 'client');
  api.addFiles('lib/client/root.html', 'client');
  api.addFiles('lib/client/layout.js', 'client');
}<commit_msg>version bumped<commit_after>Package.describe({
  summary: 'Layout Manager for Meteor (designed for flow)',
  version: '1.0.1',
  git: 'https://github.com/meteorhacks/flow-layout',
  name: "meteorhacks:flow-layout"
});

Package.onUse(function (api) {
  configure(api);
  api.export(['FlowLayout']);
});

Package.onTest(function(api) {
  configure(api);
  api.use('tinytest');
  api.addFiles('tests/client/init.templates.html', 'client');
  api.addFiles('tests/client/init.templates.js', 'client');
  api.addFiles('tests/client/unit.js', 'client');
  api.addFiles('tests/client/integration.js', 'client');
});

function configure(api) {
  api.versionsFrom('METEOR@0.9.2');
  api.use('ui');
  api.use('templating');
  api.use('reactive-dict');
  api.use('underscore');

  api.addFiles('lib/client/namespace.js', 'client');
  api.addFiles('lib/client/root.html', 'client');
  api.addFiles('lib/client/layout.js', 'client');
}
<|endoftext|>


<commit_before>Package.describe({
  name: 'silentcicero:solc',
  summary: 'The solc package provides a compiler build plugin for the Meteor build tool.',
  version: '0.2.1',
  git: 'http://github.com/SilentCicero/meteor-solc'
});

Package.registerBuildPlugin({
    name: "compileSol",
    use: [
        "silentcicero:solc-compiler@0.1.5-1"
    ],
    sources: [
        "plugin/handler.js",
    ]
});<commit_msg>New package<commit_after>Package.describe({
  name: 'silentcicero:solc',
  summary: 'The solc package provides a compiler build plugin for the Meteor build tool.',
  version: '0.2.2',
  git: 'http://github.com/SilentCicero/meteor-solc'
});

Package.registerBuildPlugin({
    name: "compileSol",
    use: [
        "silentcicero:solc-compiler@0.2.1"
    ],
    sources: [
        "plugin/handler.js",
    ]
});<|endoftext|>


<commit_before>Package.describe({
  summary: "Provides alertfy js with bootstrap 3 for meteor."
});

Package.on_use(function (api) {
  api.use('jquery');

  var path = Npm.require('path');
  var asset_path = path.join('aleritfy');
  api.add_files(path.join(asset_path, 'css', 'alertify.core.css'), 'client');
  api.add_files(path.join(asset_path, 'css', 'alertify.bootstrap3.css'), 'client');

  api.add_files(path.join(asset_path, 'js', 'alertify.min.js'), 'client');
});
<commit_msg>Spelling error<commit_after>Package.describe({
  summary: "Provides alertfy js with bootstrap 3 for meteor."
});

Package.on_use(function (api) {
  api.use('jquery');

  var path = Npm.require('path');
  var asset_path = path.join('alertify');
  api.add_files(path.join(asset_path, 'css', 'alertify.core.css'), 'client');
  api.add_files(path.join(asset_path, 'css', 'alertify.bootstrap3.css'), 'client');

  api.add_files(path.join(asset_path, 'js', 'alertify.min.js'), 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  name: "babrahams:transactions",
  summary: "Undo/Redo stack based on transactions",
  version: "0.6.4",
  git: "https://github.com/jackadams/meteor-transactions.git"
});

Package.onUse(function (api, where) {

  api.versionsFrom("1.0");

  api.use('jquery', 'client');
  api.use('tracker', 'client');
  api.use('minimongo', 'client');
  api.use('templating', 'client');
  api.use('spacebars', 'client');
  api.use('underscore');
  api.use('mongo');
  api.imply('mongo');
  api.use('dburles:mongo-collection-instances@0.2.6');

  api.add_files('lib/transactions_client.html', 'client');
  api.add_files('lib/transactions_client.js', 'client');
  api.add_files('lib/transactions_client.css', 'client');
  api.add_files('lib/transactions_server.js', 'server');
  api.add_files('lib/transactions_common.js', ['client','server']);

  if (api.export) {
    api.export('tx');
  }

});<commit_msg>Version bump<commit_after>Package.describe({
  name: "babrahams:transactions",
  summary: "Undo/Redo stack based on transactions",
  version: "0.6.5",
  git: "https://github.com/jackadams/meteor-transactions.git"
});

Package.onUse(function (api, where) {

  api.versionsFrom("1.0");

  api.use('jquery', 'client');
  api.use('tracker', 'client');
  api.use('minimongo', 'client');
  api.use('templating', 'client');
  api.use('spacebars', 'client');
  api.use('underscore');
  api.use('mongo');
  api.imply('mongo');
  api.use('dburles:mongo-collection-instances@0.2.6');

  api.add_files('lib/transactions_client.html', 'client');
  api.add_files('lib/transactions_client.js', 'client');
  api.add_files('lib/transactions_client.css', 'client');
  api.add_files('lib/transactions_server.js', 'server');
  api.add_files('lib/transactions_common.js', ['client','server']);

  if (api.export) {
    api.export('tx');
  }

});<|endoftext|>