<commit_before>Package.describe({
  summary: 'Dynamic layouts which enable rendering dynamic templates into regions on a page.',
  version: '1.0.0-pre3',
  git: 'https://github.com/eventedmind/iron-layout'
});

Package.on_use(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  // so our default_layout gets compiled
  api.use('templating');
  api.use('blaze');

  // some utils
  api.use('underscore');

  api.use('iron:core@1.0.0-pre3');
  api.imply('iron:core');

  // dynamic templates
  api.use('iron:dynamic-template@1.0.0-pre3');

  // if you use iron-layout you should get iron-dynamic-template for free!
  api.imply('iron:dynamic-template');

  // error messages to remove old packages
  api.use('cmather:blaze-layout@0.2.5', {weak: true});
  api.use('cmather:iron-layout@0.2.0', {weak: true});

  api.add_files('version_conflict_errors.js');
  api.add_files('default_layout.html');
  api.add_files('layout.js');
});

Package.on_test(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  api.use('iron:layout');
  api.use('tinytest');
  api.use('test-helpers');
  api.use('templating');
  api.use('deps');

  api.add_files('layout_test.html', 'client');
  api.add_files('layout_test.js', 'client');
});
<commit_msg>Fix issue #18 by adding tracker for Meteor 1.2<commit_after>Package.describe({
  summary: 'Dynamic layouts which enable rendering dynamic templates into regions on a page.',
  version: '1.0.0-pre3',
  git: 'https://github.com/eventedmind/iron-layout'
});

Package.on_use(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  // so our default_layout gets compiled
  api.use('templating');
  api.use('blaze');

  // some utils
  api.use('underscore');
  api.use('tracker'); // for Deps

  api.use('iron:core@1.0.0-pre3');
  api.imply('iron:core');

  // dynamic templates
  api.use('iron:dynamic-template@1.0.0-pre3');

  // if you use iron-layout you should get iron-dynamic-template for free!
  api.imply('iron:dynamic-template');

  // error messages to remove old packages
  api.use('cmather:blaze-layout@0.2.5', {weak: true});
  api.use('cmather:iron-layout@0.2.0', {weak: true});

  api.add_files('version_conflict_errors.js');
  api.add_files('default_layout.html');
  api.add_files('layout.js');
});

Package.on_test(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  api.use('iron:layout');
  api.use('tinytest');
  api.use('test-helpers');
  api.use('templating');
  api.use('deps');

  api.add_files('layout_test.html', 'client');
  api.add_files('layout_test.js', 'client');
});
<|endoftext|>


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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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


<commit_before>Package.describe({
  name: 'francocatena:compass',
  summary: 'Stylesheet Authoring Environment that makes your website design simpler',
  version: '0.5.0',
  git: 'https://github.com/francocatena/meteor-compass'
});

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

  api.addFiles('scss.json', 'server')

  api.addFiles([
    '_compass.scss',
    '_lemonade.scss',
    'compass/_css3.scss',
    'compass/_layout.scss',
    'compass/_reset-legacy.scss',
    'compass/_reset.scss',
    'compass/_support.scss',
    'compass/_typography.scss',
    'compass/_utilities.scss',
    'compass/_css3.scss',
    'compass/css3/_animation.scss',
    'compass/css3/_appearance.scss',
    'compass/css3/_background-clip.scss',
    'compass/css3/_background-origin.scss',
    'compass/css3/_background-size.scss',
    'compass/css3/_border-radius.scss',
    'compass/css3/_box.scss',
    'compass/css3/_box-shadow.scss',
    'compass/css3/_box-sizing.scss',
    'compass/css3/_columns.scss',
    'compass/css3/_filter.scss',
    'compass/css3/_font-face.scss',
    'compass/css3/_hyphenation.scss',
    'compass/css3/_images.scss',
    'compass/css3/_inline-block.scss',
    'compass/css3/_opacity.scss',
    'compass/css3/_pie.scss',
    'compass/css3/_regions.scss',
    'compass/css3/_selection.scss',
    'compass/css3/_shared.scss',
    'compass/css3/_text-shadow.scss',
    'compass/css3/_transform.scss',
    'compass/css3/_transform-legacy.scss',
    'compass/css3/_transition.scss',
    'compass/css3/_user-interface.scss',
    'compass/layout/_grid-background.scss',
    'compass/layout/_sticky-footer.scss',
    'compass/layout/_stretching.scss',
    'compass/reset/_utilities-legacy.scss',
    'compass/reset/_utilities.scss',
    'compass/typography/_links.scss',
    'compass/typography/links/_hover-link.scss',
    'compass/typography/links/_link-colors.scss',
    'compass/typography/links/_unstyled-link.scss',
    'compass/typography/_lists.scss',
    'compass/typography/lists/_bullets.scss',
    'compass/typography/lists/_horizontal-list.scss',
    'compass/typography/lists/_inline-block-list.scss',
    'compass/typography/lists/_inline-list.scss',
    'compass/typography/_text.scss',
    'compass/typography/text/_ellipsis.scss',
    'compass/typography/text/_force-wrap.scss',
    'compass/typography/text/_nowrap.scss',
    'compass/typography/text/_replacement.scss',
    'compass/typography/_units.scss',
    'compass/typography/_vertical_rhythm.scss',
    'compass/utilities/_color.scss',
    'compass/utilities/color/_contrast.scss',
    'compass/utilities/_general.scss',
    'compass/utilities/_links.scss',
    'compass/utilities/_lists.scss',
    'compass/utilities/_print.scss',
    'compass/utilities/_sprites.scss',
    'compass/utilities/_tables.scss',
    'compass/utilities/_text.scss',
    'compass/utilities/general/_clearfix.scss',
    'compass/utilities/general/_float.scss',
    'compass/utilities/general/_hacks.scss',
    'compass/utilities/general/_min.scss',
    'compass/utilities/general/_reset.scss',
    'compass/utilities/general/_tabs.scss',
    'compass/utilities/general/_tag-cloud.scss',
    'compass/utilities/links/_hover-link.scss',
    'compass/utilities/links/_link-colors.scss',
    'compass/utilities/links/_unstyled-link.scss',
    'compass/utilities/lists/_bullets.scss',
    'compass/utilities/lists/_horizontal-list.scss',
    'compass/utilities/lists/_inline-block-list.scss',
    'compass/utilities/lists/_inline-list.scss',
    'compass/utilities/sprites/_base.scss',
    'compass/utilities/sprites/_sprite-img.scss',
    'compass/utilities/tables/_alternating-rows-and-columns.scss',
    'compass/utilities/tables/_borders.scss',
    'compass/utilities/tables/_scaffolding.scss',
    'compass/utilities/text/_ellipsis.scss',
    'compass/utilities/text/_nowrap.scss',
    'compass/utilities/text/_replacement.scss'
  ], 'server', { isAsset: true })
})
<commit_msg>Version 0.5.1 bump<commit_after>Package.describe({
  name: 'francocatena:compass',
  summary: 'Stylesheet Authoring Environment that makes your website design simpler',
  version: '0.5.1',
  git: 'https://github.com/francocatena/meteor-compass'
});

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

  api.addFiles('scss.json', 'server')

  api.addFiles([
    '_compass.scss',
    '_lemonade.scss',
    'compass/_css3.scss',
    'compass/_layout.scss',
    'compass/_reset-legacy.scss',
    'compass/_reset.scss',
    'compass/_support.scss',
    'compass/_typography.scss',
    'compass/_utilities.scss',
    'compass/_css3.scss',
    'compass/css3/_animation.scss',
    'compass/css3/_appearance.scss',
    'compass/css3/_background-clip.scss',
    'compass/css3/_background-origin.scss',
    'compass/css3/_background-size.scss',
    'compass/css3/_border-radius.scss',
    'compass/css3/_box.scss',
    'compass/css3/_box-shadow.scss',
    'compass/css3/_box-sizing.scss',
    'compass/css3/_columns.scss',
    'compass/css3/_filter.scss',
    'compass/css3/_font-face.scss',
    'compass/css3/_hyphenation.scss',
    'compass/css3/_images.scss',
    'compass/css3/_inline-block.scss',
    'compass/css3/_opacity.scss',
    'compass/css3/_pie.scss',
    'compass/css3/_regions.scss',
    'compass/css3/_selection.scss',
    'compass/css3/_shared.scss',
    'compass/css3/_text-shadow.scss',
    'compass/css3/_transform.scss',
    'compass/css3/_transform-legacy.scss',
    'compass/css3/_transition.scss',
    'compass/css3/_user-interface.scss',
    'compass/layout/_grid-background.scss',
    'compass/layout/_sticky-footer.scss',
    'compass/layout/_stretching.scss',
    'compass/reset/_utilities-legacy.scss',
    'compass/reset/_utilities.scss',
    'compass/typography/_links.scss',
    'compass/typography/links/_hover-link.scss',
    'compass/typography/links/_link-colors.scss',
    'compass/typography/links/_unstyled-link.scss',
    'compass/typography/_lists.scss',
    'compass/typography/lists/_bullets.scss',
    'compass/typography/lists/_horizontal-list.scss',
    'compass/typography/lists/_inline-block-list.scss',
    'compass/typography/lists/_inline-list.scss',
    'compass/typography/_text.scss',
    'compass/typography/text/_ellipsis.scss',
    'compass/typography/text/_force-wrap.scss',
    'compass/typography/text/_nowrap.scss',
    'compass/typography/text/_replacement.scss',
    'compass/typography/_units.scss',
    'compass/typography/_vertical_rhythm.scss',
    'compass/utilities/_color.scss',
    'compass/utilities/color/_contrast.scss',
    'compass/utilities/_general.scss',
    'compass/utilities/_links.scss',
    'compass/utilities/_lists.scss',
    'compass/utilities/_print.scss',
    'compass/utilities/_sprites.scss',
    'compass/utilities/_tables.scss',
    'compass/utilities/_text.scss',
    'compass/utilities/general/_clearfix.scss',
    'compass/utilities/general/_float.scss',
    'compass/utilities/general/_hacks.scss',
    'compass/utilities/general/_min.scss',
    'compass/utilities/general/_reset.scss',
    'compass/utilities/general/_tabs.scss',
    'compass/utilities/general/_tag-cloud.scss',
    'compass/utilities/links/_hover-link.scss',
    'compass/utilities/links/_link-colors.scss',
    'compass/utilities/links/_unstyled-link.scss',
    'compass/utilities/lists/_bullets.scss',
    'compass/utilities/lists/_horizontal-list.scss',
    'compass/utilities/lists/_inline-block-list.scss',
    'compass/utilities/lists/_inline-list.scss',
    'compass/utilities/sprites/_base.scss',
    'compass/utilities/sprites/_sprite-img.scss',
    'compass/utilities/tables/_alternating-rows-and-columns.scss',
    'compass/utilities/tables/_borders.scss',
    'compass/utilities/tables/_scaffolding.scss',
    'compass/utilities/text/_ellipsis.scss',
    'compass/utilities/text/_nowrap.scss',
    'compass/utilities/text/_replacement.scss'
  ], 'server', { isAsset: true })
})
<|endoftext|>


<commit_before>Package.describe({
  name: 'johnantoni:meteor-svginjector',
  version: '0.0.1',
  summary: 'Fast, caching, dynamic inline SVG DOM injection library ~ packaged for Meteor',
  git: 'https://github.com/johnantoni/meteor-svginjector.git',
  documentation: 'README.md'
});

Package.on_use(function(api) {
  api.add_files([
    'SVGInjector/svginjector.js'
  ], ['client']);
});
<commit_msg>Fix path.<commit_after>Package.describe({
  name: 'johnantoni:meteor-svginjector',
  version: '0.0.2',
  summary: 'Fast, caching, dynamic inline SVG DOM injection library ~ packaged for Meteor',
  git: 'https://github.com/johnantoni/meteor-svginjector.git',
  documentation: 'README.md'
});

Package.on_use(function(api) {
  api.add_files([
    'SVGInjector/svg-injector.js'
  ], ['client']);
});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Meteor sign up and sign in templates core package.",
    version: "1.3.1",
    name: "useraccounts:core",
    git: "https://github.com/meteor-useraccounts/core.git",
});

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

    api.use([
        "accounts-base",
        "check",
        "underscore",
        "iron:router",
        "reactive-var",
    ], ["client", "server"]);

    api.use([
        "blaze",
        "reactive-dict",
        "sha",
    ], "client");

    api.imply([
        "accounts-base",
        "softwarerero:accounts-t9n@1.0.2",
        "iron:router@1.0.3",
    ], ["client", "server"]);

    api.imply([
        "templating",
    ], ["client"]);

    api.add_files([
        "lib/field.js",
        "lib/core.js",
        "lib/server.js",
        "lib/methods.js",
    ], ["server"]);

    api.add_files([
        "lib/utils.js",
        "lib/field.js",
        "lib/core.js",
        "lib/client.js",
        "lib/templates_helpers/at_error.js",
        "lib/templates_helpers/at_form.js",
        "lib/templates_helpers/at_input.js",
        "lib/templates_helpers/at_nav_button.js",
        "lib/templates_helpers/at_oauth.js",
        "lib/templates_helpers/at_pwd_form.js",
        "lib/templates_helpers/at_pwd_form_btn.js",
        "lib/templates_helpers/at_pwd_link.js",
        "lib/templates_helpers/at_result.js",
        "lib/templates_helpers/at_sep.js",
        "lib/templates_helpers/at_signin_link.js",
        "lib/templates_helpers/at_signup_link.js",
        "lib/templates_helpers/at_social.js",
        "lib/templates_helpers/at_terms_link.js",
        "lib/templates_helpers/at_title.js",
        "lib/methods.js",
    ], ["client"]);

    api.export([
        "AccountsTemplates",
    ], ["client", "server"]);
});

Package.on_test(function(api) {
    api.use("useraccounts:core@1.3.1");

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

    api.add_files([
        "tests/tests.js",
    ], ["client", "server"]);
});
<commit_msg>patch release - Bump to version 1.3.2<commit_after>Package.describe({
    summary: "Meteor sign up and sign in templates core package.",
    version: "1.3.2",
    name: "useraccounts:core",
    git: "https://github.com/meteor-useraccounts/core.git",
});

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

    api.use([
        "accounts-base",
        "check",
        "underscore",
        "iron:router",
        "reactive-var",
    ], ["client", "server"]);

    api.use([
        "blaze",
        "reactive-dict",
        "sha",
    ], "client");

    api.imply([
        "accounts-base",
        "softwarerero:accounts-t9n@1.0.2",
        "iron:router@1.0.3",
    ], ["client", "server"]);

    api.imply([
        "templating",
    ], ["client"]);

    api.add_files([
        "lib/field.js",
        "lib/core.js",
        "lib/server.js",
        "lib/methods.js",
    ], ["server"]);

    api.add_files([
        "lib/utils.js",
        "lib/field.js",
        "lib/core.js",
        "lib/client.js",
        "lib/templates_helpers/at_error.js",
        "lib/templates_helpers/at_form.js",
        "lib/templates_helpers/at_input.js",
        "lib/templates_helpers/at_nav_button.js",
        "lib/templates_helpers/at_oauth.js",
        "lib/templates_helpers/at_pwd_form.js",
        "lib/templates_helpers/at_pwd_form_btn.js",
        "lib/templates_helpers/at_pwd_link.js",
        "lib/templates_helpers/at_result.js",
        "lib/templates_helpers/at_sep.js",
        "lib/templates_helpers/at_signin_link.js",
        "lib/templates_helpers/at_signup_link.js",
        "lib/templates_helpers/at_social.js",
        "lib/templates_helpers/at_terms_link.js",
        "lib/templates_helpers/at_title.js",
        "lib/methods.js",
    ], ["client"]);

    api.export([
        "AccountsTemplates",
    ], ["client", "server"]);
});

Package.on_test(function(api) {
    api.use("useraccounts:core@1.3.2");

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

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


<commit_before>Package.describe({
  name: 'cosmos:path-helpers',
  version: '0.1.0',
  summary: 'Adds pathFor/urlFor/linkTo helpers which need a router implementation package',
  git: 'http://github.com/elidoran/cosmos-path-helpers.git',
  documentation: 'README.md'
});

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

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

  api.addFiles([
    'lib/globalObject.js',
    'lib/linkPathHelpers.coffee',
    'lib/activePathHelpers.coffee'
    ], 'client'
  );

  api.export('PathHelpers', 'client');

});

Package.onTest(function(api) {
  api.use([
    'tinytest',
    'coffeescript',
    'cosmos:path-helpers'
  ], 'client');

  api.addFiles([
    'test/testPathOptionRequired.coffee',
    'test/testPathHelpers.coffee',
    'test/testActivePathHelpers.coffee'
  ], 'client');
});
<commit_msg>tweaked pacakage summary<commit_after>Package.describe({
  name: 'cosmos:path-helpers',
  version: '0.1.0',
  summary: 'Base package for pathFor/urlFor/linkTo/isPath helpers',
  git: 'http://github.com/elidoran/cosmos-path-helpers.git',
  documentation: 'README.md'
});

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

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

  api.addFiles([
    'lib/globalObject.js',
    'lib/linkPathHelpers.coffee',
    'lib/activePathHelpers.coffee'
    ], 'client'
  );

  api.export('PathHelpers', 'client');

});

Package.onTest(function(api) {
  api.use([
    'tinytest',
    'coffeescript',
    'cosmos:path-helpers'
  ], 'client');

  api.addFiles([
    'test/testPathOptionRequired.coffee',
    'test/testPathHelpers.coffee',
    'test/testActivePathHelpers.coffee'
  ], 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'ostrio:files',
  version: '1.5.0',
  summary: 'Fast and robust file uploads and streaming (Audio & Video), support FS or AWS, DropBox, Google Drive',
  git: 'https://github.com/VeliovGroup/Meteor-Files',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1');
  api.addFiles('files.coffee', ['server', 'client']);
  api.addAssets('worker.js', 'client');
  api.use('webapp', 'server');
  api.use(['templating', 'reactive-var', 'tracker'], 'client');
  api.use(['underscore', 'check', 'sha', 'ostrio:cookies@2.0.2', 'random', 'coffeescript'], ['client', 'server']);
  api.export('FilesCollection');
});

Npm.depends({
  'fs-extra': '0.28.0',
  'request': '2.72.0',
  'throttle': '1.0.3',
  'file-type': '3.8.0'
});
<commit_msg>Note for fs-extra<commit_after>Package.describe({
  name: 'ostrio:files',
  version: '1.5.0',
  summary: 'Fast and robust file uploads and streaming (Audio & Video), support FS or AWS, DropBox, Google Drive',
  git: 'https://github.com/VeliovGroup/Meteor-Files',
  documentation: 'README.md'
});

Package.onUse(function(api) {
  api.versionsFrom('1.1');
  api.addFiles('files.coffee', ['server', 'client']);
  api.addAssets('worker.js', 'client');
  api.use('webapp', 'server');
  api.use(['templating', 'reactive-var', 'tracker'], 'client');
  api.use(['underscore', 'check', 'sha', 'ostrio:cookies@2.0.2', 'random', 'coffeescript'], ['client', 'server']);
  api.export('FilesCollection');
});

Npm.depends({
  'fs-extra': '0.28.0', // NOTE: this package has dropped support for Node v0.10, since v0.29.0
  'request': '2.72.0',
  'throttle': '1.0.3',
  'file-type': '3.8.0'
});
<|endoftext|>


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

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

Package.onUse(function(api) {
  api.versionsFrom('1.1.0.2');
  api.use(['cosmos:browserify@0.5.1'], 'client');
  api.addFiles('npm.browserify.js', 'client');
  api.addFiles('npm.js', 'server');
  api.addFiles('export.js');
  if (api.export)
    api.export('Vertx');
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('jmusacchio:vertxbus');
  api.addFiles('vertxbus-tests.js');
});<commit_msg>Upgraded all javascript versions to latest ones. Libraries, packages, etc. Should work with vertx 3.3.0 version.<commit_after>Package.describe({
  name: 'jmusacchio:vertxbus',
  version: '0.1.0',
  // Brief, one-line summary of the package.
  summary: 'The Vert.x Event Bus Package allows any meteor app to be able to connect to Vert.x Components',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/jmusacchio/vertxbus',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

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

Package.onUse(function(api) {
  api.versionsFrom('1.2');
  api.use(['cosmos:browserify@0.10.0'], 'client');
  api.addFiles('npm.browserify.js', 'client');
  api.addFiles('npm.js', 'server');
  api.addFiles('export.js');
  if (api.export)
    api.export('Vertx');
});

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


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

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

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

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

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

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

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

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

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

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

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

  api.addFiles('tests/server/downloadUrlsTest.js', 'server');
});
<commit_msg>Specify base package versions to meet package publishing requirement<commit_after>/* global Package:false, Npm:false */

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

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

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

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

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

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

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

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

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

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

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


<commit_before>Package.describe({
  summary: "This is joshowens:accounts-entry, with some features that are not in the official release yet.",
  version: '1.1.1',
  name: "appworkshop:accounts-entry",
  githubUrl: 'https://github.com/AppWorkshop/accounts-entry',
});

Package.onUse(function (api) {
  api.versionsFrom("METEOR@1.4.2.3");

  api.use([
        'iron:router',
        'softwarerero:accounts-t9n',
        'joshowens:simple-form',
        'sacha:spin'],
      ['client', 'server']);
  // CLIENT
  api.use([
        'deps',
        'service-configuration',
        'accounts-base',
        'underscore',
        'templating',
        'handlebars',
        'session',
        'coffeescript',
        'less',
        'sha']
      , 'client');

  api.addFiles([
    '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/signUp/extraSignUpFields.html',
    'client/views/signUp/extraSignUpFields.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/enrollAccount/enrollAccount.html',
    'client/views/enrollAccount/enrollAccount.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/_wrapLinks.html',
    'client/views/accountButtons/signedIn.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/views/verificationPending/verificationPending.html',
    'client/views/verificationPending/verificationPending.coffee',
    'client/t9n/english.coffee',
    'client/t9n/french.coffee',
    'client/t9n/german.coffee',
    'client/t9n/italian.coffee',
    'client/t9n/polish.coffee',
    'client/t9n/spanish.coffee',
    'client/t9n/swedish.coffee',
    'client/t9n/portuguese.coffee',
    'client/t9n/slovene.coffee',
    'client/t9n/russian.coffee',
    'client/t9n/arabic.coffee',
    'client/t9n/hebrew.coffee'
  ], 'client');

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

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

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

});

Package.onTest(function (api) {
  api.use(['tinytest',
    'underscore',
    'handlebars',
    'test-helpers',
    'templating',
    'mongo-livedata',
    'coffeescript'
  ]);
  api.use(['iron:router', 'softwarerero:accounts-t9n', 'joshowens:simple-form'], ['client', 'server']);
  api.use('appworkshop:accounts-entry');

  api.addFiles(['tests/route.coffee', 'tests/client.html', 'tests/client.coffee'], 'client');
});
<commit_msg>Put versions back on the dependencies: not required locally, but apparently required to publish.<commit_after>Package.describe({
  summary: "This is joshowens:accounts-entry, with some features that are not in the official release yet.",
  version: '1.1.1',
  name: "appworkshop:accounts-entry",
  githubUrl: 'https://github.com/AppWorkshop/accounts-entry',
});

Package.onUse(function (api) {
  api.versionsFrom("METEOR@1.4.2.3");

  api.use([
    'ecmascript',
    'iron:router@1.0.13',
    'softwarerero:accounts-t9n@1.3.4',
    'joshowens:simple-form@0.2.1',
    'sacha:spin@2.3.1'

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

  api.addFiles([
    '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/signUp/extraSignUpFields.html',
    'client/views/signUp/extraSignUpFields.coffee',
    'client/views/forgotPassword/forgotPassword.html',
    'client/views/forgotPassword/forgotPassword.coffee',
    'client/views/resetPassword/resetPassword.html',
    'client/views/resetPassword/resetPassword.coffee',
    'client/views/enrollAccount/enrollAccount.html',
    'client/views/enrollAccount/enrollAccount.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/_wrapLinks.html',
    'client/views/accountButtons/signedIn.html',
    'client/views/accountButtons/accountButtons.coffee',
    'client/views/verificationPending/verificationPending.html',
    'client/views/verificationPending/verificationPending.coffee',
    'client/t9n/english.coffee',
    'client/t9n/french.coffee',
    'client/t9n/german.coffee',
    'client/t9n/italian.coffee',
    'client/t9n/polish.coffee',
    'client/t9n/spanish.coffee',
    'client/t9n/swedish.coffee',
    'client/t9n/portuguese.coffee',
    'client/t9n/slovene.coffee',
    'client/t9n/russian.coffee',
    'client/t9n/arabic.coffee',
    'client/t9n/hebrew.coffee'
  ], 'client');

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

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

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

});

Package.onTest(function (api) {
  api.use(['tinytest',
    'underscore',
    'handlebars',
    'test-helpers',
    'templating',
    'mongo-livedata',
    'coffeescript'
  ]);
  api.use(['iron:router', 'softwarerero:accounts-t9n', 'joshowens:simple-form'], ['client', 'server']);
  api.use('appworkshop:accounts-entry');

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


<commit_before>Package.describe({
  name: 'q42:memcached',
  summary: 'Memcached client for Meteor. Based on 3rd-eden node-memcached,version 2.0.0',
  version: '2.0.3',
  git: ' /* Fill me in! */ '
});

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

  api.addFiles(['lib/utils.js', 'lib/ms.js', 'lib/connection-parse.js', 'lib/simple-lru.js', 'lib/retry-operation.js',
  'lib/retry.js','lib/jackpot.js','lib/hashring.js','lib/connection.js','q42:memcached.js'], 'server');
  api.export('Memcached');

});

Package.onTest(function(api) {

});
<commit_msg>version number to 1.0.0<commit_after>Package.describe({
  name: 'q42:memcached',
  summary: 'Memcached client for Meteor. Based on 3rd-eden node-memcached,version 2.0.0',
  version: '1.0.0',
  git: ' /* Fill me in! */ '
});

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

  api.addFiles(['lib/utils.js', 'lib/ms.js', 'lib/connection-parse.js', 'lib/simple-lru.js', 'lib/retry-operation.js',
  'lib/retry.js','lib/jackpot.js','lib/hashring.js','lib/connection.js','q42:memcached.js'], 'server');
  api.export('Memcached');

});

Package.onTest(function(api) {

});
<|endoftext|>


<commit_before>Package.describe({
    summary: "Login service for Odnoklassniki.ru accounts (https://ok.ru)",
    version: "0.1.0",
    git: "https://github.com/mikepol/meteor-accounts-ok",
    name: "mikepol:accounts-ok"
});

Package.on_use(function(api) {
    api.versionsFrom('METEOR@0.9.0');
    api.use('accounts-base', ['client', 'server']);
    api.imply('accounts-base', ['client', 'server']);
    api.use('accounts-oauth', ['client', 'server']);
    api.imply('accounts-oauth', ['client', 'server']);

    api.use('jparker:crypto-md5', ['server']);

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

    api.add_files("lib/accounts_ok.js");
    api.add_files('lib/ok_client.js', 'client');
    api.add_files('lib/ok_server.js', 'server');

    api.export('OK');

    api.add_files(['lib/ok_configure.html', 'lib/ok_configure.js', 'lib/ok_styles.css'], 'client');

});
<commit_msg>fix version dep<commit_after>Package.describe({
    summary: "Login service for Odnoklassniki.ru accounts (https://ok.ru)",
    version: "0.1.0",
    git: "https://github.com/mikepol/meteor-accounts-ok",
    name: "mikepol:accounts-ok"
});

Package.on_use(function(api) {
    api.versionsFrom('METEOR@0.9.0');
    api.use('accounts-base', ['client', 'server']);
    api.imply('accounts-base', ['client', 'server']);
    api.use('accounts-oauth', ['client', 'server']);
    api.imply('accounts-oauth', ['client', 'server']);

    api.use('jparker:crypto-md5@0.1.1', ['server']);

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

    api.add_files("lib/accounts_ok.js");
    api.add_files('lib/ok_client.js', 'client');
    api.add_files('lib/ok_server.js', 'server');

    api.export('OK');

    api.add_files(['lib/ok_configure.html', 'lib/ok_configure.js', 'lib/ok_styles.css'], 'client');

});
<|endoftext|>


<commit_before>Package.describe({
    name: "froatsnook:stream-to-buffer",
    summary: "Read entire Stream into a Buffer (server only)",
    version: "1.0.0",
    git: "https://github.com/froatsnook/streamToBuffer"
});

Package.onUse(function(api) {
    api.versionsFrom("0.9.2");
    api.addFiles("lib/streamToBuffer.js");
    api.export("streamToBuffer", "server");
});

Package.onTest(function(api) {
    api.use("tinytest");
    api.use("froatsnook:stream-to-buffer");

    api.addFiles("test/streamToBuffer-tests.js");
});

<commit_msg>Bump version to 1.0.1.<commit_after>Package.describe({
    name: "froatsnook:stream-to-buffer",
    summary: "Read entire Stream into a Buffer (server only)",
    version: "1.0.1",
    git: "https://github.com/froatsnook/streamToBuffer"
});

Package.onUse(function(api) {
    api.versionsFrom("0.9.2");
    api.addFiles("lib/streamToBuffer.js");
    api.export("streamToBuffer", "server");
});

Package.onTest(function(api) {
    api.use("tinytest");
    api.use("froatsnook:stream-to-buffer");

    api.addFiles("test/streamToBuffer-tests.js");
});

<|endoftext|>


<commit_before>Package.describe({
    summary: "Simple chat windows. The star point to make your own chat",
    version: "0.2.5",
    name: "cesarve:simple-chat",
    git: "https://github.com/cesarve77/simple-chat"
});

Package.onUse(function (api) {
    api.use([
        'templating',
        'momentjs:moment@2.11.1',
        'check',
        'ecmascript',
        'jquery',
        'tracker',
        'reactive-var'
    ])
    api.use('matb33:collection-hooks@0.8.0', ['server', 'client'], {weak: true})

    api.versionsFrom('1.2.1');
    api.addFiles(['config.js','collections.js','methods.js'], ['client','server']);

    api.addFiles(['publications.js'], ['server']);
    api.addFiles(['methods_server.js'], ['server']);
    api.addFiles(['window.html', 'window.js', 'window.css','visivility.js'], ['client']);
    api.addFiles(['spinner.html','spinner.css'], ['client']);

    api.addAssets(['assets/bell.mp3'],'client')

    api.addAssets(['assets/fonts/chat.eot','assets/fonts/chat.woff','assets/fonts/chat.svg','assets/fonts/chat.ttf'],'client')
    api.export('SimpleChat')
});

<commit_msg>change packages version<commit_after>Package.describe({
    summary: "Simple chat windows. The star point to make your own chat",
    version: "0.2.6",
    name: "cesarve:simple-chat",
    git: "https://github.com/cesarve77/simple-chat"
});

Package.onUse(function (api) {
    api.use([
        'templating',
        'momentjs:moment@2.11.1',
        'check',
        'ecmascript',
        'jquery',
        'tracker',
        'reactive-var'
    ])
    api.use('matb33:collection-hooks@0.8.0', ['server', 'client'], {weak: true})

    api.versionsFrom('1.2.1');
    api.addFiles(['config.js','collections.js','methods.js'], ['client','server']);

    api.addFiles(['publications.js'], ['server']);
    api.addFiles(['methods_server.js'], ['server']);
    api.addFiles(['window.html', 'window.js', 'window.css','visivility.js'], ['client']);
    api.addFiles(['spinner.html','spinner.css'], ['client']);

    api.addAssets(['assets/bell.mp3'],'client')

    api.addAssets(['assets/fonts/chat.eot','assets/fonts/chat.woff','assets/fonts/chat.svg','assets/fonts/chat.ttf'],'client')
    api.export('SimpleChat')
});

<|endoftext|>


<commit_before>Package.describe({
  summary: "A Meteor admin tool loosely inspired by the Django admin site"
});

Package.on_use(function(api) {
  api.use('minimongo', 'client');
  api.use('mongo-livedata', 'client');
  api.use('templating', 'client');
  api.use('iron-router', ['client', 'server']);
  api.use('deps', ['client', 'server']);

  api.export('Admin');

  api.add_files('lib/admin.js', ['client', 'server']);
  api.add_files(['lib/main.html', 'lib/main.js', 'lib/main.css'], 'client');
  api.add_files('lib/router.js', ['client', 'server']);
});

/*
Package.on_test(function(api) {
  api.use('errors', 'client');
  api.use(['tinytest', 'test-helpers'], 'client');

  api.add_files('errors_tests.js', 'client');
});
*/
<commit_msg>Deleted lib/router.js - package.js modified<commit_after>Package.describe({
  summary: "A Meteor admin tool loosely inspired by the Django admin site"
});

Package.on_use(function(api) {
  api.use('minimongo', 'client');
  api.use('mongo-livedata', 'client');
  api.use('templating', 'client');
  api.use('iron-router', ['client', 'server']);
  api.use('deps', ['client', 'server']);

  api.export('Admin');

  api.add_files('lib/admin.js', ['client', 'server']);
  api.add_files(['lib/main.html', 'lib/main.js', 'lib/main.css'], 'client');
});

/*
Package.on_test(function(api) {
  api.use('errors', 'client');
  api.use(['tinytest', 'test-helpers'], 'client');

  api.add_files('errors_tests.js', 'client');
});
*/
<|endoftext|>


<commit_before>Package.describe({
  summary: "Ravelry OAuth flow",
  name: "amschrader:ravelry",
  git: "git@github.com:amschrader/ravelry.git",
  version: "0.1.0"
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('amschrader:ravelry');
  api.addFiles('ravelry-tests.js');
});

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

  api.export && api.export('Ravelry');

  api.add_files([
    'ravelry-configure.html',
    'ravelry-configure.js'
  ],'client');

  api.add_files('ravelry-server.js', 'server');
  api.add_files('ravelry-client.js', 'client');
});
<commit_msg>add version to the included packages<commit_after>Package.describe({
  summary: "Ravelry OAuth flow",
  name: "amschrader:ravelry",
  git: "git@github.com:amschrader/ravelry.git",
  version: "0.1.0"
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('amschrader:ravelry');
  api.addFiles('ravelry-tests.js');
});

Package.on_use(function(api) {
  api.use('http@1.0.8', ['client', 'server']);
  api.use('templating@1.0.9', 'client');
  api.use('oauth1@1.1.2', ['client', 'server']);
  api.use('oauth@1.1.2', ['client', 'server']);
  api.use('random@1.0.1', 'client');
  api.use('underscore@1.0.1', 'server');
  api.use('service-configuration@1.0.2', ['client', 'server']);

  api.export && api.export('Ravelry');

  api.add_files([
    'ravelry-configure.html',
    'ravelry-configure.js'
  ],'client');

  api.add_files('ravelry-server.js', 'server');
  api.add_files('ravelry-client.js', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Reactive map for Meteor',
  version: '0.2.1',
  name: 'jagi:reactive-map',
  git: 'https://github.com/jagi/meteor-reactive-map.git'
});

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

  api.use('underscore');

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

  api.export(['ReactiveMap'], ['client', 'server']);
});
<commit_msg>v0.2.2<commit_after>Package.describe({
  summary: 'Reactive map for Meteor',
  version: '0.2.2',
  name: 'jagi:reactive-map',
  git: 'https://github.com/jagi/meteor-reactive-map.git'
});

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

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

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

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


<commit_before>// package metadata file for Meteor.js

/* jshint strict:false */
/* global Package:true */

Package.describe({
    name: 'mark125:jsmaps',
    summary: 'A javascript map, and also with an abstraction layer for javascript mapping apis.',
    version: '0.0.13',
    git: 'https://github.com/markkr125/jsmaps.git',
    documentation: 'README.md'
});

Package.onUse(function (api) {
    api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0', 'METEOR@1.2']);

    var files = [
        'library/core.js',
        'library/core.abstract-helper.js',
        'library/core.abstract.js',
        'library/bing/core.bing.js',
        'library/bing/core.bing-geocoder.js',
        'library/bing/core.bing-staticmap.js',
        'library/google/core.google.js',
        'library/google/core.google-geocoder.js',
        'library/google/core.google-staticmap.js',
        'library/here/core.here.js',
        'library/here/core.here-geocoder.js',
        'library/here/core.here-staticmap.js',
        'library/here/core.here-vector.js',
        'library/native/core.native.css',
        'library/native/core.native.js',
        'library/native/core.native-helper.js',
        'library/native/core.native-infoWindow.js',
        'library/native/core.native-marker.js',
        'library/native/core.native-ui.js',
        'library/native/core.native-vector.js',
        'library/yandex/core.yandex.js',
        'library/yandex/core.yandex-geocoder.js',
        'library/yandex/core.yandex-staticmap.js'
    ];

    var assets = [
        'library/native/hand.cur',
        'library/native/fist.cur'
    ];

    api.addAssets(assets, 'client');
    api.addFiles(files, 'client');
});

<commit_msg>adding all files as assets<commit_after>// package metadata file for Meteor.js

/* jshint strict:false */
/* global Package:true */

Package.describe({
    name: 'mark125:jsmaps',
    summary: 'A javascript map, and also with an abstraction layer for javascript mapping apis.',
    version: '0.0.14',
    git: 'https://github.com/markkr125/jsmaps.git',
    documentation: 'README.md'
});

Package.onUse(function (api) {
    api.versionsFrom(['METEOR@0.9.0', 'METEOR@1.0', 'METEOR@1.2']);

    var assets = [
        'library/core.js',
        'library/core.abstract-helper.js',
        'library/core.abstract.js',
        'library/bing/core.bing.js',
        'library/bing/core.bing-geocoder.js',
        'library/bing/core.bing-staticmap.js',
        'library/google/core.google.js',
        'library/google/core.google-geocoder.js',
        'library/google/core.google-staticmap.js',
        'library/here/core.here.js',
        'library/here/core.here-geocoder.js',
        'library/here/core.here-staticmap.js',
        'library/here/core.here-vector.js',
        'library/native/core.native.css',
        'library/native/core.native.js',
        'library/native/core.native-helper.js',
        'library/native/core.native-infoWindow.js',
        'library/native/core.native-marker.js',
        'library/native/core.native-ui.js',
        'library/native/core.native-vector.js',
        'library/yandex/core.yandex.js',
        'library/yandex/core.yandex-geocoder.js',
        'library/yandex/core.yandex-staticmap.js',
        'library/native/hand.cur',
        'library/native/fist.cur'
    ];

    if (api.addAssets) {
        api.addAssets(assets, 'client');
    } else {
        api.addFiles(assets, 'client', { isAsset: true });
    }
});

<|endoftext|>


<commit_before>Package.describe({
    name: 'herrhelms:meteor-mailchimp-2',
    version: '0.0.1',
    summary: 'MailChimp API 2.0 ported to meteor (with custom signup form)',
    git: 'https://github.com/herrhelms/meteor-mailchimp-2.git',
    documentation: 'README.md'
});

Npm.depends({'mailchimp': '1.1.0'});

Package.onUse(function(api, where) {
    api.versionsFrom('1.1.0.2');
    api.use(['templating', 'session'], 'client');
    api.addFiles( 'server/mailchimp.js', 'server');
    api.addFiles(['client/subscribe.css', 'client/subscribe.html', 'client/subscribe.js', 'client/mailchimp.js'], 'client');
    api.export('MailChimp', ['server', 'client']);
});
<commit_msg>give miro credit<commit_after>Package.describe({
    name: 'herrhelms:meteor-mailchimp-2',
    version: '0.0.1',
    summary: 'MailChimp API 2.0 with custom subscribe form, based on miro:mailchimp',
    git: 'https://github.com/herrhelms/meteor-mailchimp-2.git',
    documentation: 'README.md'
});

Npm.depends({'mailchimp': '1.1.0'});

Package.onUse(function(api, where) {
    api.versionsFrom('1.1.0.2');
    api.use(['templating', 'session'], 'client');
    api.addFiles( 'server/mailchimp.js', 'server');
    api.addFiles(['client/subscribe.css', 'client/subscribe.html', 'client/subscribe.js', 'client/mailchimp.js'], 'client');
    api.export('MailChimp', ['server', 'client']);
});
<|endoftext|>


<commit_before>#!/usr/bin/env node
require('colors')
var fs = require('fs')
var path = require('path')
var tarballify = require('tarballify')
var version = require('./lib/version')
var name = require('./lib/name')

console.log("creating new tarball …".green)
var tarball = tarballify("./lib/main.js", {
    dirname:__dirname,
    cache:false,
})
    .on('warn',  function(w){console.warn( "WARN".yellow,w)})
    .on('error', function(e){console.error("ERR ".red   ,e)})
    .on('skip',  function(s){console.log( "skip".bold.blue,s.name.cyan,s.dirname)})
    .on('wait', function(){console.log("waiting for tarball to finish …".green)})
//     .on('append', function(f,e){console.log("append",f.props.size,"\t",e.name, "\t",f.path)})
    .on('close', function(){console.log("done.".bold.green)})
//     .on('syntaxError', console.error.bind(console))
tarball.pipe(fs.createWriteStream(path.join(__dirname, name+"-"+version+".tar.gz")))
;[
    // fix 'modName is not defined'
    "node_modules/ltx/lib/sax_expat.js",
    "node_modules/ltx/lib/sax_ltx.js",
    "node_modules/ltx/lib/sax_saxjs.js",
    // server files
    "config.js.example",
    "package.json",
    "postgres.sql",
    "LICENSE",
    "README.md"
].forEach(function(file){tarball.append(file)})
;[
    "fixed 'modName is not defined'.",
    "'file is not defined' in jsconfig can be ignored.",
].forEach(function(msg){console.log(msg.bold.black)})

console.log("setup ready …".green)
tarball.end()
<commit_msg>add bin/buddycloud-server to the tarball<commit_after>#!/usr/bin/env node
require('colors')
var fs = require('fs')
var path = require('path')
var tarballify = require('tarballify')
var version = require('./lib/version')
var name = require('./lib/name')

console.log("creating new tarball …".green)
var tarball = tarballify("./lib/main.js", {
    dirname:__dirname,
    cache:false,
})
    .on('warn',  function(w){console.warn( "WARN".yellow,w)})
    .on('error', function(e){console.error("ERR ".red   ,e)})
    .on('skip',  function(s){console.log( "skip".bold.blue,s.name.cyan,s.dirname)})
    .on('wait', function(){console.log("waiting for tarball to finish …".green)})
//     .on('append', function(f,e){console.log("append",f.props.size,"\t",e.name, "\t",f.path)})
    .on('close', function(){console.log("done.".bold.green)})
//     .on('syntaxError', console.error.bind(console))
tarball.pipe(fs.createWriteStream(path.join(__dirname, name+"-"+version+".tar.gz")))
;[
    // fix 'modName is not defined'
    "node_modules/ltx/lib/sax_expat.js",
    "node_modules/ltx/lib/sax_ltx.js",
    "node_modules/ltx/lib/sax_saxjs.js",
    // server files
    "bin/buddycloud-server",
    "config.js.example",
    "package.json",
    "postgres.sql",
    "LICENSE",
    "README.md"
].forEach(function(file){tarball.append(file)})
;[
    "fixed 'modName is not defined'.",
    "'file is not defined' in jsconfig can be ignored.",
].forEach(function(msg){console.log(msg.bold.black)})

console.log("setup ready …".green)
tarball.end()
<|endoftext|>


<commit_before>Package.describe({
  name: "robertlowe:autoform-pickadate",
  version: "0.1.0",
  summary: "pickadate.js for autoform",
  git: "https://github.com/robertlowe/autoform-pickadate"
});

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

  api.use('templating');
  api.use('underscore');
  api.use('jquery');
  api.use('tracker');
  api.use('coffeescript');
  api.use('mquandalle:jade');
  api.use('aldeed:autoform');
  api.use('robertlowe:pickadate@3.5.5');
  api.use('aldeed:template-extension@3.4.1');

  api.addFiles('autoform-pickadate.jade', 'client');
  api.addFiles('autoform-pickadate.coffee', 'client');
});

Package.onTest(function (api) {
});<commit_msg>Bump version<commit_after>Package.describe({
  name: "robertlowe:autoform-pickadate",
  version: "0.1.1",
  summary: "pickadate.js for autoform",
  git: "https://github.com/robertlowe/autoform-pickadate"
});

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

  api.use('templating');
  api.use('underscore');
  api.use('jquery');
  api.use('tracker');
  api.use('coffeescript');
  api.use('mquandalle:jade');
  api.use('aldeed:autoform');
  api.use('robertlowe:pickadate@3.5.5');
  api.use('aldeed:template-extension@3.4.1');

  api.addFiles('autoform-pickadate.jade', 'client');
  api.addFiles('autoform-pickadate.coffee', 'client');
});

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


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

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

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

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

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

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

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

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

  api.add_files([
    'tests/tests.js'
  ], ['client', 'server']);
});
<commit_msg>renaming package<commit_after>Package.describe({
  summary: 'Accounts Templates styled for Twitter Bootstrap.',
  version: '1.12.3',
  name: 'kevbuk:useraccounts-bootstrap',
  git: 'https://github.com/kevb/bootstrap.git',
});

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

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

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

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

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

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

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

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


<commit_before>Package.describe({
  name: 'patrickml:braintree',
  version: '1.0.4',
  // Brief, one-line summary of the package.
  summary: 'Complete Sync wrapper for Braintree Payments.',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/patrickml/braintree',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

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

  api.addFiles('braintree.js', "server");
  api.export([
    'Braintree',
    'BrainTreeConnect'
  ], 'server');
});

Npm.depends({
  braintree: '1.27.0'
});

Package.onTest(function(api) {
  api.use('tinytest');
  api.use('patrickml:braintree');
  api.addFiles('braintree-tests.js');
});
<commit_msg>Update to current Braintree Node library version<commit_after>Package.describe({
  name: 'patrickml:braintree',
  version: '1.0.4',
  // Brief, one-line summary of the package.
  summary: 'Complete Sync wrapper for Braintree Payments.',
  // URL to the Git repository containing the source code for this package.
  git: 'https://github.com/patrickml/braintree',
  // By default, Meteor will default to using README.md for documentation.
  // To avoid submitting documentation, set this field to null.
  documentation: 'README.md'
});

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

  api.addFiles('braintree.js', "server");
  api.export([
    'Braintree',
    'BrainTreeConnect'
  ], 'server');
});

Npm.depends({
  braintree: '1.29.0'
});

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


<commit_before>Package.describe({
  summary: 'Relations for Meteor Astronomy',
  version: '0.1.2',
  name: 'jagi:astronomy-relations',
  git: 'https://github.com/jagi/meteor-astronomy-relations.git'
});

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

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

  api.imply('jagi:astronomy');

  // Module.
  api.addFiles([
    'lib/module/init_module.js',
    'lib/module/init_schema.js',
    'lib/module/init_definition.js',
    'lib/module/init_class.js',
    'lib/module/init_instance.js'
  ], ['client', 'server']);
});
<commit_msg>Updated Astro to 1.2.0<commit_after>Package.describe({
  summary: 'Relations for Meteor Astronomy',
  version: '0.1.2',
  name: 'jagi:astronomy-relations',
  git: 'https://github.com/jagi/meteor-astronomy-relations.git'
});

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

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

  api.imply('jagi:astronomy');

  // Module.
  api.addFiles([
    'lib/module/init_module.js',
    'lib/module/init_schema.js',
    'lib/module/init_definition.js',
    'lib/module/init_class.js',
    'lib/module/init_instance.js'
  ], ['client', 'server']);
});
<|endoftext|>


<commit_before>Package.describe({
  name: 'ffxsam:react-smartform',
  version: '0.1.0',
  summary: 'Smart form elements for React',
  git: 'https://github.com/ffxsam/meteor-react-smartform',
  documentation: 'README.md'
});

Package.onUse(function (api) {
  api.versionsFrom('1.2.1');
  api.use('ecmascript');
  api.use('react');
  api.use('react-meteor-data');
  api.use('meteorflux:dispatcher@1.2.0');
  api.use('meteorflux:reactive-state@1.1.1');
  api.addFiles([
    'lib/symbols.js',
    'lib/form-state.js',
    'lib/form-store.js',
    'components/SmartInput.jsx',
    'components/SmartError.jsx',
    'components/SmartForm.jsx'
  ], 'client');
  api.export('SmartForm', 'client');
  api.export('FormState', 'client'); //TODO: remove before release
});
<commit_msg>Removed export (while in dev)<commit_after>Package.describe({
  name: 'ffxsam:react-smartform',
  version: '0.1.0',
  summary: 'Smart form elements for React',
  git: 'https://github.com/ffxsam/meteor-react-smartform',
  documentation: 'README.md'
});

Package.onUse(function (api) {
  api.versionsFrom('1.2.1');
  api.use('ecmascript');
  api.use('react');
  api.use('react-meteor-data');
  api.use('meteorflux:dispatcher@1.2.0');
  api.use('meteorflux:reactive-state@1.1.1');
  api.addFiles([
    'lib/symbols.js',
    'lib/form-state.js',
    'lib/form-store.js',
    'components/SmartInput.jsx',
    'components/SmartError.jsx',
    'components/SmartForm.jsx'
  ], 'client');
  api.export('SmartForm', 'client');
});
<|endoftext|>


<commit_before>Package.describe({
  summary: 'Iron namespace and utilities.',
  version: '1.0.0-pre1',
  git: 'https://github.com/eventedmind/iron-core'
});

Package.on_use(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  // dependencies
  api.use('underscore');

  // for cloning
  api.use('ejson');

  // remove migrated version
  api.use('cmather:iron-core@0.2.0', {weak: true});

  api.add_files('lib/version_conflict_error.js');
  api.add_files('lib/iron_core.js');

  // symbol exports
  api.export('Iron');
});

Package.on_test(function (api) {
  api.use('iron:core');
  api.use('tinytest');
  api.use('test-helpers');
  api.add_files('test/iron_core_test.js');
});
<commit_msg>bump version to 1.0.0-pre2<commit_after>Package.describe({
  summary: 'Iron namespace and utilities.',
  version: '1.0.0-pre2',
  git: 'https://github.com/eventedmind/iron-core'
});

Package.on_use(function (api) {
  api.versionsFrom('METEOR@0.9.2');

  // dependencies
  api.use('underscore');

  // for cloning
  api.use('ejson');

  // remove migrated version
  api.use('cmather:iron-core@0.2.0', {weak: true});

  api.add_files('lib/version_conflict_error.js');
  api.add_files('lib/iron_core.js');

  // symbol exports
  api.export('Iron');
});

Package.on_test(function (api) {
  api.use('iron:core');
  api.use('tinytest');
  api.use('test-helpers');
  api.add_files('test/iron_core_test.js');
});
<|endoftext|>


<commit_before>// title      : thumb
// author     : Gino Tubaro
// license    : MIT License
// description: just a thumb
// file       : palma.jscad
//!OpenSCAD
//Hay que parametrizara

include('lodash.js');

include("formulas.jscad");

include("node_modules/jscad-utils/jscad-utils.jscad");
include("node_modules/jscad-utils/jscad-utils-color.jscad");

include('node_modules/jscad-utils/jscad-utils-parts.jscad');
include('node_modules/jscad-utils/jscad-boxes.jscad');

include("tornillotuerca.jscad");
// TODO: limpiar costado izquierdo
// Arreglar protuberancia pulgar
// arreglar tapa
// ver que pasa cuando proporcion alto => long*1/4
// tuerca pulgar
// thinkness
// agregar texto "Atomic Lab" y el nombre de usuario
var result,xbo;
var long=120;
var alto=30;
var muneca=15;// nada
var pinconector=2;
var tornilloconector=3;
var pulgar =1;
function main()
{
	util.init(CSG);
	var palma = palmagenerator(alto, long, muneca, pulgar);
	return palma;
}

function slider(alto) { //limpiar

	var o = new Array(); //shape of the palm
	var g = new Array(); //object 3D
	var d = new Array(); //object 3D
	var x = new Array();
	var k = new Array();
	var b = new Array();
	var last=1;
	var long=0;
	x.push(square({size: [alto*4,alto*4]}).center('x'));
	o.push(circle({r:alto, center:true}).translate([alto,0,0]));
	o.push(circle({r:alto, center:true}).translate([-alto,0,0]));
	g.push(linear_extrude({ height: 5 }, hull(o)));
	d.push(linear_extrude({ height: 8 }, hull(x)));
	b.push(union(g).subtract(union(d)));
		///cuerpo sin parteabajoish
	k.push(square({size: [alto*4,10], center: true}).translate([0, 5, 0]));

	b.push(linear_extrude({ height: 5 }, hull(k)));

	var todo = union(
		Parts.Triangle(5, alto*5).translate([0, -1, -1]),
		Parts.Triangle(5, alto*5).translate([5, -1, -1]),
		cube({size: [5, 10, alto*5], center: [true, true, false]}).translate([2.5, -6, 0])
	);

	todo= union(b).subtract(todo.rotateX(-90).rotateZ(90).snap(union(b), 'x', 'inside-').translate([-1, -1, 0]));
	todo= todo.subtract(cylinder({r: 1, h: 20, center: true}).rotateX(-90).snap(todo, 'x', 'center-').translate([-1,0, 2]));

	todo=todo.subtract(cube({size: [10, 10, 5], center: [true, true, true]}).snap(todo,'y','outside+').translate([5, 0, 0]) );

	return todo;

}

function bajorelieve(height,prof, alto) { //corregir el cilindro
	var h = hull(
		square({size: [(alto*4)-10,1], center: true}).translate([0, height-height/4,0 ]),
		circle({r: alto, center: true}).translate([0,-height*0.003125,0])
	);
	var tapa = linear_extrude({ height: prof }, h);

	return tapa.rotateX(90);

}

function conectores(alto) {
	var o = new Array();
	o.push(cube({size: [alto*4, 2, alto/2], center: [true, true, true]}).translate([0, 2, alto/2.5]));
	o.push(cube({size: [alto*4, 2, alto/2], center: [true, true, true]}).translate([0, -2, alto/2.5]));
	o.push(cylinder({r: 2.75, h: alto, center: [true, true, true]}).rotateX(90).rotateZ(90).translate([0, 5, alto-5]));

	return union(o);
}
function contornos(alto,ancho) {
	var o = new Array();
	console.log("gino"+ancho);
	o.push(cylinder({r: ancho, h: alto, center: [true, true, true]}).rotateX(90).rotateZ(90).translate([0, -ancho, alto])); //contorno de conectores
	o.push(cylinder({r: ancho+ancho/2, h: alto, center: [true, true, true]}).rotateX(90).translate([0, -ancho, alto-ancho/2])); //contorno de tapa
	return union(o);
}
function cuerpito(h,ancho) {
	var o = new Array();
	var thi=10;
	o.push(circle({r:ancho-thi/2, center:true}).translate([ancho,0,0]));
	o.push(circle({r:ancho-thi/2, center:true}).translate([-ancho,0,0]));
	o.push(square({size: [ancho*4-thi,10], center: true}).translate([0, 5, 0]));
	o.push(square({size:[ancho*4-thi,40], center:true}).translate([0, 20, 0]))

	o = linear_extrude({ height: h }, hull(o));

	return o //o.scale([0.75,0.7,2]);
}

function palmagenerator(ancho, height,muneca,pulgar) {

	var cag = CAG.fromPoints([
		[-1, -1, 0],
		[1, -1, 0],
		[1, 1, 0]
	]).expand(1, CSG.defaultResolution2D);

	var flatBottom = CSG.Polygon.createFromPoints(
		cag.getOutlinePaths()[0].points
	);

	var tope;
	var thing = flatBottom.solidFromSlices({
		numslices: height
		,callback: function(t) {
			var coef = t;

			var o = new Array();
			if (coef < 0.01) coef = 0.01;//must not collapse polygon
			var h = height*t;
			var y = 0;
			var b = alto+Math.sin(coef*4);
			o.push(circle({r:b, center:true}).translate([ancho,0,0]));
			o.push(circle({r:b, center:true}).translate([-ancho,0,0]));
			if (pulgar) {
				//				if ((h>=height/7)&&(h<=(height*2/3))){
				if (height*2/3>=50) { //pongo valor de altura fijo a la curvatura pulgar
					tope = 50;
				}else {
					tope=height*2/3;
				}

				if ((h>=0.1)&&(h<=(tope))){
					var vals = calculate(0.1,tope,alto+4,0);
					x = (vals[0]*Math.pow(h,2)) + (vals[1]*h) + vals[2];
					o.push(circle({r: x/2, center: true}).translate([alto*2, 8, 0]))
				}
			}

			o.push(square({size: [alto*4,10], center: true}).translate([0, 5, 0]));

			cag =  hull(o); //.expand(1,CSG.defaultResolution2D)

			var cage = CAG.circle({
				center: [0,0],
				ancho: 3*Math.sin(coef*1.2),
				resolution: 32
			}).expand(1, CSG.defaultResolution2D);

			var cags = CAG.fromPoints([
				[-1, -1, h],
				[1, -1, h],
				[1 , 1, h],
				[-1, 1, h]
			]).expand(1, CSG.defaultResolution2D);

			return CSG.Polygon.createFromPoints(
				cag.getOutlinePaths()[0].points
			).translate([0, 0, h]);
		}
	});

	var palma=
	difference(
		union(thing,slider(alto).mirroredZ()).fillet(3,'z+'),
		cuerpito(height,ancho),
		conectores(height),
		contornos(height,ancho)

	);
	function oppulgar() {
		var cubo = new Array();
		var th=3;
		cubo.push(cube({size: [th, 10, long/2-4], center: [true, false, false]})
		.snap(palma,'y','outside-')
		.translate([(alto*2)-th, -alto+th, 4])
	);

	return union(cubo);
}

//  palma= palma.snap(bajorelieve(height), 'x', 'center-');
todo= bajorelieve(height,8,alto)
.snap(palma, 'y', 'outside+')
.translate([0, 3, height/3]);

todo=difference(palma,todo,oppulgar());
var todosin=todo;
todo=
union(
	difference(
		todo,

		cylinder({r: 3, h: 5, center: [true, true, true]}) //cilindrotapa
		.rotateY(90)
		.rotateZ(90)
		.snap(todo,'y','outside+')
		.translate([0, 4, (height/2.5)+5]),

		cylinder({r: 3, h: muneca/2, center: [true, true, true]})
		.rotateY(90)
		.snap(palma,'y','outside-')
		.snap(palma,'x','outside-')
		.translate([-6.25, -alto, tope*0.5]),

		cube({size: [alto*2-5, alto*4, long+10], center: [true, false, false]}) //Cubo que "limpia" el borde derecho
		.translate([-20, 10, 0])

	),
	tornillotuerca(4,2.5)[0]//tuerca de tapa
	.rotateX(90)
	.snap(todo,'y','outside+')
	.translate([0, 4, (height/2.5)+5]),

	tornillotuerca(6,1.75)[0] //tuerca de pulgar
	.rotateY(90)
	.snap(palma,'y','outside-')
	.snap(palma,'x','outside-')
	.translate([-6.25, -alto, tope*0.5])

)
todo =
difference(
	todo,
	difference(cylinder({r:8, h:8, center:[true,true,true]})//tuerca de pulgar
	.rotateY(90)
	.snap(palma,'y','outside-')
	.snap(palma,'x','outside-')
	.translate([-6.25, -alto, tope*0.5])
	,
	todosin)
);

return todo;//difference(todo,difference(todo,todosin));

}
<commit_msg>fix de tuerca tapa, y sobresaliente de los costados<commit_after>// title      : thumb
// author     : Gino Tubaro
// license    : MIT License
// description: just a thumb
// file       : palma.jscad
//!OpenSCAD
//Hay que parametrizara

include('lodash.js');

include("formulas.jscad");

include("node_modules/jscad-utils/jscad-utils.jscad");
include("node_modules/jscad-utils/jscad-utils-color.jscad");

include('node_modules/jscad-utils/jscad-utils-parts.jscad');
include('node_modules/jscad-utils/jscad-boxes.jscad');

include("tornillotuerca.jscad");
// TODO:
// Arreglar protuberancia pulgar
// arreglar tapa
// ver que pasa cuando proporcion alto => long*1/4
// posicion tuerca pulgar
// thinkness
// agregar texto "Atomic Lab" y el nombre de usuario
//curvabezier en contornos
var result,xbo;
var long=60;
var alto=10;
var muneca=15;// nada
var pinconector=2;
var tornilloconector=3;
var pulgar =1;
function main()
{
	util.init(CSG);
	var palma = palmagenerator(alto, long, muneca, pulgar);
	//console.log(palma.getfeatures(['volume']));
	return palma;
}

function slider(alto) { //limpiar

	var o = new Array(); //shape of the palm
	var g = new Array(); //object 3D
	var d = new Array(); //object 3D
	var x = new Array();
	var k = new Array();
	var b = new Array();
	var last=1;
	var long=0;
	x.push(square({size: [alto*4,alto*4]}).center('x'));
	o.push(circle({r:alto, center:true}).translate([alto,0,0]));
	o.push(circle({r:alto, center:true}).translate([-alto,0,0]));
	g.push(linear_extrude({ height: 5 }, hull(o)));
	d.push(linear_extrude({ height: 8 }, hull(x)));
	b.push(union(g).subtract(union(d)));
	///cuerpo sin parteabajoish
	k.push(square({size: [alto*4,10], center: true}).translate([0, 5, 0]));

	b.push(linear_extrude({ height: 5 }, hull(k)));

	var todo = union(
		Parts.Triangle(5, alto*5).translate([0, -1, -1]),
		Parts.Triangle(5, alto*5).translate([5, -1, -1]),
		cube({size: [5, 10, alto*5], center: [true, true, false]}).translate([2.5, -6, 0])
	);

	todo= union(b).subtract(todo.rotateX(-90).rotateZ(90).snap(union(b), 'x', 'inside-').translate([-1, -1, 0]));
	todo= todo.subtract(cylinder({r: 1, h: 20, center: true}).rotateX(-90).snap(todo, 'x', 'center-').translate([-1,0, 2]));

	todo=todo.subtract(cube({size: [10, 10, 5], center: [true, true, true]}).snap(todo,'y','outside+').translate([5, 0, 0]) );

	return todo;

}

function bajorelieve(height,prof, alto) { //corregir el cilindro
	var h = hull(
		square({size: [(alto*4)-10,1], center: true}).translate([0, height-height/4,0 ]),
		circle({r: alto, center: true}).translate([0,-height*0.003125,0])
	);
	var tapa = linear_extrude({ height: prof }, h);

	return tapa.rotateX(90);

}

function conectores(alto) {
	var o = new Array();
	o.push(cube({size: [alto*4, 2, alto/2], center: [true, true, true]}).translate([0, 2, alto/2.5]));
	o.push(cube({size: [alto*4, 2, alto/2], center: [true, true, true]}).translate([0, -2, alto/2.5]));
	o.push(cylinder({r: 2.75, h: alto, center: [true, true, true]}).rotateX(90).rotateZ(90).translate([0, 5, alto-5]));

	return union(o);
}
function contornos(alto,ancho) {
	var o = new Array();
	console.log("gino"+ancho);
	o.push(cylinder({r: ancho, h: alto, center: [true, true, true]}).rotateX(90).rotateZ(90).translate([0, -ancho, alto])); //contorno de conectores
	o.push(cylinder({r: ancho+ancho/2, h: alto, center: [true, true, true]}).rotateX(90).translate([0, -ancho, alto-ancho/2])); //contorno de tapa
	return union(o);
}
function cuerpito(h,ancho) {
	var o = new Array();
	var thi=10;
	o.push(circle({r:ancho-thi/2, center:true}).translate([ancho,0,0]));
	o.push(circle({r:ancho-thi/2, center:true}).translate([-ancho,0,0]));
	o.push(square({size: [ancho*4-thi,10], center: true}).translate([0, 5, 0]));
	o.push(square({size:[ancho*4-thi,40], center:true}).translate([0, 20, 0]))

	o = linear_extrude({ height: h }, hull(o));

	return o //o.scale([0.75,0.7,2]);
}

function palmagenerator(ancho, height,muneca,pulgar) {

	var cag = CAG.fromPoints([
		[-1, -1, 0],
		[1, -1, 0],
		[1, 1, 0]
	]).expand(1, CSG.defaultResolution2D);
	var flatBottom = CSG.Polygon.createFromPoints(
		cag.getOutlinePaths()[0].points
	);

	var tope;

	var thing = flatBottom.solidFromSlices({
		numslices: height
		,callback: function(t) {
			var coef = t;

			var o = new Array();
			if (coef < 0.01) coef = 0.01;//must not collapse polygon
			var h = height*t;
			var y = 0;
			var b = alto+Math.sin(coef*4);

			o.push(circle({r:b, center:true}).translate([ancho,0,0]).subtract(square({size: [alto*4,alto*4]}).center('x')));
			o.push(circle({r:b, center:true}).translate([-ancho,0,0]).subtract(square({size: [alto*4,alto*4]}).center('x')));
			if (pulgar) {
				//				if ((h>=height/7)&&(h<=(height*2/3))){
				if (height*2/3>=50) { //pongo valor de altura fijo a la curvatura pulgar
					tope = 50;
				}else {
					tope=height*2/3;
				}

				if ((h>=0.1)&&(h<=(tope))){
					var vals = calculate(0.1,tope,alto+4,0);
					x = (vals[0]*Math.pow(h,2)) + (vals[1]*h) + vals[2];
					o.push(circle({r: x/2, center: true}).translate([alto*2, 8, 0]))
				}
			}

			o.push(square({size: [alto*4,10], center: true}).translate([0, 5, 0]));

			cag =  hull(o); //.expand(1,CSG.defaultResolution2D)

			var cage = CAG.circle({
				center: [0,0],
				ancho: 3*Math.sin(coef*1.2),
				resolution: 32
			}).expand(1, CSG.defaultResolution2D);

			var cags = CAG.fromPoints([
				[-1, -1, h],
				[1, -1, h],
				[1 , 1, h],
				[-1, 1, h]
			]).expand(1, CSG.defaultResolution2D);

			return CSG.Polygon.createFromPoints(
				cag.getOutlinePaths()[0].points
			).translate([0, 0, h]);
		}
	});

	var palma=
	difference(
		union(thing,slider(alto).mirroredZ()).fillet(3,'z+'),
		cuerpito(height,ancho),
		conectores(height),
		contornos(height,ancho)

	);
	function oppulgar() {
		var cubo = new Array();
		var th=3;
		cubo.push(cube({size: [th, 10, long/2-4], center: [true, false, false]})
		.snap(palma,'y','outside-')
		.translate([(alto*2)-th, -alto+th, 4])
	);

	return union(cubo);
}

//  palma= palma.snap(bajorelieve(height), 'x', 'center-');
todo= bajorelieve(height,8,alto)
.snap(palma, 'y', 'outside+')
.translate([0, 3, height/3]);

todo=difference(palma,todo,oppulgar());
var todosin=todo;
todo=
union(
	difference(
		todo,
		cylinder({r: 3, h: alto*4, center: [true, true, true]}) //cilindrotapa
		.rotateX(90)
		.translate([0, 0, (height/2.5)+5]),
		cylinder({r: 3, h: muneca/2, center: [true, true, true]}) //cilindropulgar
		.rotateY(90)
		.snap(palma,'y','outside-')
		.snap(palma,'x','outside-')
		.translate([-6.25, -alto, tope*0.5])

	),
	tornillotuerca(4,2.5)[0]//tuerca de tapa
	.rotateX(90)
	.snap(todo,'y','outside+')
	.translate([0, 4, (height/2.5)+5]),

	tornillotuerca(6,1.75)[0] //tuerca de pulgar
	.rotateY(90)
	.snap(palma,'y','outside-')
	.snap(palma,'x','outside-')
	.translate([-6.25, -alto, tope*0.5])
)
todo =
difference(
	todo,
	difference(cylinder({r:8, h:8, center:[true,true,true]})//tuerca de pulgar
	.rotateY(90)
	.snap(palma,'y','outside-')
	.snap(palma,'x','outside-')
	.translate([-6.25, -alto, tope*0.5]),
	todosin)
);

return todo;//difference(todo,difference(todo,todosin));

}
<|endoftext|>


<commit_before>'use strict';

const PriorityQueue = require('js-priority-queue');

let maps = {
	count: new WeakMap(),
	drain: new WeakMap(),
	max: new WeakMap(),
	origin: new WeakMap(),
	queue: new WeakMap()
};

function promisify(fn) {
	return function() {
		let result;

		try {
			result = fn.apply(this, arguments);

			if (result instanceof Promise || (result != null && typeof result === 'object' && typeof result.then === 'function' && typeof result.catch === 'function')) {
				return result;
			}
		} catch(err) {
			return Promise.reject(err);
		}

		return Promise.resolve(result);
	};
}

/**
 * Attempts to fill any available pool slots and spawn appropriate objects.
 *
 * @private
 */
function fill() {
	let queue = maps.queue.get(this);

	// While the current count is less than the allotted maximum and there are outstanding acquisition
	// requests, attempt to fill the available space.
	while (this.count < this.max && this.waiting > 0) {
		spawn.call(this, queue.dequeue());
	}
}

/**
 *
 */
function noop() {}

/**
 *
 * @param {Number} a
 * @param {Number} b
 * @returns {Number}
 */
function queueComparator(a, b) {
	return b.priority - a.priority;
}

/**
 * Normalizes the spawning process of the pool elements and appropriately tracks the number of active,
 * fulfilled requests.
 *
 * @private
 * @param {Object} deferred An internal "deferred" object that can be used to reject or resolve the original
 *     acquisition requests.
 * @returns {Promise} A promise that is resolved when the pool object is successfully created.
 */
function spawn(deferred) {
	let self = this;

	// Make sure to increase the counter. If there is an error during creation we'll just decrease the counter
	// again. But if the object takes a particularly long time to create we don't want any other acquisition
	// requests cutting in line.
	let count = maps.count.get(this);

	count++;
	maps.count.set(this, count);

	return this._create()
		.then(function(obj) {
			// When the object is successfully created, mark it as originating from this pool.
			maps.origin.set(obj, self);

			// Resolve the original acquisition request.
			deferred.resolve(obj);
		})
		.catch(function(err) {
			// There was an error during object creation, so reject the original acquisition request.
			deferred.reject(err);

			// Decrease the count of the pool to "undo" the pre-emptive increment.
			count--;
			maps.count.set(self, count);
		});
}

/**
 * A class that serves as a constructor for the default object acquired from the pool if no creation function is
 * specified.
 *
 * @private
 * @constructor
 */
class Slot {
	constructor() {}

	static create() {
		return new Slot();
	}
}

/**
 * Placeholder.
 *
 * @class
 * @param {Object} options A configuration object.
 * @param {Function} options.create A function that will be called to create a new pool element. Can be synchronous or
 *     asynchronous. The function must not return pool elements that are of type 'undefined', 'null', 'number',
 *     'boolean', or 'string'. Only 'object' types and its derivatives are supported.
 * @param {Function} [options.destroy] A function that will be called to destroy a pool element. Will be passed the
 *     pool element marked for destruction as the only argument.
 * @param {Number} [max=1] The initial maximum number of objects in the pool. Must be a positive integer greater than
 *     0. Non-conforming values are coerced with truncation or, failing that, defaulting back to 1.
 */
class Pool {
	constructor(options = {}) {
		// An internal count of the currently fulfilled acquisition requests.
		maps.count.set(this, 0);
		// An internal reference to keep track of the maximum size of the pool.
		maps.max.set(this, Infinity);
		// An internal priority queue for keeping track of acquisition requests.
		maps.queue.set(this, new PriorityQueue({
			comparator: queueComparator
		}));

		// A asynchronous/synchronous normalized version of the supplied create option.
		this._create = promisify(options.create || Slot.create);
		// A asynchronous/synchronous normalized version of the supplied destroy option.
		this._destroy = promisify(options.destroy || noop);

		this.max = options.max;
	}

	/**
	 * Acquires a new object from the pool asynchronously. The returned Promise will resolve when there is a free slot
	 * available in the pool. However the promise will be rejected if any errors are encountered during object creation
	 * (using the configured options.create function) or if an attempt is made to acquire a new pool object when the
	 * pool has already been marked for draining.
	 *
	 * @param {Number|String} [priority=1] The priority with which to obtain a new element from the pool.
	 * @returns {Promise} A promise that is resolved when the object is successfully created.
	 */
	acquire(priority = 1) {
		let self = this;

		// Check to see if the pool is draining. If so we can't obtain a new object, so reject the promise.
		if (this.draining) {
			let err = new Error('Pool is draining');

			return Promise.reject(err);
		}

		return new Promise(function(resolve, reject) {
			let queue = maps.queue.get(self);

			// Queue a new "deferred" with the specified priority.
			queue.queue({
				resolve: resolve,
				reject: reject,
				priority: isNaN(priority) ? 1 : priority
			});

			// If the current count is less than the maximum size we can immediately dequeue and process the
			// acquisition request.
			if (self.count < self.max) {
				spawn.call(self, queue.dequeue());
			}
		});
	}

	drain() {
		let self = this;

		return new Promise(function(resolve) {
			maps.drain.set(self, resolve);
		});
	}

	/**
	 * Releases an object obtained from the pool asynchronously. The returned Promise will resolve when the destroy
	 * function succeeds (or immediately if no destroy function was specified). However the promise will reject if an
	 * error is encountered during destruction or an attempt is made to release an object that was not obtained from
	 * the pool in the first place.
	 *
	 * @param {Object} obj The object to release back to the pool.
	 * @returns {Promise} A promise that is resolved when the object is successfully destroyed.
	 */
	release(obj) {
		let self = this;

		if (maps.origin.get(obj) !== this) {
			let err = new Error('Object was not obtained from this pool');

			return Promise.reject(err);
		}

		return this._destroy(obj)
			.then(function() {
				let count = maps.count.get(self);

				count--;
				maps.count.set(self, count);
				maps.origin.delete(obj);

				if (count === 0 && maps.drain.has(self)) {
					maps.drain.get(self)();
				}
				else {
					// It is likely that this fill will only resolve one acquisition request, but calling spawn
					// directly would potentially leave slots unclaimed.
					fill.call(self);
				}
			});
	}

	get count() {
		return maps.count.get(this);
	}

	get draining() {
		return maps.drain.has(this);
	}

	get max() {
		return maps.max.get(this);
	}

	set max(n) {
		let val = parseInt(n, 10);

		maps.max.set(this, isNaN(val) ? 1 : Math.max(val, 1));

		// When the max size is changed after instantiation it may be possible to fill remaining empty slots. Attempt
		// to process this.
		fill.call(this);
	}

	get waiting() {
		return maps.queue.get(this).length;
	}
}

module.exports = Pool;
<commit_msg>Adding functionality to resume drained pools.<commit_after>'use strict';

const PriorityQueue = require('js-priority-queue');

let maps = {
	count: new WeakMap(),
	drain: new WeakMap(),
	max: new WeakMap(),
	origin: new WeakMap(),
	queue: new WeakMap(),
	restarting: new WeakMap()
};

function promisify(fn) {
	return function() {
		let result;

		try {
			result = fn.apply(this, arguments);

			if (result instanceof Promise || (result != null && typeof result === 'object' && typeof result.then === 'function' && typeof result.catch === 'function')) {
				return result;
			}
		} catch(err) {
			return Promise.reject(err);
		}

		return Promise.resolve(result);
	};
}

/**
 * Attempts to fill any available pool slots and spawn appropriate objects.
 *
 * @private
 */
function fill() {
	let queue = maps.queue.get(this);

	// While the current count is less than the allotted maximum and there are outstanding acquisition
	// requests, attempt to fill the available space.
	while (this.count < this.max && this.waiting > 0) {
		spawn.call(this, queue.dequeue());
	}
}

/**
 *
 */
function noop() {}

/**
 *
 * @param {Number} a
 * @param {Number} b
 * @returns {Number}
 */
function queueComparator(a, b) {
	return b.priority - a.priority;
}

/**
 * Normalizes the spawning process of the pool elements and appropriately tracks the number of active,
 * fulfilled requests.
 *
 * @private
 * @param {Object} deferred An internal "deferred" object that can be used to reject or resolve the original
 *     acquisition requests.
 * @returns {Promise} A promise that is resolved when the pool object is successfully created.
 */
function spawn(deferred) {
	let self = this;

	// Make sure to increase the counter. If there is an error during creation we'll just decrease the counter
	// again. But if the object takes a particularly long time to create we don't want any other acquisition
	// requests cutting in line.
	let count = maps.count.get(this);

	count++;
	maps.count.set(this, count);

	return this._create()
		.then(function(obj) {
			// When the object is successfully created, mark it as originating from this pool.
			maps.origin.set(obj, self);

			// Resolve the original acquisition request.
			deferred.resolve(obj);
		})
		.catch(function(err) {
			// There was an error during object creation, so reject the original acquisition request.
			deferred.reject(err);

			// Decrease the count of the pool to "undo" the pre-emptive increment.
			count--;
			maps.count.set(self, count);
		});
}

/**
 * A class that serves as a constructor for the default object acquired from the pool if no creation function is
 * specified.
 *
 * @private
 * @constructor
 */
class Slot {
	constructor() {}

	static create() {
		return new Slot();
	}
}

/**
 * Placeholder.
 *
 * @class
 * @param {Object} options A configuration object.
 * @param {Function} options.create A function that will be called to create a new pool element. Can be synchronous or
 *     asynchronous. The function must not return pool elements that are of type 'undefined', 'null', 'number',
 *     'boolean', or 'string'. Only 'object' types and its derivatives are supported.
 * @param {Function} [options.destroy] A function that will be called to destroy a pool element. Will be passed the
 *     pool element marked for destruction as the only argument.
 * @param {Number} [max=1] The initial maximum number of objects in the pool. Must be a positive integer greater than
 *     0. Non-conforming values are coerced with truncation or, failing that, defaulting back to 1.
 */
class Pool {
	constructor(options = {}) {
		// An internal count of the currently fulfilled acquisition requests.
		maps.count.set(this, 0);
		// An internal reference to keep track of the maximum size of the pool.
		maps.max.set(this, Infinity);
		// An internal priority queue for keeping track of acquisition requests.
		maps.queue.set(this, new PriorityQueue({
			comparator: queueComparator
		}));

		// A asynchronous/synchronous normalized version of the supplied create option.
		this._create = promisify(options.create || Slot.create);
		// A asynchronous/synchronous normalized version of the supplied destroy option.
		this._destroy = promisify(options.destroy || noop);

		this.max = options.max;
	}

	/**
	 * Acquires a new object from the pool asynchronously. The returned Promise will resolve when there is a free slot
	 * available in the pool. However the promise will be rejected if any errors are encountered during object creation
	 * (using the configured options.create function) or if an attempt is made to acquire a new pool object when the
	 * pool has already been marked for draining.
	 *
	 * @param {Number|String} [priority=1] The priority with which to obtain a new element from the pool.
	 * @returns {Promise} A promise that is resolved when the object is successfully created.
	 */
	acquire(priority = 1) {
		let self = this;

		// Check to see if the pool is draining. If so we can't obtain a new object, so reject the promise.
		if (this.draining) {
			let err = new Error('Pool is draining');

			return Promise.reject(err);
		}

		return new Promise(function(resolve, reject) {
			let queue = maps.queue.get(self);

			// Queue a new "deferred" with the specified priority.
			queue.queue({
				resolve: resolve,
				reject: reject,
				priority: isNaN(priority) ? 1 : priority
			});

			// If the current count is less than the maximum size we can immediately dequeue and process the
			// acquisition request.
			if (self.count < self.max) {
				spawn.call(self, queue.dequeue());
			}
		});
	}

	drain() {
		let self = this;

		let promise = new Promise(function(resolve) {
			if (self.count === 0) {
				resolve();
			}

			promise.resolve = resolve;
		});

		maps.drain.set(this, promise);

		return promise;
	}

	/**
	 * Releases an object obtained from the pool asynchronously. The returned Promise will resolve when the destroy
	 * function succeeds (or immediately if no destroy function was specified). However the promise will reject if an
	 * error is encountered during destruction or an attempt is made to release an object that was not obtained from
	 * the pool in the first place.
	 *
	 * @param {Object} obj The object to release back to the pool.
	 * @returns {Promise} A promise that is resolved when the object is successfully destroyed.
	 */
	release(obj) {
		let self = this;

		if (maps.origin.get(obj) !== this) {
			let err = new Error('Object was not obtained from this pool');

			return Promise.reject(err);
		}

		return this._destroy(obj)
			.then(function() {
				let count = maps.count.get(self);

				count--;
				maps.count.set(self, count);
				maps.origin.delete(obj);

				if (count === 0 && maps.drain.has(self)) {
					maps.drain.get(self).resolve();
				}
				else {
					// It is likely that this fill will only resolve one acquisition request, but calling spawn
					// directly would potentially leave slots unclaimed.
					fill.call(self);
				}
			});
	}

	resume() {
		let self = this;

		if (!maps.restarting.has(this) && maps.drain.has(this)) {
			maps.drain.get(this)
				.then(function() {
					maps.drain.delete(self);
					maps.restarting.delete(self);
				});
		}
	}

	get count() {
		return maps.count.get(this);
	}

	get draining() {
		return maps.drain.has(this);
	}

	get max() {
		return maps.max.get(this);
	}

	set max(n) {
		let val = parseInt(n, 10);

		maps.max.set(this, isNaN(val) ? 1 : Math.max(val, 1));

		// When the max size is changed after instantiation it may be possible to fill remaining empty slots. Attempt
		// to process this.
		fill.call(this);
	}

	get waiting() {
		return maps.queue.get(this).length;
	}
}

module.exports = Pool;
<|endoftext|>