async-rails 1.4.0 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6a7bd80f3580610ce08bedf6109fff6f54ad7120
4
- data.tar.gz: 3a8ad7537bc492c85e8a40b21d7e1054ca23de3c
3
+ metadata.gz: 195b34c9ffbe954cd21938df3364d1c40266346d
4
+ data.tar.gz: e3fe88d42fee69b01e50763dcc3bd56bb1f8d2e5
5
5
  SHA512:
6
- metadata.gz: d8072b21d7c64f39aab41ad85caa776f23ca9c082bc5cbc360c85c8085c6a98bf1022fc6a03447229a4576e9c2adfe826fb3d97522b44bc192ffc008963abeb7
7
- data.tar.gz: bf2475def426eab8bd83e68f9938ad61d60c5e91d9d24acd8c5f5400b95424d5feab615ae1b8520aeb84304eb21250374618c144da8c0444f4ce0526fe285e49
6
+ metadata.gz: 77ceefc4f221b399d3f0fadff11aa364934aea44c40a9b940982e60c9b3c49d45eed373aea2c824f452bceeb7e2d9a5b753f39574182f340be752c76822ad677
7
+ data.tar.gz: b2b398bd4c2f1b4c740746a2f3518a926826c2cadc5ea1c0abbe14960b0684bc1092819583f5d052c8150bddf1c3e57788eb8115b28b7cff54cc4dd9550ddb2a
@@ -1,5 +1,5 @@
1
1
  module Async
2
2
  module Rails
3
- VERSION = "1.4.0"
3
+ VERSION = "1.4.1"
4
4
  end
5
5
  end
@@ -62,6 +62,12 @@
62
62
  return _toString.call(obj) === '[object Array]';
63
63
  };
64
64
 
65
+ // Ported from underscore.js isObject
66
+ var _isObject = function(obj) {
67
+ var type = typeof obj;
68
+ return type === 'function' || type === 'object' && !!obj;
69
+ };
70
+
65
71
  function _isArrayLike(arr) {
66
72
  return _isArray(arr) || (
67
73
  // has a positive integer length property
@@ -165,7 +171,6 @@
165
171
  switch (startIndex) {
166
172
  case 0: return func.call(this, rest);
167
173
  case 1: return func.call(this, arguments[0], rest);
168
- case 2: return func.call(this, arguments[0], arguments[1], rest);
169
174
  }
170
175
  // Currently unused but handle cases outside of the switch statement:
171
176
  // var args = Array(startIndex + 1);
@@ -462,6 +467,7 @@
462
467
  }
463
468
  async.detect = _createTester(async.eachOf, identity, _findGetResult);
464
469
  async.detectSeries = _createTester(async.eachOfSeries, identity, _findGetResult);
470
+ async.detectLimit = _createTester(async.eachOfLimit, identity, _findGetResult);
465
471
 
466
472
  async.sortBy = function (arr, iterator, callback) {
467
473
  async.map(arr, function (x, callback) {
@@ -593,7 +599,7 @@
593
599
  acc.times = parseInt(t.times, 10) || DEFAULT_TIMES;
594
600
  acc.interval = parseInt(t.interval, 10) || DEFAULT_INTERVAL;
595
601
  } else {
596
- throw new Error('Unsupported argument type for \'times\': ' + typeof(t));
602
+ throw new Error('Unsupported argument type for \'times\': ' + typeof t);
597
603
  }
598
604
  }
599
605
 
@@ -1013,7 +1019,7 @@
1013
1019
  function _console_fn(name) {
1014
1020
  return _restParam(function (fn, args) {
1015
1021
  fn.apply(null, args.concat([_restParam(function (err, args) {
1016
- if (typeof console !== 'undefined') {
1022
+ if (typeof console === 'object') {
1017
1023
  if (err) {
1018
1024
  if (console.error) {
1019
1025
  console.error(err);
@@ -1186,10 +1192,10 @@
1186
1192
  return callback(e);
1187
1193
  }
1188
1194
  // if result is Promise object
1189
- if (typeof result !== 'undefined' && typeof result.then === "function") {
1195
+ if (_isObject(result) && typeof result.then === "function") {
1190
1196
  result.then(function(value) {
1191
1197
  callback(null, value);
1192
- }).catch(function(err) {
1198
+ })["catch"](function(err) {
1193
1199
  callback(err.message ? err : new Error(err));
1194
1200
  });
1195
1201
  } else {
@@ -1199,11 +1205,11 @@
1199
1205
  };
1200
1206
 
1201
1207
  // Node.js
1202
- if (typeof module !== 'undefined' && module.exports) {
1208
+ if (typeof module === 'object' && module.exports) {
1203
1209
  module.exports = async;
1204
1210
  }
1205
1211
  // AMD / RequireJS
1206
- else if (typeof define !== 'undefined' && define.amd) {
1212
+ else if (typeof define === 'function' && define.amd) {
1207
1213
  define([], function () {
1208
1214
  return async;
1209
1215
  });
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Chen
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-07-21 00:00:00.000000000 Z
11
+ date: 2015-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties