<commit_before>DS.MockObject = Ember.Object.extend({
  init: function() {
    this.spyMeta = {};
  },

  spyOn: function(methodName) {
    var func = this[methodName],
        meta = this.spyMeta;

    if (func && func.isSpy) { return; }

    if (!func) {
      func = function() { };
    }

    this[methodName] = function() {
      var callCount = meta[methodName] || 0;

      meta[methodName] = ++callCount;

      return func.apply(this, arguments);
    };

    this[methodName].isSpy = true;
  },

  shouldHaveBeenCalled: function(methodName, times) {
    times = times === undefined ? 1 : times;

    equal(this.spyMeta[methodName], times, methodName+" was called "+times+ " times");
  }
});

DS.MockModel = DS.MockObject.extend({
  init: function() {
    this.resetEvents();

    return this._super();
  },

  send: function(event) {
    this.receivedEvents.push(event);
  },

  resetEvents: function() {
    this.receivedEvents = [];
  },

  didReceiveEvent: function(event) {
    return -1 !== this.receivedEvents.indexOf(event);
  },

  shouldHaveReceived: function() {
    var events = Array.prototype.slice.call(arguments);

    Ember.ArrayPolyfills.forEach.call(events, function(event) {
      ok(this.didReceiveEvent(event), "record received event "+event);
    }, this);
  },

  shouldNotHaveReceived: function() {
    var events = Array.prototype.slice.call(arguments);

    Ember.ArrayPolyfills.forEach.call(events, function(event) {
      ok(!this.didReceiveEvent(event), "record did not received event "+event);
    }, this);
  },

  becomeDirty: function(type) {
    this.get('transaction').recordBecameDirty(type, this);
  },

  eachAttribute: Ember.K,
  eachRelationshipChange: Ember.K,
  setupData: Ember.K
});

DS.MockModel.reopenClass({
  _create: function() {
    return this.create.apply(this, arguments);
  }
});

<commit_msg>Remove unused helper<commit_after><|endoftext|>


<commit_before>Package.describe({
  summary: 'Accounts Templates styled for Materialize Css.',
  version: '1.10.0',
  name: 'useraccounts:materialize',
  git: 'https://github.com/meteor-useraccounts/materialize.git',
});

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

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

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

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

  api.add_files([
    'lib/at_error.html',
    'lib/at_error.js',
    'lib/at_form.html',
    'lib/at_form.js',
    'lib/at_input.html',
    'lib/at_input.js',
    'lib/at_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_materialize.css',
  ], ['client']);
});

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

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

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

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

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

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

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

  api.add_files([
    'lib/at_error.html',
    'lib/at_error.js',
    'lib/at_form.html',
    'lib/at_form.js',
    'lib/at_input.html',
    'lib/at_input.js',
    'lib/at_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_materialize.css',
  ], ['client']);
});

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

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

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


<commit_before>/*
 * angular-error
 *
 * Captures errors and reports them back to a server for inspection
 *
 * (c) 2014 Wes Cruver
 * License: MIT
 */

(function() {

'use strict';

angular.module('cfp.error', [])

  /**
   * Decorate Angular's $exceptionHandler service to easily hook into the log
   * and post the error to an external service
   */
  .config(['$provide', function ($provide) {

    /**
     * Error object to standardize everything
     * @param  {[type]} exception [description]
     * @param  {[type]} cause     [description]
     * @param  {[type]} opts      [description]
     * @return {[type]}           [description]
     */
    function ErrorReport (exception, cause, opts) {
      this.exception = exception;
      this.cause = cause;
      this.opts = opts;
    }

    $provide.decorator('$exceptionHandler', ['$delegate', '$log', 'errorService', function ($delegate, $log, errorService) {

      return function (exception, cause) {
        var errorReport = new ErrorReport(exception, cause);
        errorService.post(errorReport);
        $log.error.apply($log, arguments);
      };

    }]);
  }])

  /**
   * This service handles the posting of errors, and can be decorated by devs
   * to customize the post payload
   */
  .provider('errorService', function() {

    this.postUri = null;
    this.throttle = 5000;

    /**
     * Keep a cache of recent errors so we can do things like debouncing and
     * aggregating errors into a single post
     *
     * @type {Array}
     */
    var errors = [];

    this.$get = ['$injector', function ($injector) {
      var $http, $q, $timeout;
      var isThrottled = false;

      var resolveDependencies = function() {
        $http = $http || $injector.get('$http');
        $q = $q || $injector.get('$q');
        $timeout = $timeout || $injector.get('$timeout');
      };

      return {
        post: function (errorReport) {
          var uri = this.postUri;
          resolveDependencies();
          errors.push(errorReport);

          if (isThrottled) {
            return;
          }

          $timeout(function(){
            $http.post(uri, errors);
            errors = [];
            isThrottled = false;
          }, this.throttle);

          isThrottled = true;

        },
        postUri: this.postUri,
        throttle: this.throttle
      };
    }];

  });
})();
<commit_msg>only add unique errors, and inc an error count<commit_after>/*
 * angular-error
 *
 * Captures errors and reports them back to a server for inspection
 *
 * (c) 2014 Wes Cruver
 * License: MIT
 */

(function() {

'use strict';

angular.module('cfp.error', [])

  /**
   * Decorate Angular's $exceptionHandler service to easily hook into the log
   * and post the error to an external service
   */
  .config(['$provide', function ($provide) {

    /**
     * Error object to standardize everything
     * @param  {[type]} exception [description]
     * @param  {[type]} cause     [description]
     * @param  {[type]} opts      [description]
     * @return {[type]}           [description]
     */
    function ErrorReport (exception, cause, ua) {
      this.exception = exception;
      this.cause = cause;
      this.ua = ua;
      this.count = 1;
    }

    $provide.decorator('$exceptionHandler', ['$delegate', '$log', '$window', 'errorService', function ($delegate, $log, $window, errorService) {

      return function (exception, cause) {
        var ua;

        if ($window.navigator && $window.navigator.userAgent) {
          ua = $window.navigator.userAgent;
        }

        var errorReport = new ErrorReport(exception, cause, ua);
        errorService.post(errorReport);
        $log.error.apply($log, arguments);
      };

    }]);
  }])

  /**
   * This service handles the posting of errors, and can be decorated by devs
   * to customize the post payload
   */
  .provider('errorService', function() {

    this.postUri = null;
    this.throttle = 5000;

    /**
     * Keep a cache of recent errors so we can do things like debouncing and
     * aggregating errors into a single post
     *
     * @type {Array}
     */
    var errors = [];

    this.$get = ['$injector', '$window', function ($injector, $window) {
      var $http, $q, $timeout;
      var isThrottled = false;

      var resolveDependencies = function() {
        $q       = $q       || $injector.get('$q');
        $http    = $http    || $injector.get('$http');
        $timeout = $timeout || $injector.get('$timeout');
      };

      /**
       * Only add unique errors.  any duplicates should iterate the errorCount property of the ErrorReport
       * @param  {ErrorReport} errorReport The error report
       */
      var pushError = function(errorReport) {
        var push = true;

        for (var i = 0; i < errors.length; i++) {
          // TODO: profile this:
          if (errorReport.exception.stack === errors[i].exception.stack) {
            push = false;
            errors[i].count++;
          }
        }

        if (push) {
          errors.push(errorReport);
        }

      };

      return {
        post: function (errorReport) {
          var uri = this.postUri;
          resolveDependencies();
          pushError(errorReport);
          // errors.push(errorReport);

          if (isThrottled) {
            return;
          }

          $timeout(function(){
            $http.post(uri, errors);
            errors = [];
            isThrottled = false;
          }, this.throttle);

          isThrottled = true;

        },
        postUri: this.postUri,
        throttle: this.throttle
      };
    }];

  });
})();
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Accounts Templates styled for Materialize Css.',
  version: '1.11.1',
  name: 'useraccounts:materialize',
  git: 'https://github.com/meteor-useraccounts/materialize.git',
});

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

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

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

  api.imply([
    'useraccounts:core@1.11.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_materialize.css',
  ], ['client']);
});

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

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

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

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

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

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

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

  api.add_files([
    'lib/at_error.html',
    'lib/at_error.js',
    'lib/at_form.html',
    'lib/at_form.js',
    'lib/at_input.html',
    'lib/at_input.js',
    'lib/at_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_materialize.css',
  ], ['client']);
});

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

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

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


<commit_before>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import LazyLoad from './lazy';
import { createComponent } from 'react-fela';
import { ContentLoaderStyles } from '../loader';

const containerStyle = ({
  ratio,
  width,
  minWidth,
  maxWidth,
  minHeight,
  maxHeight,
  rounded,
}) => ({
  position: 'relative',
  overflow: 'hidden',
  width,
  minWidth,
  maxWidth,
  minHeight,
  maxHeight,
  borderRadius: rounded && '50%',
  onBefore: {
    display: 'block',
    content: '""',
    width: '100%',
    paddingTop: `${ratio * 100}%`,
  },
  '> img': {
    center: true,
    borderRadius: rounded && '50%',
  },
});

const Container = createComponent(
  containerStyle,
  'div',
  ({ ratio, rounded, width, ...p }) => Object.keys(p)
);

const LazyContainer = createComponent(
  ({ visible, ...rest }) => ({
    ...containerStyle(rest),
    ...(!visible ? ContentLoaderStyles : {}),
  }),
  ({ onVisible, children, ...p }) =>
    (<LazyLoad {...p} onContentVisible={onVisible}>
      {children}
    </LazyLoad>),
  ({ ratio, rounded, visible, width, ...p }) => Object.keys(p)
);

class ImageContainer extends Component {
  state = { visible: false };

  render() {
    const {
      className,
      children,
      width,
      ratio,
      rounded,
      lazy,
      ...containerProps
    } = this.props;
    const { visible } = this.state;

    if (!lazy) {
      return (
        <Container
          {...containerProps}
          className={className}
          width={width}
          ratio={ratio}
          rounded={rounded}
        >
          {children}
        </Container>
      );
    }

    return (
      <LazyContainer
        {...containerProps}
        className={className}
        width={width}
        ratio={ratio}
        rounded={rounded}
        visible={visible}
        onVisible={() => this.setState({ visible: true })}
      >
        {children}
      </LazyContainer>
    );
  }
}
ImageContainer.displayName = 'Image.Container';
ImageContainer.propTypes = {
  width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
  ratio: PropTypes.number.isRequired,
  lazy: PropTypes.bool,
  rounded: PropTypes.bool,
};
ImageContainer.defaultProps = {
  lazy: true,
  rounded: false,
};
export default ImageContainer;
<commit_msg>fix images on IE and SSR<commit_after>import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { createComponent } from 'react-fela';
import LazyLoad from './lazy';
import { ContentLoaderStyles } from '../loader';

const containerStyle = ({
  ratio,
  width,
  minWidth,
  maxWidth,
  minHeight,
  maxHeight,
  rounded,
}) => ({
  position: 'relative',
  overflow: 'hidden',
  width,
  minWidth,
  maxWidth,
  minHeight,
  maxHeight,
  borderRadius: rounded && '50%',
  onBefore: {
    display: 'block',
    content: '""',
    width: '100%',
    paddingTop: `${ratio * 100}%`,
  },
  '> img': {
    center: true,
    borderRadius: rounded && '50%',
  },
});

const Container = createComponent(
  containerStyle,
  'div',
  ({ ratio, rounded, width, ...p }) => Object.keys(p)
);

const LazyContainer = createComponent(
  ({ visible, ...rest }) => ({
    ...containerStyle(rest),
    ...(!visible ? ContentLoaderStyles : {}),
  }),
  p => <LazyLoad {...p} />,
  ({ ratio, rounded, visible, width, ...p }) => Object.keys(p)
);

class ImageContainer extends Component {
  state = { visible: false, canHandleState: false };

  componentDidMount() {
    this.setState({ canHandleState: true });
  }

  render() {
    const {
      className,
      children,
      width,
      ratio,
      rounded,
      lazy,
      ...containerProps
    } = this.props;
    const { visible, canHandleState } = this.state;

    if (!canHandleState || !lazy) {
      return (
        <Container
          {...containerProps}
          className={className}
          width={width}
          ratio={ratio}
          rounded={rounded}
        >
          {children}
        </Container>
      );
    }

    return (
      <LazyContainer
        {...containerProps}
        className={className}
        width={width}
        ratio={ratio}
        rounded={rounded}
        visible={visible}
        onContentVisible={() => this.setState({ visible: true })}
      >
        {children}
      </LazyContainer>
    );
  }
}
ImageContainer.displayName = 'Image.Container';
ImageContainer.propTypes = {
  width: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
  ratio: PropTypes.number.isRequired,
  lazy: PropTypes.bool,
  rounded: PropTypes.bool,
};
ImageContainer.defaultProps = {
  lazy: true,
  rounded: false,
};
export default ImageContainer;
<|endoftext|>


<commit_before>Package.describe({
  name: 'electronifiejs:meteor-llog-bunyan',
  summary: "llog logging with bunyan support",
  version: "0.0.4",
  git: "https://github.com/electronifie/meteor-llog-bunyan.git"
});

Npm.depends({
  "llog": "0.0.11",
  "bunyan": "1.5.1"
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@0.9.0');
  api.addFiles('electronifie-llog-bunyan.js', 'server');
  api.addFiles('electronifie-llog-bunyan.js', 'client');
});
<commit_msg>Bump version to 0.0.5.<commit_after>Package.describe({
  name: 'electronifiejs:meteor-llog-bunyan',
  summary: "llog logging with bunyan support",
  version: "0.0.5",
  git: "https://github.com/electronifie/meteor-llog-bunyan.git"
});

Npm.depends({
  "llog": "0.0.11",
  "bunyan": "1.5.1"
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@0.9.0');
  api.addFiles('electronifie-llog-bunyan.js', 'server');
  api.addFiles('electronifie-llog-bunyan.js', 'client');
});
<|endoftext|>


<commit_before>var md5 = require("./md5.js"),
    color = require("onecolor");

var hsv2rgb = function(h, s, v) {
    return (new color.HSV(h/255, s/255 , v/255)).hex();
};

var getFrontColor = function(h, i) {
    i = i % 10;
    return hsv2rgb(h, 200 - i * 10, 120 + i);
};

var getBackColor = function(h) {
    return hsv2rgb(h, 200, 90);
};

var getAccentColor = function(h, i) {
    i = i % 5;
    return hsv2rgb(h, (i + 2) * 5, i * 5 + 220);
};

var createParams = function(title) {
    var hash = md5.md5(title);
    var p1 = title.length % 256;
    var p2 = parseInt(hash.slice(0, 2), 16);
    var p3 = parseInt(hash.slice(2, 4), 16);
    var p4 = parseInt(hash.slice(4, 6), 16);
    var p5 = parseInt(hash.slice(6, 8), 16);
    var p6 = parseInt(hash.slice(8, 10), 16);
    return [p1, p2, p3, p4, p5, p6];
};

exports.draw = function(canvas, title, brand) {
    title = title || "";
    brand = brand || "";
    params = createParams(title);
    var p1 = params[0];
    var p2 = params[1];
    var p3 = params[2];
    var p4 = params[3];
    var p5 = params[4];
    var p6 = params[5];

    var bright_style = canvas.createGradient({
        x1: 0, y1: 0,
        x2: 1200/2, y2: 630/3*2,
        c1: "rgba(255, 255, 255, 0.1)", s1: 0.43,
        c2: "rgba(255, 255, 255, 0.2)", s2: 0.97
    });

    canvas.clearCanvas();
    var h = p1 * 7 % 256;

    // Background
    canvas.drawRect({
        fillStyle: getBackColor(h),
        x: 1200/2, y: 630/2,
        width: 1200,
        height: 630,
        cornerRadius: 5,
        mask: true,
    });

    // Small Bubbles
    var bubble_count = (p1 + p2 + p3) % 50 + 80;
    for (var i =1; i < bubble_count; i++) {
        var x = ((i + p1) * (i + p4)) % 1200;
        var y = ((i + p2) * (i + p5)) % 630;
        var box_size = (630 - y)/8 - i/10;
        canvas.drawRect({
            fillStyle: getFrontColor(h, i),
            x: x, y: y,
            width: box_size,
            height:box_size,
            cornerRadius: 50
        });
    }

    // Large Bubbles
    var large_bubble_count = (p1 + p2 + p3) % 2 + 3;
    for (var i =1; i <= large_bubble_count; i++) {
        var x = (i * (300 + p4 - p5) + i * p2) % (1200 - 100) + 50;
        var y = ((i + p4) * (i + p2)) % (630 - 50);
        var box_size = (630 - y + 100) / 2;
        canvas.drawRect({
            fillStyle: getAccentColor(h, i),
            x:x, y:y,
            width: box_size,
            height: box_size,
            cornerRadius: 415
        });
    }

    // Title background
    canvas.drawRect({
        fillStyle: "rgba(0, 0, 0, 0.8)",
        x: 1200/2,
        y: 630 - 70,
        width: 1200,
        height: 140
    });

    // Brand
    canvas.drawText({
        fillStyle: "#ffffff",
        x: 1200/2,
        y: (630 - 140)/2,
	shadowColor: getBackColor(h),
  	shadowBlur: 8,
	shadowX: 5, shadowY: 5,
        fontSize: 180,
        fontFamily: '"Noto Sans CJK JP Black"',
        text: brand,
    });
    // Title
    canvas.drawText({
        fillStyle: "#ffffff",
        x: 1200/2,
        y: 630 - 70,
        fontSize: 1200 / (title.length + 10),
        fontFamily: '"Noto Sans CJK JP Black"',
        text: title,
    });

    // hashtag
    canvas.drawText({
        fillStyle: "#ffffff",
        x: 1200 - 40,
        y: 630 - 10,
        fontSize: 12,
        fontFamily: '"Noto Sans CJK JP Black"',
        text: "#unique_ogp",
    });

    //Brightness
    canvas.drawPath({
        fillStyle: bright_style,
        strokeWidth: 0,
        p1: {
            type: 'line',
            x1: 0, y1: 0,
            x2: 0, y2:630 - 50,
        },
        p2: {
            type: 'quadratic',
            cx1: 1200/2, cy1: 120,
            x2: 1200, y2: 80
        },
        p3: {
            type: 'line',
            x1: 1200, y1: 80,
            x2: 1200, y2: 0,
            x3: 0, y3: 0
        }
    });

    return canvas;
};
<commit_msg>Optimize font<commit_after>var md5 = require("./md5.js"),
    color = require("onecolor");

var hsv2rgb = function(h, s, v) {
    return (new color.HSV(h/255, s/255 , v/255)).hex();
};

var getFrontColor = function(h, i) {
    i = i % 10;
    return hsv2rgb(h, 200 - i * 10, 120 + i);
};

var getBackColor = function(h) {
    return hsv2rgb(h, 200, 90);
};

var getAccentColor = function(h, i) {
    i = i % 5;
    return hsv2rgb(h, (i + 2) * 5, i * 5 + 220);
};

var createParams = function(title) {
    var hash = md5.md5(title);
    var p1 = title.length % 256;
    var p2 = parseInt(hash.slice(0, 2), 16);
    var p3 = parseInt(hash.slice(2, 4), 16);
    var p4 = parseInt(hash.slice(4, 6), 16);
    var p5 = parseInt(hash.slice(6, 8), 16);
    var p6 = parseInt(hash.slice(8, 10), 16);
    return [p1, p2, p3, p4, p5, p6];
};

var charcount = function(str){
  len = 0;
  str = escape(str);
  for (i=0; i<str.length; i++, len++) {
    if (str.charAt(i) == "%") {
      if (str.charAt(++i) == "u") {
        i += 3;
        len++;
      }
      i++;
    }
  }
  return len;
}

exports.draw = function(canvas, title, brand) {
    title = title || "";
    brand = brand || "";
    params = createParams(title);
    var p1 = params[0];
    var p2 = params[1];
    var p3 = params[2];
    var p4 = params[3];
    var p5 = params[4];
    var p6 = params[5];

    var bright_style = canvas.createGradient({
        x1: 0, y1: 0,
        x2: 1200/2, y2: 630/3*2,
        c1: "rgba(255, 255, 255, 0.1)", s1: 0.43,
        c2: "rgba(255, 255, 255, 0.2)", s2: 0.97
    });

    canvas.clearCanvas();
    var h = (p3 + (p1 + p2) * 7) % 256;

    // Background
    canvas.drawRect({
        fillStyle: getBackColor(h),
        x: 1200/2, y: 630/2,
        width: 1200,
        height: 630,
        cornerRadius: 5,
        mask: true,
    });

    // Small Bubbles
    var bubble_count = (p1 + p2 + p3) % 50 + 80;
    for (var i =1; i < bubble_count; i++) {
        var x = ((i + p1) * (i + p4)) % 1200;
        var y = ((i + p2) * (i + p5)) % 630;
        var box_size = (630 - y)/8 - i/10;
        canvas.drawRect({
            fillStyle: getFrontColor(h, i),
            x: x, y: y,
            width: box_size,
            height:box_size,
            cornerRadius: 50
        });
    }

    // Large Bubbles
    var large_bubble_count = (p1 + p2 + p3) % 2 + 3;
    for (var i =1; i <= large_bubble_count; i++) {
        var x = (i * (300 + p4 - p5) + i * p2) % (1200 - 100) + 50;
        var y = ((i + p4) * (i + p2)) % (630 - 50);
        var box_size = (630 - y + 100) / 2;
        canvas.drawRect({
            fillStyle: getAccentColor(h, i),
            x:x, y:y,
            width: box_size,
            height: box_size,
            cornerRadius: 415
        });
    }

    // Title background
    canvas.drawRect({
        fillStyle: "rgba(0, 0, 0, 0.8)",
        x: 1200/2,
        y: 630 - 70,
        width: 1200,
        height: 140
    });

    // Brand
    canvas.drawText({
        fillStyle: "#ffffff",
        x: 1200/2,
        y: (630 - 140)/2,
	shadowColor: getBackColor(h),
  	shadowBlur: 5,
	shadowX: 3, shadowY: 3,
        fontSize: (1200 - 100) / (charcount(brand)/2 + 2),
        fontFamily: "'Noto Sans CJK JP Black', 'Noto Sans Japanese'",
        fontWeight: 900,
        text: brand,
    });
    // Title
    canvas.drawText({
        fillStyle: "#ffffff",
        x: 1200/2,
        y: 630 - 70,
        fontSize: (1200 - 50) / (charcount(title)/2 + 10),
        fontFamily: "'Noto Sans CJK JP Black', 'Noto Sans Japanese'",
        fontWeight: 900,
        text: title,
    });

    // hashtag
    canvas.drawText({
        fillStyle: "#ffffff",
        x: 1200 - 50,
        y: 630 - 10,
        fontSize: 12,
        fontFamily: "'Noto Sans CJK JP Black', 'Noto Sans Japanese'",
        text: "#unique_ogp",
    });

    //Brightness
    canvas.drawPath({
        fillStyle: bright_style,
        strokeWidth: 0,
        p1: {
            type: 'line',
            x1: 0, y1: 0,
            x2: 0, y2:630 - 50,
        },
        p2: {
            type: 'quadratic',
            cx1: 1200/2, cy1: 120,
            x2: 1200, y2: 80
        },
        p3: {
            type: 'line',
            x1: 1200, y1: 80,
            x2: 1200, y2: 0,
            x3: 0, y3: 0
        }
    });

    return canvas;
};
<|endoftext|>


<commit_before>Package.describe({
    name: 'cenk:useraccounts-password-strength',
    version: '0.0.1',
    summary: 'This package allows you to set strong passwords for your meteor-useraccounts enabled meteor application. Also places a strength indicator.',
    git: 'https://github.com/cdolek/useraccounts-password-strength',
    documentation: 'README.md'
});

Package.onUse(function(api) {
    api.versionsFrom('1.3.2.4');
    api.use('ecmascript');
    api.use(['useraccounts:bootstrap', 'accounts-password', 'check']);
    api.use(['templating'], 'client');
    api.addFiles([
        'atTextInputWithPasswordStrength.css',
        'atTextInputWithPasswordStrength.html',
        'atTextInputWithPasswordStrength.js'
    ], 'client');
    api.mainModule('useraccounts-password-strength.js');
});

Package.onTest(function(api) {
    api.use('ecmascript');
    api.use('tinytest');
    // api.use('cenk:useraccounts-password-strength');
    api.mainModule('useraccounts-password-strength-tests.js');
});
<commit_msg>Shorter package summary<commit_after>Package.describe({
    name: 'cenk:useraccounts-password-strength',
    version: '0.0.1',
    summary: 'Allows you to set strong passwords for your meteor-useraccounts enabled application.',
    git: 'https://github.com/cdolek/useraccounts-password-strength',
    documentation: 'README.md'
});

Package.onUse(function(api) {
    api.versionsFrom('1.3.2.4');
    api.use('ecmascript');
    api.use(['useraccounts:bootstrap', 'accounts-password', 'check']);
    api.use(['templating'], 'client');
    api.addFiles([
        'atTextInputWithPasswordStrength.css',
        'atTextInputWithPasswordStrength.html',
        'atTextInputWithPasswordStrength.js'
    ], 'client');
    api.mainModule('useraccounts-password-strength.js');
});

Package.onTest(function(api) {
    api.use('ecmascript');
    api.use('tinytest');
    // api.use('cenk:useraccounts-password-strength');
    api.mainModule('useraccounts-password-strength-tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  name: "yogiben:autoform-file",
  summary: "File upload for AutoForm",
  description: "File upload for AutoForm",
  version: "0.2.5",
  git: "http://github.com/yogiben/autoform-file.git"
});

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

  api.use(
    [
    'coffeescript',
    'underscore',
    'templating',
    'less',
    'aldeed:autoform@4.2.2 || 5.1.2'
    ],
    'client');

  api.addFiles('lib/client/autoform-file.html', 'client');
  api.addFiles('lib/client/autoform-file.less', 'client');
  api.addFiles('lib/client/autoform-file.coffee', 'client');
});
<commit_msg>Support autoform 5.x<commit_after>Package.describe({
  name: "yogiben:autoform-file",
  summary: "File upload for AutoForm",
  description: "File upload for AutoForm",
  version: "0.2.5",
  git: "http://github.com/yogiben/autoform-file.git"
});

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

  api.use(
    [
    'coffeescript',
    'underscore',
    'templating',
    'less',
    'aldeed:autoform@4.2.2 || 5.1.2',
    'fortawesome:fontawesome'
    ],
    'client');

  api.addFiles('lib/client/autoform-file.html', 'client');
  api.addFiles('lib/client/autoform-file.less', 'client');
  api.addFiles('lib/client/autoform-file.coffee', 'client');
});
<|endoftext|>


<commit_before>/**
 * Copyright (c) 2016-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @flow
 */
/* global child_process$spawnOpts */

import * as constants from "../constants.js";
import BlockingQueue from "./blocking-queue.js";
import { promisify } from "./promise.js";

let child = require("child_process");

export let exec = promisify(child.exec);

export let queue = new BlockingQueue("child", constants.CHILD_CONCURRENCY);

// TODO: this uid check is kinda whack
let uid = 0;

export function spawn(
  program: string,
  args: Array<string>,
  opts?: child_process$spawnOpts = {}
): Promise<string> {
  return queue.push(opts.cwd || String(++uid), () => new Promise((resolve, reject) => {
    let proc = child.spawn(program, args, opts);

    let processingDone = false;
    let processClosed = false;
    let err = null;

    let errBuf = "";
    let buf = "";

    proc.on("error", reject);

    proc.stderr.on("data", (chunk) => {
      errBuf += chunk;
    });

    function update(chunk) {
      buf += chunk;
    }

    function finish() {
      if (err) {
        reject(err);
      } else {
        resolve(buf.trim());
      }
    }

    if (opts.process) {
      opts.process(proc, update, reject, function () {
        if (processClosed) {
          finish();
        } else {
          processingDone = true;
        }
      });
    } else {
      proc.stdout.on("data", update);
      processingDone = true;
    }

    proc.on("close", (code) => {
      if (code >= 1) {
        if (!errBuf) errBuf = `Process exited with code ${code}`;

        let cmd = JSON.stringify(`${program} ${args.join(" ")}`);
        err = new Error(`${cmd}@${opts.cwd || process.cwd()}: ${errBuf.trim()}`);
      }

      if (processingDone || err) {
        finish();
      } else {
        processClosed = true;
      }
    });
  }));
}
<commit_msg>nice error messages when we attempt to spawn binaries we don't have - fixes #27<commit_after>/**
 * Copyright (c) 2016-present, Facebook, Inc.
 * All rights reserved.
 *
 * This source code is licensed under the BSD-style license found in the
 * LICENSE file in the root directory of this source tree. An additional grant
 * of patent rights can be found in the PATENTS file in the same directory.
 *
 * @flow
 */
/* global child_process$spawnOpts */

import * as constants from "../constants.js";
import BlockingQueue from "./blocking-queue.js";
import { promisify } from "./promise.js";

let child = require("child_process");

export let exec = promisify(child.exec);

export let queue = new BlockingQueue("child", constants.CHILD_CONCURRENCY);

// TODO: this uid check is kinda whack
let uid = 0;

export function spawn(
  program: string,
  args: Array<string>,
  opts?: child_process$spawnOpts = {}
): Promise<string> {
  return queue.push(opts.cwd || String(++uid), () => new Promise((resolve, reject) => {
    let proc = child.spawn(program, args, opts);

    let processingDone = false;
    let processClosed = false;
    let err = null;

    let errBuf = "";
    let buf = "";

    proc.on("error", (err) => {
      if (err.code === "ENOENT") {
        reject(new MessageError(`Couldn't find the binary ${program}`));
      } else {
        reject(err);
      }
    });

    proc.stderr.on("data", (chunk) => {
      errBuf += chunk;
    });

    function update(chunk) {
      buf += chunk;
    }

    function finish() {
      if (err) {
        reject(err);
      } else {
        resolve(buf.trim());
      }
    }

    if (opts.process) {
      opts.process(proc, update, reject, function () {
        if (processClosed) {
          finish();
        } else {
          processingDone = true;
        }
      });
    } else {
      proc.stdout.on("data", update);
      processingDone = true;
    }

    proc.on("close", (code) => {
      if (code >= 1) {
        if (!errBuf) errBuf = `Process exited with code ${code}`;

        let cmd = JSON.stringify(`${program} ${args.join(" ")}`);
        err = new Error(`${cmd}@${opts.cwd || process.cwd()}: ${errBuf.trim()}`);
      }

      if (processingDone || err) {
        finish();
      } else {
        processClosed = true;
      }
    });
  }));
}
<|endoftext|>


<commit_before>Package.describe({
  summary: 'BDD testing APIs for the space:event-sourcing package',
  name: 'space:testing-event-sourcing',
  version: '0.1.0',
  git: 'https://github.com/meteor-space/testing-event-sourcing.git',
  debugOnly: true
});

Package.onUse(function(api) {

  api.versionsFrom('1.2.0.1');

  api.use([
    'coffeescript',
    'underscore',
    'space:base@4.0.0',
    'practicalmeteor:munit@2.1.5'
  ]);

  api.addFiles([
    'source/allow-to-ignore-some-struct-types.js',
    'source/aggregates-bdd-api.coffee'
  ], 'server');

});

Package.onTest(function(api) {

  api.use([
    'coffeescript',
    'check',
    'space:base@4.0.0',
    'space:testing@3.0.1',
    'practicalmeteor:munit@2.1.5'
  ]);

  api.addFiles([
  ], 'server');

});
<commit_msg>Fix package version<commit_after>Package.describe({
  summary: 'BDD testing APIs for the space:event-sourcing package',
  name: 'space:testing-event-sourcing',
  version: '3.0.0',
  git: 'https://github.com/meteor-space/testing-event-sourcing.git',
  debugOnly: true
});

Package.onUse(function(api) {

  api.versionsFrom('1.2.0.1');

  api.use([
    'coffeescript',
    'underscore',
    'space:base@4.0.0',
    'practicalmeteor:munit@2.1.5'
  ]);

  api.addFiles([
    'source/allow-to-ignore-some-struct-types.js',
    'source/aggregates-bdd-api.coffee'
  ], 'server');

});

Package.onTest(function(api) {

  api.use([
    'coffeescript',
    'check',
    'space:base@4.0.0',
    'space:testing@3.0.1',
    'practicalmeteor:munit@2.1.5'
  ]);

  api.addFiles([
  ], 'server');

});
<|endoftext|>


<commit_before>import Pica from 'pica'
import {maxUploadPicSize} from '@/../config'

export * from '@/util/filters'

export const prepareFolderData = (topItem, inputData) => {
  if (typeof inputData !== 'object' || inputData.length === 0) return [topItem]

  let rootItem = JSON.parse(JSON.stringify(topItem)) // deep copy
  rootItem.children = []

  let itemMap = new Map()
  itemMap.set(topItem.id, rootItem)

  let maxLevel = 0
  let levelMap = new Map()

  inputData.forEach(item => {
    const curLevel = item.ancestor_ids.length
    maxLevel = Math.max(curLevel, maxLevel)
    itemMap.set(item._id, {
      id: item._id,
      label: item.name,
      ancestor_ids: item.ancestor_ids,
      children: []
    })
    let levelItem = {itemId: item._id, parentId: item.parent_id}
    if (levelMap.has(curLevel)) {
      levelMap.get(curLevel).push(levelItem)
    } else {
      levelMap.set(curLevel, [levelItem])
    }
  })
  // console.log(itemMap)
  // console.log('maxLevel is: ' + maxLevel)
  // console.log(levelMap)

  for (let i = maxLevel; i > 0; i--) {
    if (!levelMap.has(i)) continue
    let levelItems = levelMap.get(i)
    levelItems.forEach(item => {
      if (itemMap.has(item.parentId) && itemMap.has(item.itemId)) {
        itemMap.get(item.parentId).children.push(itemMap.get(item.itemId))
      }
    })
  }

  return [itemMap.get(topItem.id)]
}

const getImgObj = (url) => {
  return new Promise((resolve, reject) => {
    var img = new Image()
    img.src = url
    img.onload = () => {
      resolve(img)
    }
    img.onerror = (err) => {
      reject(err)
    }
  })
}

const pica = new Pica()

export const getResizedImgData = async (origImgData) => {
  const MAX_SIZE = maxUploadPicSize
  let ret = origImgData
  let origImgObj = await getImgObj(origImgData)
  console.log('original img width: ' + origImgObj.width + ', height: ' + origImgObj.height)

  if (origImgObj.width > MAX_SIZE || origImgObj.height > MAX_SIZE) {
    // calculate resized width & height
    let resizedWidth = origImgObj.width
    let resizedHeight = origImgObj.height
    if (resizedHeight > resizedWidth) {
      resizedHeight = Math.min(resizedHeight, MAX_SIZE)
      resizedWidth = resizedHeight * (origImgObj.width / origImgObj.height)
    } else {
      resizedWidth = Math.min(resizedWidth, MAX_SIZE)
      resizedHeight = resizedWidth * (origImgObj.height / origImgObj.width)
    }
    console.log('resized img width: ' + resizedWidth + ', height: ' + resizedHeight)

    let resizedCanvas = document.createElement('canvas')
    resizedCanvas.width = resizedWidth
    resizedCanvas.height = resizedHeight

    let result = await pica.resize(origImgObj, resizedCanvas)
    ret = result.toDataURL('image/jpeg')
  }

  return ret
}

export const getCurUsrId = () => { return window.localStorage.getItem('hn-user') }

export const getCurUsrRootFolderId = () => { return window.localStorage.getItem('hn-user') + '-Root' }

export const getCurUsrRecentFolderId = () => { return window.localStorage.getItem('hn-user') + '-Recent' }

export const getCurUsrStarFolderId = () => { return window.localStorage.getItem('hn-user') + '-Starred' }

export const getCurUsrTrashFolderId = () => { return window.localStorage.getItem('hn-user') + '-Trash' }
<commit_msg>workaround for issue: Unexpected token: name (finish) [./~/pica/lib/mathlib.js<commit_after>// import Pica from 'pica'
import Pica from './../../node_modules/pica/dist/pica.min'
import {maxUploadPicSize} from '@/../config'

export * from '@/util/filters'

export const prepareFolderData = (topItem, inputData) => {
  if (typeof inputData !== 'object' || inputData.length === 0) return [topItem]

  let rootItem = JSON.parse(JSON.stringify(topItem)) // deep copy
  rootItem.children = []

  let itemMap = new Map()
  itemMap.set(topItem.id, rootItem)

  let maxLevel = 0
  let levelMap = new Map()

  inputData.forEach(item => {
    const curLevel = item.ancestor_ids.length
    maxLevel = Math.max(curLevel, maxLevel)
    itemMap.set(item._id, {
      id: item._id,
      label: item.name,
      ancestor_ids: item.ancestor_ids,
      children: []
    })
    let levelItem = {itemId: item._id, parentId: item.parent_id}
    if (levelMap.has(curLevel)) {
      levelMap.get(curLevel).push(levelItem)
    } else {
      levelMap.set(curLevel, [levelItem])
    }
  })
  // console.log(itemMap)
  // console.log('maxLevel is: ' + maxLevel)
  // console.log(levelMap)

  for (let i = maxLevel; i > 0; i--) {
    if (!levelMap.has(i)) continue
    let levelItems = levelMap.get(i)
    levelItems.forEach(item => {
      if (itemMap.has(item.parentId) && itemMap.has(item.itemId)) {
        itemMap.get(item.parentId).children.push(itemMap.get(item.itemId))
      }
    })
  }

  return [itemMap.get(topItem.id)]
}

const getImgObj = (url) => {
  return new Promise((resolve, reject) => {
    var img = new Image()
    img.src = url
    img.onload = () => {
      resolve(img)
    }
    img.onerror = (err) => {
      reject(err)
    }
  })
}

const pica = new Pica()

export const getResizedImgData = async (origImgData) => {
  const MAX_SIZE = maxUploadPicSize
  let ret = origImgData
  let origImgObj = await getImgObj(origImgData)
  console.log('original img width: ' + origImgObj.width + ', height: ' + origImgObj.height)

  if (origImgObj.width > MAX_SIZE || origImgObj.height > MAX_SIZE) {
    // calculate resized width & height
    let resizedWidth = origImgObj.width
    let resizedHeight = origImgObj.height
    if (resizedHeight > resizedWidth) {
      resizedHeight = Math.min(resizedHeight, MAX_SIZE)
      resizedWidth = resizedHeight * (origImgObj.width / origImgObj.height)
    } else {
      resizedWidth = Math.min(resizedWidth, MAX_SIZE)
      resizedHeight = resizedWidth * (origImgObj.height / origImgObj.width)
    }
    console.log('resized img width: ' + resizedWidth + ', height: ' + resizedHeight)

    let resizedCanvas = document.createElement('canvas')
    resizedCanvas.width = resizedWidth
    resizedCanvas.height = resizedHeight

    let result = await pica.resize(origImgObj, resizedCanvas)
    ret = result.toDataURL('image/jpeg')
  }

  return ret
}

export const getCurUsrId = () => { return window.localStorage.getItem('hn-user') }

export const getCurUsrRootFolderId = () => { return window.localStorage.getItem('hn-user') + '-Root' }

export const getCurUsrRecentFolderId = () => { return window.localStorage.getItem('hn-user') + '-Recent' }

export const getCurUsrStarFolderId = () => { return window.localStorage.getItem('hn-user') + '-Starred' }

export const getCurUsrTrashFolderId = () => { return window.localStorage.getItem('hn-user') + '-Trash' }
<|endoftext|>


<commit_before>Package.describe({
  "summary": "Clustering solution for Meteor with load balancing and service discovery.",
  "version": "1.1.0",
  "git": "https://github.com/meteorhacks/cluster.git",
  "name": "meteorhacks:cluster"
});

Npm.depends({
  "cookies": "0.5.0",
  "http-proxy": "1.8.1"
});

Package.onTest(function(api) {
  configurePackage(api);
  api.use('tinytest');
  api.use('practicalmeteor:sinon@1.10.3_2');

  api.addFiles([
    'tests/server/utils.js',
    'tests/server/discovery_backends/mongo/store.js',
    'tests/server/discovery_backends/mongo/discovery.js',
    'tests/server/balancer_private.js',
    'tests/server/balancer_public.js',
  ], 'server');
});

Package.onUse(function(api) {
  configurePackage(api);
  api.export('Cluster');
});

function configurePackage(api) {
  api.versionsFrom('METEOR@0.9.2');
  api.use(['webapp'], 'server');
  api.use([
    'mongo-livedata', 'tracker', 'ddp', 'minimongo',
    'underscore'
  ], ['server', 'client']);

  api.addFiles([
    'lib/namespace.js',
    'lib/proxy_connection.js',
  ], ['server', 'client']);

  api.addFiles([
    'lib/server/api.js',
    'lib/server/discovery_backends/mongo/store.js',
    'lib/server/discovery_backends/mongo/discovery.js',
    'lib/server/utils.js',
    'lib/server/balancer.js',
    'lib/server/auto_connect.js'
  ], ['server']);

  api.addFiles([
    'lib/client/api.js'
  ], ['client']);
}
<commit_msg>version bumped<commit_after>Package.describe({
  "summary": "Clustering solution for Meteor with load balancing and service discovery.",
  "version": "1.2.0",
  "git": "https://github.com/meteorhacks/cluster.git",
  "name": "meteorhacks:cluster"
});

Npm.depends({
  "cookies": "0.5.0",
  "http-proxy": "1.8.1"
});

Package.onTest(function(api) {
  configurePackage(api);
  api.use('tinytest');
  api.use('practicalmeteor:sinon@1.10.3_2');

  api.addFiles([
    'tests/server/utils.js',
    'tests/server/discovery_backends/mongo/store.js',
    'tests/server/discovery_backends/mongo/discovery.js',
    'tests/server/balancer_private.js',
    'tests/server/balancer_public.js',
  ], 'server');
});

Package.onUse(function(api) {
  configurePackage(api);
  api.export('Cluster');
});

function configurePackage(api) {
  api.versionsFrom('METEOR@0.9.2');
  api.use(['webapp'], 'server');
  api.use([
    'mongo-livedata', 'tracker', 'ddp', 'minimongo',
    'underscore'
  ], ['server', 'client']);

  api.addFiles([
    'lib/namespace.js',
    'lib/proxy_connection.js',
  ], ['server', 'client']);

  api.addFiles([
    'lib/server/api.js',
    'lib/server/discovery_backends/mongo/store.js',
    'lib/server/discovery_backends/mongo/discovery.js',
    'lib/server/utils.js',
    'lib/server/balancer.js',
    'lib/server/auto_connect.js'
  ], ['server']);

  api.addFiles([
    'lib/client/api.js'
  ], ['client']);
}
<|endoftext|>


<commit_before>Package.describe({
    summary: "Make signin and signout their own pages with routes."
});

Package.on_use(function(api) {

  // CLIENT
  api.use([
    'deps',
    'service-configuration',
    'accounts-base',
    'underscore',
    'templating',
    'handlebars',
    'session',
    'coffeescript',
    'less']
  , 'client');

  api.add_files([
    'client/entry.coffee',
    'client/entry.less',
    'client/helpers.coffee',
    'client/views/signIn/signIn.html',
    'client/views/signIn/signIn.coffee',
    'client/views/signUp/signUp.html',
    'client/views/signUp/signUp.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/social/social.html',
    'client/views/social/social.coffee',
    'client/views/error/error.html',
    'client/views/error/error.coffee',
    'client/views/accountButtons/accountButtons.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/views/accountButtons/_wrapLinks.html',
    'client/t9n/english.coffee',
    'client/t9n/german.coffee',
    'client/t9n/spanish.coffee'
  ], 'client');

  // SERVER
  api.use([
    'deps',
    'service-configuration',
    'accounts-password',
    'accounts-base',
    'underscore',
    'coffeescript'
  ], 'server');

  api.add_files(['server/entry.coffee'], 'server');

  // CLIENT and SERVER
  api.imply('accounts-base', ['client', 'server']);
  api.export('AccountsEntry', ['client', 'server']);
  api.use('iron-router', ['client', 'server']);
  api.use(['accounts-t9n'], ['client', 'server']);
  api.add_files(['shared/router.coffee'], ['client', 'server']);

});

Package.on_test(function (api) {
  api.use(['tinytest',
            'handlebars',
            'test-helpers',
            'templating',
            'mongo-livedata',
            'coffeescript',
            'iron-router'])
  api.use('accounts-entry')

  api.add_files(['tests/route.coffee', 'tests/client.html', 'tests/client.coffee'], 'client')
})
<commit_msg>Update package.js<commit_after>Package.describe({
    summary: "Make signin and signout their own pages with routes."
});

Package.on_use(function(api) {

  // CLIENT
  api.use([
    'deps',
    'service-configuration',
    'accounts-base',
    'underscore',
    'templating',
    'handlebars',
    'session',
    'coffeescript',
    'less']
  , 'client');

  api.add_files([
    'client/entry.coffee',
    'client/entry.less',
    'client/helpers.coffee',
    'client/views/signIn/signIn.html',
    'client/views/signIn/signIn.coffee',
    'client/views/signUp/signUp.html',
    'client/views/signUp/signUp.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/social/social.html',
    'client/views/social/social.coffee',
    'client/views/error/error.html',
    'client/views/error/error.coffee',
    'client/views/accountButtons/accountButtons.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/views/accountButtons/_wrapLinks.html',
    'client/t9n/english.coffee',
    'client/t9n/french.coffee',
    'client/t9n/german.coffee',
    'client/t9n/polish.coffee',
    'client/t9n/spanish.coffee'
  ], 'client');

  // SERVER
  api.use([
    'deps',
    'service-configuration',
    'accounts-password',
    'accounts-base',
    'underscore',
    'coffeescript'
  ], 'server');

  api.add_files(['server/entry.coffee'], 'server');

  // CLIENT and SERVER
  api.imply('accounts-base', ['client', 'server']);
  api.export('AccountsEntry', ['client', 'server']);
  api.use('iron-router', ['client', 'server']);
  api.use(['accounts-t9n'], ['client', 'server']);
  api.add_files(['shared/router.coffee'], ['client', 'server']);

});

Package.on_test(function (api) {
  api.use(['tinytest',
            'handlebars',
            'test-helpers',
            'templating',
            'mongo-livedata',
            'coffeescript',
            'iron-router'])
  api.use('accounts-entry')

  api.add_files(['tests/route.coffee', 'tests/client.html', 'tests/client.coffee'], 'client')
})
<|endoftext|>


<commit_before>Package.describe({
    summary: "Accounts Templates styled for Twitter Bootstrap.",
    version: "0.9.6",
    name: "splendido:accounts-templates-bootstrap",
    git: "https://github.com/splendido/accounts-templates-bootstrap.git",
});

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

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

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.6",
    ], ["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_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_bootstrap.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-bootstrap",
        "splendido:accounts-templates-core@0.9.6",
    ]);

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

    api.add_files([
        "tests/tests.js"
    ], ["client", "server"]);
});<commit_msg>patch release - Bump to version 0.9.7<commit_after>Package.describe({
    summary: "Accounts Templates styled for Twitter Bootstrap.",
    version: "0.9.7",
    name: "splendido:accounts-templates-bootstrap",
    git: "https://github.com/splendido/accounts-templates-bootstrap.git",
});

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

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

    api.use([
        "splendido:accounts-templates-core",
    ], ["client", "server"]);

    api.imply([
        "splendido:accounts-templates-core@0.9.7",
    ], ["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_oauth.html",
        "lib/at_oauth.js",
        "lib/at_pwd_form.html",
        "lib/at_pwd_form.js",
        "lib/at_pwd_form_btn.html",
        "lib/at_pwd_form_btn.js",
        "lib/at_pwd_link.html",
        "lib/at_pwd_link.js",
        "lib/at_result.html",
        "lib/at_result.js",
        "lib/at_sep.html",
        "lib/at_sep.js",
        "lib/at_signin_link.html",
        "lib/at_signin_link.js",
        "lib/at_signup_link.html",
        "lib/at_signup_link.js",
        "lib/at_social.html",
        "lib/at_social.js",
        "lib/at_terms_link.html",
        "lib/at_terms_link.js",
        "lib/at_title.html",
        "lib/at_title.js",
        "lib/full_page_at_form.html",
        "lib/at_bootstrap.less"
    ], ["client"]);
});

Package.on_test(function(api) {
    api.use([
        "splendido:accounts-templates-bootstrap",
        "splendido:accounts-templates-core@0.9.7",
    ]);

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

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


<commit_before>Package.describe({
  name: "hubroedu:semantic-react",
  version: "0.2.1",
  summary: "Semantic-ui as useful react components, based on react-semantify, with additional functionality.",
  git: "https://github.com/hubroedu/semantic-react",
  documentation: "README.md"
});

Package.onUse(function (api) {
  api.versionsFrom("1.3-rc.12");

  api.use([
    "jquery@1.11.6",
  ], "client");

  api.use("ecmascript@0.4.1-rc.8");
  api.use("mquandalle:stylus@1.1.1");

  api.mainModule("index.js", "client");

  api.addFiles([
    "styles/DropdownItem.styl",
    "styles/range.styl",
    "styles/statistic.styl",
    "styles/table.styl",
  ]);

  api.export([
    "classSet",
    "Mixins",
    "Left",
    "ExtraContent",
    "Extra",
    "Right",
    "Button",
    "Range",
    "Buttons",
    "RadioGroup",
    "RadioInput",
    "Meta",
    "Description",
    "Elements",
    "Container",
    "Divider",
    "Content",
    "Pusher",
    "Flag",
    "Title",
    "Header",
    "SubHeader",
    "Icon",
    "Image",
    "Input",
    "DropdownItem",
    "Label",
    "List",
    "Loader",
    "Rail",
    "Reveal",
    "Segment",
    "Segments",
    "Step",
    "Steps",
    "Collections",
    "Breadcrumb",
    "Form",
    "Field",
    "Fields",
    "Grid",
    "Column",
    "Row",
    "Menu",
    "Message",
    "Table",
    "Views",
    "Advertisement",
    "Card",
    "Cards",
    "Comment",
    "Feed",
    "Item",
    "Items",
    "Statistic",
    "Statistics",
    "Accordion",
    "Checkbox",
    "Dimmer",
    "Dropdown",
    "Modal",
    "Popup",
    "Progress",
    "Rating",
    "Search",
    "Shape",
    "Sidebar",
    "Sticky",
    "Tab",
    "TabContent",
    "TabMenu"
  ]);
});
<commit_msg>bump fix<commit_after>Package.describe({
  name: "hubroedu:semantic-react",
  version: "0.2.2",
  summary: "Semantic-ui as useful react components, based on react-semantify, with additional functionality.",
  git: "https://github.com/hubroedu/semantic-react",
  documentation: "README.md"
});

Package.onUse(function (api) {
  api.versionsFrom("1.3-rc.12");

  api.use([
    "jquery@1.11.6",
  ], "client");

  api.use("ecmascript@0.4.1-rc.8");
  api.use("mquandalle:stylus@1.1.1");

  api.mainModule("index.js", "client");

  api.addFiles([
    "styles/DropdownItem.styl",
    "styles/range.styl",
    "styles/statistic.styl",
    "styles/table.styl",
  ]);

  api.export([
    "classSet",
    "Mixins",
    "Left",
    "ExtraContent",
    "Extra",
    "Right",
    "Button",
    "Range",
    "Buttons",
    "RadioGroup",
    "RadioInput",
    "Meta",
    "Description",
    "Elements",
    "Container",
    "Divider",
    "Content",
    "Pusher",
    "Flag",
    "Title",
    "Header",
    "SubHeader",
    "Icon",
    "Image",
    "Input",
    "DropdownItem",
    "Label",
    "List",
    "Loader",
    "Rail",
    "Reveal",
    "Segment",
    "Segments",
    "Step",
    "Steps",
    "Collections",
    "Breadcrumb",
    "Form",
    "Field",
    "Fields",
    "Grid",
    "Column",
    "Row",
    "Menu",
    "Message",
    "Table",
    "Views",
    "Advertisement",
    "Card",
    "Cards",
    "Comment",
    "Feed",
    "Item",
    "Items",
    "Statistic",
    "Statistics",
    "Accordion",
    "Checkbox",
    "Dimmer",
    "Dropdown",
    "Modal",
    "Popup",
    "Progress",
    "Rating",
    "Search",
    "Shape",
    "Sidebar",
    "Sticky",
    "Tab",
    "TabContent",
    "TabMenu"
  ]);
});
<|endoftext|>


<commit_before>/* global Package:false */
// package metadata file for AtmosphereJS

try {
  Package.describe({
    name: 'formly:angular-formly-templates-koapp',
    summary: '(official): Bootstrap templates for angular-formly',
    version: '0.0.0-semantically-released.0',
    git: 'https://github.com/formly-js/angular-formly-templates-koapp.git',
  })

  Package.onUse(function(api) {
    api.versionsFrom(['METEOR@1.0'])
    // api-check
    api.use('wieldo:api-check@7.5.5')
    api.imply('wieldo:api-check')
    // angular
    api.use('angular:angular@1.4.0')
    api.imply('angular:angular')
    // angular-formly
    api.use('formly:angular-formly@7.3.9_3')
    api.imply('formly:angular-formly')
    // bootstrap
    api.use('twbs:bootstrap@3.3.2')
    api.imply('twbs:bootstrap')
    // export file
    api.addFiles('dist/angular-formly-templates-koapp.js', 'client')
  })
} catch (e) {
  //
}
<commit_msg>bump version<commit_after>/* global Package:false */
// package metadata file for AtmosphereJS

try {
  Package.describe({
    name: 'formly:angular-formly-templates-koapp',
    summary: '(official): Bootstrap templates for angular-formly',
    version: '0.0.1',
    git: 'https://github.com/formly-js/angular-formly-templates-koapp.git',
  })

  Package.onUse(function(api) {
    api.versionsFrom(['METEOR@1.0'])
    // api-check
    api.use('wieldo:api-check@7.5.5')
    api.imply('wieldo:api-check')
    // angular
    api.use('angular:angular@1.4.0')
    api.imply('angular:angular')
    // angular-formly
    api.use('formly:angular-formly@7.3.9_3')
    api.imply('formly:angular-formly')
    // bootstrap
    api.use('twbs:bootstrap@3.3.2')
    api.imply('twbs:bootstrap')
    // export file
    api.addFiles('dist/angular-formly-templates-koapp.js', 'client')
  })
} catch (e) {
  //
}
<|endoftext|>


<commit_before>Package.describe({
  name: 'richsilv:cordova-notifications',
  summary: 'Simple push notifications for Cordova apps built using Meteor.',
  git: 'https://github.com/richsilv/meteor-cordova-notifications',
  version: "0.1.0"
});

Cordova.depends({
  "de.appplant.cordova.plugin.local-notification" : "0.7.6",
  "com.phonegap.plugins.pushplugin" : "2.2.1",
  "org.apache.cordova.dialogs": "0.2.10"
});

Package.on_use(function(api) {

  api.use('tracker', 'web.cordova');
  api.use('http', 'server');
  api.use('accounts-base', 'client');

  api.add_files('cordova-both.js');
  api.add_files('cordova-server.js', 'server')

  api.export('NotificationClient');
  api.export('Cordova');

});

Package.on_test(function(api) {
  api.use('richsilv:cordova-notifications');
  api.use('tinytest');

  api.add_files('richsilv:cordova-notifications_tests.js');
});<commit_msg>added meteor package description<commit_after>Package.describe({
  name: 'richsilv:cordova-notifications',
  summary: 'Simple push notifications for Cordova apps built using Meteor.',
  git: 'https://github.com/richsilv/meteor-cordova-notifications',
  version: "0.1.0"
});

Cordova.depends({
  "de.appplant.cordova.plugin.local-notification" : "0.7.6",
  "com.phonegap.plugins.pushplugin" : "2.2.1",
  "org.apache.cordova.dialogs": "0.2.10"
});

Package.on_use(function(api) {

  api.use('tracker@1.0.3', 'web.cordova');
  api.use('http@1.0.8', 'server');
  api.use('accounts-base@1.1.2', 'client');

  api.add_files('cordova-both.js');
  api.add_files('cordova-server.js', 'server')

  api.export('NotificationClient');
  api.export('Cordova');

});

Package.on_test(function(api) {
  api.use('richsilv:cordova-notifications');
  api.use('tinytest');

  api.add_files('richsilv:cordova-notifications_tests.js');
});<|endoftext|>


<commit_before>dagre = {};

require('./src/version.js');

var sys = require('sys');

sys.puts(JSON.stringify({
  name: "dagre",
  version: dagre.version,
  description: "Directed graph rendering",
  main: "index.js",
  directories: {
    src: "src",
    test: "test"
  },
  scripts: {
    test: "make test"
  },
  keywords: [
    "graph"
  ],
  devDependencies: {
    pegjs: "0.7.x",
    mocha: "1.5.x",
    chai: "1.2.x"
  },
  author: "Chris Pettitt <chris@samsarin.com>",
  repository: {
    type: "git",
    url: "https://github.com/cpettitt/dagre.git"
  },
  license: "MIT"
}, null, 2));
<commit_msg>Update to chai 1.3.x<commit_after>dagre = {};

require('./src/version.js');

var sys = require('sys');

sys.puts(JSON.stringify({
  name: "dagre",
  version: dagre.version,
  description: "Directed graph rendering",
  main: "index.js",
  directories: {
    src: "src",
    test: "test"
  },
  scripts: {
    test: "make test"
  },
  keywords: [
    "graph"
  ],
  devDependencies: {
    pegjs: "0.7.x",
    mocha: "1.5.x",
    chai: "1.3.x"
  },
  author: "Chris Pettitt <chris@samsarin.com>",
  repository: {
    type: "git",
    url: "https://github.com/cpettitt/dagre.git"
  },
  license: "MIT"
}, null, 2));
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Accounts Templates styled for Materialize Css.',
  version: '1.9.1',
  name: 'useraccounts:materialize',
  git: 'https://github.com/meteor-useraccounts/materialize.git',
});

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

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

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

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

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

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

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

  api.add_files([
    'tests/tests.js'
  ], ['client', 'server']);
});
<commit_msg>added missing files for new atMessage template<commit_after>Package.describe({
  summary: 'Accounts Templates styled for Materialize Css.',
  version: '1.9.1',
  name: 'useraccounts:materialize',
  git: 'https://github.com/meteor-useraccounts/materialize.git',
});

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

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

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

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

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

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

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


<commit_before>Package.describe({
    name: 'evaisse:csv',
    version: '0.0.1',
    // Brief, one-line summary of the package.
    summary: 'A Meteor isomorphic CSV reader/writer based on Papa Parse & Baby Parse',
    // URL to the Git repository containing the source code for this package.
    git: 'https://github.com/evaisse/meteor-csv',
    // 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.use('harrison:papa-parse@1.0.10', ['client']);
    api.use('harrison:babyparse@1.0.1', ['server']);
    api.versionsFrom('1.0.4.1');
    api.export('CSV');
    api.addFiles([
        'csv-client.js'
    ], ['client', 'web.browser', 'web.cordova']);
    api.addFiles([
        'csv-server.js'
    ], 'server');
});

Package.onTest(function (api) {
    api.use('tinytest');
    api.use('evaisse:csv');
    api.addFiles('csv-tests.js');
});<commit_msg>let's go 0.1.1 !<commit_after>Package.describe({
    name: 'evaisse:csv',
    version: '0.1.1',
    // Brief, one-line summary of the package.
    summary: 'A Meteor isomorphic CSV reader/writer based on Papa Parse & Baby Parse',
    // URL to the Git repository containing the source code for this package.
    git: 'https://github.com/evaisse/meteor-csv',
    // 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.use('harrison:papa-parse@1.0.10', ['client']);
    api.use('harrison:babyparse@1.0.1', ['server']);
    api.versionsFrom('1.0.4.1');
    api.export('CSV');
    api.addFiles([
        'csv-client.js'
    ], ['client', 'web.browser', 'web.cordova']);
    api.addFiles([
        'csv-server.js'
    ], 'server');
});

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


<commit_before>Package.describe({
  name: 'thebarty:denormalized-views',
  version: '0.0.1',
  summary: 'Easily create "readonly" denormalized mongo-"views" (collections), p.e. for searchable tables',
  git: 'https://github.com/thebarty/meteor-denormalized-views',
  documentation: 'README.md'
});

Npm.depends({
  'underscore': '1.8.3',
  'underscore.string': '3.3.4',
})

Package.onUse(function(api) {
  api.versionsFrom('1.3.5.1');  // todo: test if we can set versions down
  api.use([
    'check',
    'ecmascript',
    'aldeed:simple-schema@1.5.3',  // todo: test if we can set versions down
    'matb33:collection-hooks@0.8.3',  // todo: test if we can set versions down
  ])
  api.mainModule('denormalized-views.js');
});

Package.onTest(function(api) {
  api.use([
    'check',
    'ecmascript',
    'tinytest',
    'test-helpers',
    'ejson',
    'ordered-dict',
    'random',
    'deps',
    'minimongo',
    'aldeed:simple-schema',
    'aldeed:collection2@2.9.1',
    'matb33:collection-hooks',
    'practicalmeteor:mocha',
    'thebarty:denormalized-views',
  ])

  api.mainModule('denormalized-views.tests.js');
});
<commit_msg>version bump for athmosphere<commit_after>Package.describe({
  name: 'thebarty:denormalized-views',
  version: '0.0.2',
  summary: 'Easily create "readonly" denormalized mongo-"views" (collections), p.e. for searchable tables',
  git: 'https://github.com/thebarty/meteor-denormalized-views',
  documentation: 'README.md'
});

Npm.depends({
  'underscore': '1.8.3',
  'underscore.string': '3.3.4',
})

Package.onUse(function(api) {
  api.versionsFrom('1.3.5.1');  // todo: test if we can set versions down
  api.use([
    'check',
    'ecmascript',
    'aldeed:simple-schema@1.5.3',  // todo: test if we can set versions down
    'matb33:collection-hooks@0.8.3',  // todo: test if we can set versions down
  ])
  api.mainModule('denormalized-views.js');
});

Package.onTest(function(api) {
  api.use([
    'check',
    'ecmascript',
    'tinytest',
    'test-helpers',
    'ejson',
    'ordered-dict',
    'random',
    'deps',
    'minimongo',
    'aldeed:simple-schema',
    'aldeed:collection2@2.9.1',
    'matb33:collection-hooks',
    'practicalmeteor:mocha',
    'thebarty:denormalized-views',
  ])

  api.mainModule('denormalized-views.tests.js');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: "SessionVar: Like ReactiveVar, but stored in Session",
  version: "1.1.2",
  git: "https://github.com/lukemt/meteor-SessionVar.git"
});

Package.onUse(function(api) {
  api.versionsFrom('METEOR@0.9.0');
  api.export('SessionVar', 'client');

  api.use('session');
  api.addFiles(['session-var.js'], 'client');
});
<commit_msg>Set package name in package.js, help fix #1<commit_after>Package.describe({
  name: 'lukemt:session-var',
  summary: 'SessionVar: Like ReactiveVar, but stored in Session',
  version: '1.1.2',
  git: 'https://github.com/lukemt/meteor-SessionVar.git'
});

Package.onUse(function(api) {
  api.versionsFrom('0.9.0');
  api.export('SessionVar', 'client');

  api.use('session');
  api.addFiles(['session-var.js'], 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'comerc:autoform-contenteditable2',
  summary: 'Extended "contenteditable" input type for AutoForm',
  version: '1.0.2',
  git: 'https://github.com/comerc/meteor-autoform-contenteditable2.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');
  api.use('templating@1.0.0');
  api.use('blaze@2.0.0');
  api.use('aldeed:autoform@4.0.0');
  api.addFiles([
    'autoform-contenteditable2.css',
    'autoform-contenteditable2.html',
    'autoform-contenteditable2.js',
    'themes/bootstrap3.css',
  ], 'client');
});
<commit_msg>bump ver<commit_after>Package.describe({
  name: 'comerc:autoform-contenteditable2',
  summary: 'Extended "contenteditable" input type for AutoForm',
  version: '1.0.3',
  git: 'https://github.com/comerc/meteor-autoform-contenteditable2.git'
});

Package.onUse(function(api) {
  api.versionsFrom('1.0');
  api.use('templating@1.0.0');
  api.use('blaze@2.0.0');
  api.use('aldeed:autoform@4.0.0');
  api.addFiles([
    'autoform-contenteditable2.css',
    'autoform-contenteditable2.html',
    'autoform-contenteditable2.js',
    'themes/bootstrap3.css',
  ], 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Tutorial content, included in meteor.com via package',
  version: '0.0.1',
  name: 'tutorials'
});

Package.onUse(function (api) {
  api.use([
    'simple:markdown-templating@2.0.3',
    'templating',
    'underscore',
    'jsx',
    'simple:highlight.js@1.0.9',
    'reactive-var',
    'less',
    'ecmascript',
    'mdg:tutorial-step-diff-compiler@0.4.2',
    'mdg:tutorial-diff-box@0.4.2',
    'mdg:tutorial-registry@0.4.2'
  ]);

  api.addFiles([
    'content/angular/metadata.js',
    'content/blaze/metadata.js',
    'content/react/metadata.js',
  ]);

  api.addFiles([
    'content/angular/step02.md',
    'content/angular/step03.md',
    'content/angular/step04.md',
    'content/angular/step05.md',
    'content/angular/step06.md',
    'content/angular/step07.md',
    'content/angular/step08.md',
    'content/angular/step09.md',
    'content/angular/step10.md',
    'content/angular/step11.md',
    'content/angular/step12.md',

    'content/blaze/step02.md',
    'content/blaze/step03.md',
    'content/blaze/step04.md',
    'content/blaze/step05.md',
    'content/blaze/step07.md',
    'content/blaze/step08.md',
    'content/blaze/step09.md',
    'content/blaze/step10.md',
    'content/blaze/step12.md',

    'content/react/step02.md',
    'content/react/step03.md',
    'content/react/step04.md',
    'content/react/step05.md',
    'content/react/step07.md',
    'content/react/step08.md',
    'content/react/step09.md',
    'content/react/step10.md',
    'content/react/step11.md',
    'content/step00.html',

    'content/shared/explanations.md',
    'content/shared/adding-css.md',
    'content/shared/adding-css.js',
    'content/shared/nextSteps.md',
    'content/shared/step01.md',
    'content/shared/step06.md',
    'content/shared/step11.md',

    'generated/react.multi.patch',
    'generated/blaze.multi.patch',
    'generated/angular.multi.patch'
  ], 'client');

  // Also, exports all of the templates from the content/ directory
  api.export('TUTORIAL_PAGES');

  api.export('REACT_TUT');
  api.export('ANGULAR_TUT');
  api.export('BLAZE_TUT');
});
<commit_msg>Update tutorial-tools packages to v0.4.3 versions.<commit_after>Package.describe({
  summary: 'Tutorial content, included in meteor.com via package',
  version: '0.0.1',
  name: 'tutorials'
});

Package.onUse(function (api) {
  api.use([
    'simple:markdown-templating@2.0.3',
    'templating',
    'underscore',
    'jsx',
    'simple:highlight.js@1.0.9',
    'reactive-var',
    'less',
    'ecmascript',
    'mdg:tutorial-step-diff-compiler@0.4.2',
    'mdg:tutorial-diff-box@0.4.3',
    'mdg:tutorial-registry@0.4.3'
  ]);

  api.addFiles([
    'content/angular/metadata.js',
    'content/blaze/metadata.js',
    'content/react/metadata.js',
  ]);

  api.addFiles([
    'content/angular/step02.md',
    'content/angular/step03.md',
    'content/angular/step04.md',
    'content/angular/step05.md',
    'content/angular/step06.md',
    'content/angular/step07.md',
    'content/angular/step08.md',
    'content/angular/step09.md',
    'content/angular/step10.md',
    'content/angular/step11.md',
    'content/angular/step12.md',

    'content/blaze/step02.md',
    'content/blaze/step03.md',
    'content/blaze/step04.md',
    'content/blaze/step05.md',
    'content/blaze/step07.md',
    'content/blaze/step08.md',
    'content/blaze/step09.md',
    'content/blaze/step10.md',
    'content/blaze/step12.md',

    'content/react/step02.md',
    'content/react/step03.md',
    'content/react/step04.md',
    'content/react/step05.md',
    'content/react/step07.md',
    'content/react/step08.md',
    'content/react/step09.md',
    'content/react/step10.md',
    'content/react/step11.md',
    'content/step00.html',

    'content/shared/explanations.md',
    'content/shared/adding-css.md',
    'content/shared/adding-css.js',
    'content/shared/nextSteps.md',
    'content/shared/step01.md',
    'content/shared/step06.md',
    'content/shared/step11.md',

    'generated/react.multi.patch',
    'generated/blaze.multi.patch',
    'generated/angular.multi.patch'
  ], 'client');

  // Also, exports all of the templates from the content/ directory
  api.export('TUTORIAL_PAGES');

  api.export('REACT_TUT');
  api.export('ANGULAR_TUT');
  api.export('BLAZE_TUT');
});
<|endoftext|>


<commit_before>
Package.describe({
  summary: "soundcloud oauth login service for meteor",
  name: "quietcreep:accounts-soundcloud",
  version: "1.0.0",
  git: "https://github.com/quietcreep/meteor-soundcloud.git",
  author: "gregory nicholas <gregory@unvael.com>; dustin chaffin",
});

Package.on_use(function(api) {
  var both = [ 'client', 'server' ];

  api.use( 'accounts-base', both );
  // Export Accounts (etc) to packages using this one.
  api.imply( 'accounts-base', both );
  api.use( 'accounts-oauth', both );
  api.use( 'quietcreep:soundcloud@1.0.0', both )

  api.add_files( 'soundcloud-login-button.css', both );
  api.add_files( 'soundcloud.js', both );
});
<commit_msg>Added required version constraints<commit_after>
Package.describe({
  summary: "soundcloud oauth login service for meteor",
  name: "quietcreep:accounts-soundcloud",
  version: "1.0.0",
  git: "https://github.com/quietcreep/meteor-soundcloud.git",
  author: "gregory nicholas <gregory@unvael.com>; dustin chaffin",
});

Package.on_use(function(api) {
  var both = [ 'client', 'server' ];

  api.use( 'accounts-base@1.1.0', both );
  // Export Accounts (etc) to packages using this one.
  api.imply( 'accounts-base', both );
  api.use( 'accounts-oauth@1.1.0', both );
  api.use( 'quietcreep:soundcloud@1.0.0', both )

  api.add_files( 'soundcloud-login-button.css', both );
  api.add_files( 'soundcloud.js', both );
});
<|endoftext|>


<commit_before>var fs = Npm.require('fs');
var path = Npm.require('path');

Package.describe({
  "summary": "Render you app even before the DDP connection comes live. - magic?",
  "version": "2.4.0",
  "git": "https://github.com/meteorhacks/fast-render",
  "name": "meteorhacks:fast-render"
});

Npm.depends({
  "connect": "2.13.0"
});

Package.onUse(function(api) {
  configure(api);
  api.export('FastRender', ['client', 'server']);
  api.export('__init_fast_render', ['client']);
});

Package.onTest(function(api) {
  configure(api);
  api.use('tinytest', ['client', 'server']);
  api.use('http', 'server');

  api.addFiles([
    'tests/utils.js'
  ], ['client', 'server']);

  api.addFiles([
    'tests/client/fast_render.js',
    'tests/client/ddp_update.js'
  ], 'client');

  api.addFiles([
    'tests/server/context.js',
    'tests/server/integration.js'
  ], 'server');
});

function configure (api) {
  api.versionsFrom('METEOR@0.9.3');
  api.use('meteorhacks:inject-data@1.2.3', ['client', 'server']);
  api.use('iron:router@0.9.0 || 1.0.0', ['client', 'server'], {weak: true});
  api.use('chuangbo:cookie@1.1.0', 'client');
  api.use('meteorhacks:picker@1.0.1', 'server');

  api.use(['minimongo', 'livedata', 'ejson', 'underscore', 'webapp', 'routepolicy', 'accounts-base'], ['server']);
  api.use(['minimongo', 'underscore', 'deps', 'ejson', 'accounts-base'], ['client']);

  api.addFiles([
    'lib/utils.js'
  ], ['client', 'server']);

  api.addFiles([
    'lib/server/namespace.js',
    'lib/server/utils.js',
    'lib/server/routes.js',
    'lib/server/publish_context.js',
    'lib/server/context.js',
    'lib/server/iron_router_support.js',
  ], 'server');

  api.addFiles([
    'lib/client/fast_render.js',
    'lib/client/debugger.js',
    'lib/client/ddp_update.js',
    'lib/client/auth.js',
    'lib/client/boot.js'
  ], 'client');

}
<commit_msg>Grammar<commit_after>var fs = Npm.require('fs');
var path = Npm.require('path');

Package.describe({
  "summary": "Render your app before the DDP connection even comes alive - magic?",
  "version": "2.4.0",
  "git": "https://github.com/meteorhacks/fast-render",
  "name": "meteorhacks:fast-render"
});

Npm.depends({
  "connect": "2.13.0"
});

Package.onUse(function(api) {
  configure(api);
  api.export('FastRender', ['client', 'server']);
  api.export('__init_fast_render', ['client']);
});

Package.onTest(function(api) {
  configure(api);
  api.use('tinytest', ['client', 'server']);
  api.use('http', 'server');

  api.addFiles([
    'tests/utils.js'
  ], ['client', 'server']);

  api.addFiles([
    'tests/client/fast_render.js',
    'tests/client/ddp_update.js'
  ], 'client');

  api.addFiles([
    'tests/server/context.js',
    'tests/server/integration.js'
  ], 'server');
});

function configure (api) {
  api.versionsFrom('METEOR@0.9.3');
  api.use('meteorhacks:inject-data@1.2.3', ['client', 'server']);
  api.use('iron:router@0.9.0 || 1.0.0', ['client', 'server'], {weak: true});
  api.use('chuangbo:cookie@1.1.0', 'client');
  api.use('meteorhacks:picker@1.0.1', 'server');

  api.use(['minimongo', 'livedata', 'ejson', 'underscore', 'webapp', 'routepolicy', 'accounts-base'], ['server']);
  api.use(['minimongo', 'underscore', 'deps', 'ejson', 'accounts-base'], ['client']);

  api.addFiles([
    'lib/utils.js'
  ], ['client', 'server']);

  api.addFiles([
    'lib/server/namespace.js',
    'lib/server/utils.js',
    'lib/server/routes.js',
    'lib/server/publish_context.js',
    'lib/server/context.js',
    'lib/server/iron_router_support.js',
  ], 'server');

  api.addFiles([
    'lib/client/fast_render.js',
    'lib/client/debugger.js',
    'lib/client/ddp_update.js',
    'lib/client/auth.js',
    'lib/client/boot.js'
  ], 'client');

}
<|endoftext|>


<commit_before>Package.describe({
    name: "reywood:publish-composite",
    summary: "Publish a set of related documents from multiple collections with a reactive join",
    version: "1.4.2",
    git: "https://github.com/englue/meteor-publish-composite.git"
});

Package.on_use(function (api) {
    api.versionsFrom("METEOR@0.9.0");
    api.use("underscore", "server");
    api.add_files([
        "lib/doc_ref_counter.js",
        "lib/publication.js",
        "lib/subscription.js",
        "lib/publish_composite.js"
    ], "server");
});

Package.on_test(function(api) {
    api.use("reywood:publish-composite");
    api.use(["tinytest", "test-helpers"]);

    api.add_files([ "tests.js" ]);
});
<commit_msg>Add package dependencies for testing<commit_after>Package.describe({
    name: "reywood:publish-composite",
    summary: "Publish a set of related documents from multiple collections with a reactive join",
    version: "1.4.2",
    git: "https://github.com/englue/meteor-publish-composite.git"
});

Package.on_use(function (api) {
    api.versionsFrom("METEOR@0.9.0");
    api.use("underscore", "server");
    api.add_files([
        "lib/doc_ref_counter.js",
        "lib/publication.js",
        "lib/subscription.js",
        "lib/publish_composite.js"
    ], "server");
});

Package.on_test(function(api) {
    api.use("reywood:publish-composite");
    api.use("mongo", "server");
    api.use("underscore", "server");
    api.use(["tinytest", "test-helpers"]);

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


<commit_before>Package.describe({
  name: 'meteorhacks:flow-router',
  summary: 'Carefully Designed Client Side Router for Meteor',
  version: '1.3.0',
  git: 'https://github.com/meteorhacks/flow-router.git'
});

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

  api.use('underscore');
  api.use('tracker');
  api.use('reactive-dict');

  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/group.js', 'client');
  api.addFiles('client/route.js', 'client');
  api.addFiles('client/_init.js', 'client');
  api.addFiles('server/router.js', 'server');
  api.addFiles('server/group.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.spec.js', 'client');
  api.addFiles('test/client/router.subs_ready.spec.js', 'client');
  api.addFiles('test/client/router.naming.spec.js', 'client');
  api.addFiles('test/client/route.test.js', 'client');
  api.addFiles('test/client/route.spec.js', 'client');

  api.addFiles('test/client/group.spec.js', 'client');
});
<commit_msg>Bump version v1.4.0<commit_after>Package.describe({
  name: 'meteorhacks:flow-router',
  summary: 'Carefully Designed Client Side Router for Meteor',
  version: '1.4.0',
  git: 'https://github.com/meteorhacks/flow-router.git'
});

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

  api.use('underscore');
  api.use('tracker');
  api.use('reactive-dict');

  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/group.js', 'client');
  api.addFiles('client/route.js', 'client');
  api.addFiles('client/_init.js', 'client');
  api.addFiles('server/router.js', 'server');
  api.addFiles('server/group.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.spec.js', 'client');
  api.addFiles('test/client/router.subs_ready.spec.js', 'client');
  api.addFiles('test/client/router.naming.spec.js', 'client');
  api.addFiles('test/client/route.test.js', 'client');
  api.addFiles('test/client/route.spec.js', 'client');

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


<commit_before>// jshint esversion: 6
const BaseClass = require('../BaseClass');

describe('[BaseClass]', () => {
  const instanceA = new BaseClass();
  const instanceB = new BaseClass();

  it('"instanceA.hello" should be "world"', () => {
    instanceA.set('hello', 'world');
    expect(instanceA.get('hello')).toEqual('world');
  });

  it('"instanceB.anotherHello" should be the same as "instanceA.hello"', () => {
    instanceA.bindTo('hello', instanceB, 'anotherHello');
    expect(instanceB.get('anotherHello')).toEqual('world');
  });

  it('"instanceA.one()" should receive "hello_changed" event.', (done) => {
    instanceA.one('hello_changed', (prevValue, newValue) => {
      expect(prevValue).toEqual('world');
      expect(newValue).toEqual('Aloha');
      done();
    });
    instanceA.set('hello', 'Aloha');
  });

  it('"instanceA.hasEventListener(\'hello_changed\')"', () => {
    instanceA.on('hello_changed', () => { });
    expect(instanceA.hasEventListener('hello_changed')).toEqual(true);
    instanceA.off('hello_changed');
    expect(instanceA.hasEventListener('hello_changed')).toEqual(false);
  });

  it('"instanceA.on()" should receive "hello_changed" event twice.', (done) => {
    (new Promise((resolve, reject) => {
      const timer = setTimeout(reject, 100); // just in case

      let count = 0;
      const listener = (prevValue, newValue) => {
        count++;
        if (count === 2) {
          instanceA.off('hello_changed', listener);
          clearTimeout(timer);
          resolve(newValue);
        }
      };
      instanceA.on('hello_changed', listener);

      instanceA.set('hello', '你好');
      instanceA.set('hello', 'こんにちは');
    }))
    .then((answer) => {
      expect(answer).toBe('こんにちは');
      done();
    });
  });

  it('"instanceA.on() then .off()" should receive only one time "hello_changed" event.', (done) => {
    (new Promise((resolve, reject) => {
      let count = 0;
      const listener = () => {
        count++;
        instanceA.off('hello_changed', listener);
      };
      instanceA.on('hello_changed', listener);

      setTimeout(() => {
        resolve(count);
      }, 100);

      for (let i = 0; i < 100; i++) {
        instanceA.set('hello', i);
      }
    }))
    .then((answer) => {
      expect(answer).toBe(1);
      done();
    });
  });

  it('"instanceA.off()" should remove all event listeners.', (done) => {
    (new Promise((resolve, reject) => {
      let called = false;
      const dummyListener = () => {
        called = true;
      };

      instanceA.on('myEvent', dummyListener);
      instanceA.on('myEvent', dummyListener);
      instanceA.on('myEvent', dummyListener);
      instanceA.on('myEvent', dummyListener);
      instanceA.off('myEvent');
      instanceA.trigger('myEvent');

      setTimeout(() => {
        resolve(called);
      }, 100);

    }))
    .then((answer) => {
      expect(answer).toBe(false);
      done();
    });
  });

  it('"instanceA.onThrottled()" should receive only the last event.', (done) => {
    (new Promise((resolve) => {

      let eventCount = 0;

      // eventListener should be involved 3 times.
      instanceA.onThrottled('myEvent', (receivedData) => {
        eventCount++;
      }, 50);

      let sendCount = 0;
      const triggerTimer = setInterval(() => {
        sendCount++;
        instanceA.trigger('myEvent', sendCount);
        if (sendCount === 13) {
          clearInterval(triggerTimer);
        }
      }, 10);

      setTimeout(() => {
        resolve(eventCount);
      }, 200);

    }))
    .then((answer) => {
      expect(answer).toBe(3);
      done();
    });
  });

  it('"instanceA.trigger()" should fire a "myEvent" event.', (done) => {
    (new Promise((resolve, reject) => {

      const timer = setTimeout(reject, 100); // just in case

      instanceA.on('myEvent', (...parameters) => {
        clearTimeout(timer);
        resolve(parameters);
      });

      instanceA.trigger('myEvent', 'data', 1);
    }))
    .then((receivedData) => {
      expect(receivedData[0]).toBe('data');
      expect(receivedData[1]).toBe(1);
      done();
    });
  });

  it('"instanceA.empty()" should delete all holded variables.', () => {
    instanceA.set('hello1', 'world');
    instanceA.set('hello2', 'test');
    instanceA.empty();
    expect(instanceA.get('hello1')).toBe(undefined);
    expect(instanceA.get('hello2')).toBe(undefined);
  });

});
<commit_msg>adjust test time<commit_after>// jshint esversion: 6
const BaseClass = require('../BaseClass');

describe('[BaseClass]', () => {
  const instanceA = new BaseClass();
  const instanceB = new BaseClass();

  it('"instanceA.hello" should be "world"', () => {
    instanceA.set('hello', 'world');
    expect(instanceA.get('hello')).toEqual('world');
  });

  it('"instanceB.anotherHello" should be the same as "instanceA.hello"', () => {
    instanceA.bindTo('hello', instanceB, 'anotherHello');
    expect(instanceB.get('anotherHello')).toEqual('world');
  });

  it('"instanceA.one()" should receive "hello_changed" event.', (done) => {
    instanceA.one('hello_changed', (prevValue, newValue) => {
      expect(prevValue).toEqual('world');
      expect(newValue).toEqual('Aloha');
      done();
    });
    instanceA.set('hello', 'Aloha');
  });

  it('"instanceA.hasEventListener(\'hello_changed\')"', () => {
    instanceA.on('hello_changed', () => { });
    expect(instanceA.hasEventListener('hello_changed')).toEqual(true);
    instanceA.off('hello_changed');
    expect(instanceA.hasEventListener('hello_changed')).toEqual(false);
  });

  it('"instanceA.on()" should receive "hello_changed" event twice.', (done) => {
    (new Promise((resolve, reject) => {
      const timer = setTimeout(reject, 100); // just in case

      let count = 0;
      const listener = (prevValue, newValue) => {
        count++;
        if (count === 2) {
          instanceA.off('hello_changed', listener);
          clearTimeout(timer);
          resolve(newValue);
        }
      };
      instanceA.on('hello_changed', listener);

      instanceA.set('hello', '你好');
      instanceA.set('hello', 'こんにちは');
    }))
    .then((answer) => {
      expect(answer).toBe('こんにちは');
      done();
    });
  });

  it('"instanceA.on() then .off()" should receive only one time "hello_changed" event.', (done) => {
    (new Promise((resolve, reject) => {
      let count = 0;
      const listener = () => {
        count++;
        instanceA.off('hello_changed', listener);
      };
      instanceA.on('hello_changed', listener);

      setTimeout(() => {
        resolve(count);
      }, 100);

      for (let i = 0; i < 100; i++) {
        instanceA.set('hello', i);
      }
    }))
    .then((answer) => {
      expect(answer).toBe(1);
      done();
    });
  });

  it('"instanceA.off()" should remove all event listeners.', (done) => {
    (new Promise((resolve, reject) => {
      let called = false;
      const dummyListener = () => {
        called = true;
      };

      instanceA.on('myEvent', dummyListener);
      instanceA.on('myEvent', dummyListener);
      instanceA.on('myEvent', dummyListener);
      instanceA.on('myEvent', dummyListener);
      instanceA.off('myEvent');
      instanceA.trigger('myEvent');

      setTimeout(() => {
        resolve(called);
      }, 100);

    }))
    .then((answer) => {
      expect(answer).toBe(false);
      done();
    });
  });

  it('"instanceA.onThrottled()" should receive event only 3 times.', (done) => {
    (new Promise((resolve) => {

      let eventCount = 0;

      // eventListener should be involved 3 times.
      //   first time: at 50ms
      //   second time: at 100ms
      //   third time: at 150ms
      instanceA.onThrottled('myEvent', (receivedData) => {
        eventCount++;
      }, 50);

      // Trigger event 13 times (takes 130ms)
      let sendCount = 0;
      const triggerTimer = setInterval(() => {
        sendCount++;
        instanceA.trigger('myEvent', sendCount);
        if (sendCount === 13) {
          clearInterval(triggerTimer);
        }
      }, 10);

      // When 300ms, test should be complited.
      setTimeout(() => {
        resolve(eventCount);
      }, 300);

    }))
    .then((answer) => {
      expect(answer).toBe(3);
      done();
    });
  });

  it('"instanceA.trigger()" should fire a "myEvent" event.', (done) => {
    (new Promise((resolve, reject) => {

      const timer = setTimeout(reject, 100); // just in case

      instanceA.on('myEvent', (...parameters) => {
        clearTimeout(timer);
        resolve(parameters);
      });

      instanceA.trigger('myEvent', 'data', 1);
    }))
    .then((receivedData) => {
      expect(receivedData[0]).toBe('data');
      expect(receivedData[1]).toBe(1);
      done();
    });
  });

  it('"instanceA.empty()" should delete all holded variables.', () => {
    instanceA.set('hello1', 'world');
    instanceA.set('hello2', 'test');
    instanceA.empty();
    expect(instanceA.get('hello1')).toBe(undefined);
    expect(instanceA.get('hello2')).toBe(undefined);
  });

});
<|endoftext|>