async-rails 2.1.4 → 2.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/async-rails/version.rb +1 -1
- data/vendor/assets/javascripts/async.js +66 -66
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b37af162feb594fd569a51c6ac921efdfdcd67c3
|
4
|
+
data.tar.gz: 58b4b49a83a252db8a0233c44412dbe75de6d5c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c4e9ca797f8b8a68cc2fb32ffa8f4cfb6c4cd501f94efc31f90ddbce917ddae14e7fc986c10832b7dc309ebaadb7641938dd8c346f78d5abf6474052eb22156
|
7
|
+
data.tar.gz: 45f958bb66b6e34aa6fd1b88b71e7a7f436423430d505e4ed3302ee12470751ebdfb73f237d2e66c71fcb7efad69cdce50436532fab1765bf28599878cf633c6
|
data/lib/async-rails/version.rb
CHANGED
@@ -95,7 +95,7 @@ function applyEach$1(eachfn) {
|
|
95
95
|
var go = initialParams(function (args, callback) {
|
96
96
|
var that = this;
|
97
97
|
return eachfn(fns, function (fn, cb) {
|
98
|
-
fn.apply(that, args.concat(
|
98
|
+
fn.apply(that, args.concat(cb));
|
99
99
|
}, callback);
|
100
100
|
});
|
101
101
|
if (args.length) {
|
@@ -200,8 +200,7 @@ function baseGetTag(value) {
|
|
200
200
|
if (value == null) {
|
201
201
|
return value === undefined ? undefinedTag : nullTag;
|
202
202
|
}
|
203
|
-
|
204
|
-
return (symToStringTag && symToStringTag in value)
|
203
|
+
return (symToStringTag && symToStringTag in Object(value))
|
205
204
|
? getRawTag(value)
|
206
205
|
: objectToString(value);
|
207
206
|
}
|
@@ -332,6 +331,10 @@ function isArrayLike(value) {
|
|
332
331
|
return value != null && isLength(value.length) && !isFunction(value);
|
333
332
|
}
|
334
333
|
|
334
|
+
// A temporary value used to identify if the loop should be broken.
|
335
|
+
// See #1064, #1293
|
336
|
+
var breakLoop = {};
|
337
|
+
|
335
338
|
/**
|
336
339
|
* This method returns `undefined`.
|
337
340
|
*
|
@@ -636,7 +639,7 @@ var freeProcess = moduleExports$1 && freeGlobal.process;
|
|
636
639
|
/** Used to access faster Node.js helpers. */
|
637
640
|
var nodeUtil = (function() {
|
638
641
|
try {
|
639
|
-
return freeProcess && freeProcess.binding('util');
|
642
|
+
return freeProcess && freeProcess.binding && freeProcess.binding('util');
|
640
643
|
} catch (e) {}
|
641
644
|
}());
|
642
645
|
|
@@ -841,10 +844,6 @@ function onlyOnce(fn) {
|
|
841
844
|
};
|
842
845
|
}
|
843
846
|
|
844
|
-
// A temporary value used to identify if the loop should be broken.
|
845
|
-
// See #1064, #1293
|
846
|
-
var breakLoop = {};
|
847
|
-
|
848
847
|
function _eachOfLimit(limit) {
|
849
848
|
return function (obj, iteratee, callback) {
|
850
849
|
callback = once(callback || noop);
|
@@ -929,10 +928,10 @@ function eachOfArrayLike(coll, iteratee, callback) {
|
|
929
928
|
callback(null);
|
930
929
|
}
|
931
930
|
|
932
|
-
function iteratorCallback(err) {
|
931
|
+
function iteratorCallback(err, value) {
|
933
932
|
if (err) {
|
934
933
|
callback(err);
|
935
|
-
} else if (++completed === length) {
|
934
|
+
} else if (++completed === length || value === breakLoop) {
|
936
935
|
callback(null);
|
937
936
|
}
|
938
937
|
}
|
@@ -1521,7 +1520,7 @@ var auto = function (tasks, concurrency, callback) {
|
|
1521
1520
|
var runningTasks = 0;
|
1522
1521
|
var hasError = false;
|
1523
1522
|
|
1524
|
-
var listeners =
|
1523
|
+
var listeners = Object.create(null);
|
1525
1524
|
|
1526
1525
|
var readyTasks = [];
|
1527
1526
|
|
@@ -1549,7 +1548,7 @@ var auto = function (tasks, concurrency, callback) {
|
|
1549
1548
|
|
1550
1549
|
arrayEach(dependencies, function (dependencyName) {
|
1551
1550
|
if (!tasks[dependencyName]) {
|
1552
|
-
throw new Error('async.auto task `' + key + '` has a non-existent dependency in ' + dependencies.join(', '));
|
1551
|
+
throw new Error('async.auto task `' + key + '` has a non-existent dependency `' + dependencyName + '` in ' + dependencies.join(', '));
|
1553
1552
|
}
|
1554
1553
|
addListener(dependencyName, function () {
|
1555
1554
|
remainingDependencies--;
|
@@ -1611,7 +1610,7 @@ var auto = function (tasks, concurrency, callback) {
|
|
1611
1610
|
});
|
1612
1611
|
safeResults[key] = args;
|
1613
1612
|
hasError = true;
|
1614
|
-
listeners =
|
1613
|
+
listeners = Object.create(null);
|
1615
1614
|
|
1616
1615
|
callback(err, safeResults);
|
1617
1616
|
} else {
|
@@ -1828,15 +1827,17 @@ function asciiToArray(string) {
|
|
1828
1827
|
|
1829
1828
|
/** Used to compose unicode character classes. */
|
1830
1829
|
var rsAstralRange = '\\ud800-\\udfff';
|
1831
|
-
var rsComboMarksRange = '\\u0300-\\u036f
|
1832
|
-
var
|
1830
|
+
var rsComboMarksRange = '\\u0300-\\u036f';
|
1831
|
+
var reComboHalfMarksRange = '\\ufe20-\\ufe2f';
|
1832
|
+
var rsComboSymbolsRange = '\\u20d0-\\u20ff';
|
1833
|
+
var rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;
|
1833
1834
|
var rsVarRange = '\\ufe0e\\ufe0f';
|
1834
1835
|
|
1835
1836
|
/** Used to compose unicode capture groups. */
|
1836
1837
|
var rsZWJ = '\\u200d';
|
1837
1838
|
|
1838
1839
|
/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
|
1839
|
-
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange +
|
1840
|
+
var reHasUnicode = RegExp('[' + rsZWJ + rsAstralRange + rsComboRange + rsVarRange + ']');
|
1840
1841
|
|
1841
1842
|
/**
|
1842
1843
|
* Checks if `string` contains Unicode symbols.
|
@@ -1851,13 +1852,15 @@ function hasUnicode(string) {
|
|
1851
1852
|
|
1852
1853
|
/** Used to compose unicode character classes. */
|
1853
1854
|
var rsAstralRange$1 = '\\ud800-\\udfff';
|
1854
|
-
var rsComboMarksRange$1 = '\\u0300-\\u036f
|
1855
|
-
var
|
1855
|
+
var rsComboMarksRange$1 = '\\u0300-\\u036f';
|
1856
|
+
var reComboHalfMarksRange$1 = '\\ufe20-\\ufe2f';
|
1857
|
+
var rsComboSymbolsRange$1 = '\\u20d0-\\u20ff';
|
1858
|
+
var rsComboRange$1 = rsComboMarksRange$1 + reComboHalfMarksRange$1 + rsComboSymbolsRange$1;
|
1856
1859
|
var rsVarRange$1 = '\\ufe0e\\ufe0f';
|
1857
1860
|
|
1858
1861
|
/** Used to compose unicode capture groups. */
|
1859
1862
|
var rsAstral = '[' + rsAstralRange$1 + ']';
|
1860
|
-
var rsCombo = '[' +
|
1863
|
+
var rsCombo = '[' + rsComboRange$1 + ']';
|
1861
1864
|
var rsFitz = '\\ud83c[\\udffb-\\udfff]';
|
1862
1865
|
var rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')';
|
1863
1866
|
var rsNonAstral = '[^' + rsAstralRange$1 + ']';
|
@@ -2251,6 +2254,7 @@ function queue(worker, concurrency, payload) {
|
|
2251
2254
|
|
2252
2255
|
var workers = 0;
|
2253
2256
|
var workersList = [];
|
2257
|
+
var isProcessing = false;
|
2254
2258
|
var q = {
|
2255
2259
|
_tasks: new DLL(),
|
2256
2260
|
concurrency: concurrency,
|
@@ -2274,6 +2278,12 @@ function queue(worker, concurrency, payload) {
|
|
2274
2278
|
_insert(data, true, callback);
|
2275
2279
|
},
|
2276
2280
|
process: function () {
|
2281
|
+
// Avoid trying to start too many processing operations. This can occur
|
2282
|
+
// when callbacks resolve synchronously (#1267).
|
2283
|
+
if (isProcessing) {
|
2284
|
+
return;
|
2285
|
+
}
|
2286
|
+
isProcessing = true;
|
2277
2287
|
while (!q.paused && workers < q.concurrency && q._tasks.length) {
|
2278
2288
|
var tasks = [],
|
2279
2289
|
data = [];
|
@@ -2298,6 +2308,7 @@ function queue(worker, concurrency, payload) {
|
|
2298
2308
|
var cb = onlyOnce(_next(tasks));
|
2299
2309
|
worker(data, cb);
|
2300
2310
|
}
|
2311
|
+
isProcessing = false;
|
2301
2312
|
},
|
2302
2313
|
length: function () {
|
2303
2314
|
return q._tasks.length;
|
@@ -2319,12 +2330,7 @@ function queue(worker, concurrency, payload) {
|
|
2319
2330
|
return;
|
2320
2331
|
}
|
2321
2332
|
q.paused = false;
|
2322
|
-
|
2323
|
-
// Need to call q.process once per concurrent
|
2324
|
-
// worker to preserve full concurrency after pause
|
2325
|
-
for (var w = 1; w <= resumeCount; w++) {
|
2326
|
-
setImmediate$1(q.process);
|
2327
|
-
}
|
2333
|
+
setImmediate$1(q.process);
|
2328
2334
|
}
|
2329
2335
|
};
|
2330
2336
|
return q;
|
@@ -2535,9 +2541,9 @@ var seq$1 = rest(function seq(functions) {
|
|
2535
2541
|
}
|
2536
2542
|
|
2537
2543
|
reduce(functions, args, function (newargs, fn, cb) {
|
2538
|
-
fn.apply(that, newargs.concat(
|
2544
|
+
fn.apply(that, newargs.concat(rest(function (err, nextargs) {
|
2539
2545
|
cb(err, nextargs);
|
2540
|
-
})
|
2546
|
+
})));
|
2541
2547
|
}, function (err, results) {
|
2542
2548
|
cb.apply(that, [err].concat(results));
|
2543
2549
|
});
|
@@ -2700,36 +2706,30 @@ var constant = rest(function (values) {
|
|
2700
2706
|
});
|
2701
2707
|
});
|
2702
2708
|
|
2703
|
-
function _createTester(
|
2704
|
-
return function (
|
2705
|
-
|
2706
|
-
|
2707
|
-
|
2708
|
-
|
2709
|
-
|
2710
|
-
|
2711
|
-
|
2712
|
-
|
2713
|
-
|
2714
|
-
|
2715
|
-
|
2716
|
-
if (err) cb(err);else cb(err, getResult(true, x));
|
2717
|
-
cb = iteratee = false;
|
2718
|
-
callback(err, breakLoop);
|
2709
|
+
function _createTester(check, getResult) {
|
2710
|
+
return function (eachfn, arr, iteratee, cb) {
|
2711
|
+
cb = cb || noop;
|
2712
|
+
var testPassed = false;
|
2713
|
+
var testResult;
|
2714
|
+
eachfn(arr, function (value, _, callback) {
|
2715
|
+
iteratee(value, function (err, result) {
|
2716
|
+
if (err) {
|
2717
|
+
callback(err);
|
2718
|
+
} else if (check(result) && !testResult) {
|
2719
|
+
testPassed = true;
|
2720
|
+
testResult = getResult(true, value);
|
2721
|
+
callback(null, breakLoop);
|
2719
2722
|
} else {
|
2720
2723
|
callback();
|
2721
2724
|
}
|
2722
2725
|
});
|
2723
|
-
}
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2729
|
-
|
2730
|
-
iteratee = limit;
|
2731
|
-
eachfn(arr, wrappedIteratee, done);
|
2732
|
-
}
|
2726
|
+
}, function (err) {
|
2727
|
+
if (err) {
|
2728
|
+
cb(err);
|
2729
|
+
} else {
|
2730
|
+
cb(null, testPassed ? testResult : getResult(false));
|
2731
|
+
}
|
2732
|
+
});
|
2733
2733
|
};
|
2734
2734
|
}
|
2735
2735
|
|
@@ -2772,7 +2772,7 @@ function _findGetResult(v, x) {
|
|
2772
2772
|
* // result now equals the first file in the list that exists
|
2773
2773
|
* });
|
2774
2774
|
*/
|
2775
|
-
var detect = _createTester(
|
2775
|
+
var detect = doParallel(_createTester(identity, _findGetResult));
|
2776
2776
|
|
2777
2777
|
/**
|
2778
2778
|
* The same as [`detect`]{@link module:Collections.detect} but runs a maximum of `limit` async operations at a
|
@@ -2796,7 +2796,7 @@ var detect = _createTester(eachOf, identity, _findGetResult);
|
|
2796
2796
|
* (iteratee) or the value `undefined` if none passed. Invoked with
|
2797
2797
|
* (err, result).
|
2798
2798
|
*/
|
2799
|
-
var detectLimit = _createTester(
|
2799
|
+
var detectLimit = doParallelLimit(_createTester(identity, _findGetResult));
|
2800
2800
|
|
2801
2801
|
/**
|
2802
2802
|
* The same as [`detect`]{@link module:Collections.detect} but runs only a single async operation at a time.
|
@@ -2818,11 +2818,11 @@ var detectLimit = _createTester(eachOfLimit, identity, _findGetResult);
|
|
2818
2818
|
* (iteratee) or the value `undefined` if none passed. Invoked with
|
2819
2819
|
* (err, result).
|
2820
2820
|
*/
|
2821
|
-
var detectSeries =
|
2821
|
+
var detectSeries = doLimit(detectLimit, 1);
|
2822
2822
|
|
2823
2823
|
function consoleFunc(name) {
|
2824
2824
|
return rest(function (fn, args) {
|
2825
|
-
fn.apply(null, args.concat(
|
2825
|
+
fn.apply(null, args.concat(rest(function (err, args) {
|
2826
2826
|
if (typeof console === 'object') {
|
2827
2827
|
if (err) {
|
2828
2828
|
if (console.error) {
|
@@ -2834,7 +2834,7 @@ function consoleFunc(name) {
|
|
2834
2834
|
});
|
2835
2835
|
}
|
2836
2836
|
}
|
2837
|
-
})
|
2837
|
+
})));
|
2838
2838
|
});
|
2839
2839
|
}
|
2840
2840
|
|
@@ -2923,7 +2923,7 @@ function doDuring(fn, test, callback) {
|
|
2923
2923
|
* passes. The function is passed a `callback(err)`, which must be called once
|
2924
2924
|
* it has completed with an optional `err` argument. Invoked with (callback).
|
2925
2925
|
* @param {Function} test - synchronous truth test to perform after each
|
2926
|
-
* execution of `iteratee`. Invoked with the non-error callback results of
|
2926
|
+
* execution of `iteratee`. Invoked with the non-error callback results of
|
2927
2927
|
* `iteratee`.
|
2928
2928
|
* @param {Function} [callback] - A callback which is called after the test
|
2929
2929
|
* function has failed and repeated execution of `iteratee` has stopped.
|
@@ -3220,7 +3220,7 @@ function notId(v) {
|
|
3220
3220
|
* // if result is true then every file exists
|
3221
3221
|
* });
|
3222
3222
|
*/
|
3223
|
-
var every = _createTester(
|
3223
|
+
var every = doParallel(_createTester(notId, notId));
|
3224
3224
|
|
3225
3225
|
/**
|
3226
3226
|
* The same as [`every`]{@link module:Collections.every} but runs a maximum of `limit` async operations at a time.
|
@@ -3242,7 +3242,7 @@ var every = _createTester(eachOf, notId, notId);
|
|
3242
3242
|
* `iteratee` functions have finished. Result will be either `true` or `false`
|
3243
3243
|
* depending on the values of the async tests. Invoked with (err, result).
|
3244
3244
|
*/
|
3245
|
-
var everyLimit = _createTester(
|
3245
|
+
var everyLimit = doParallelLimit(_createTester(notId, notId));
|
3246
3246
|
|
3247
3247
|
/**
|
3248
3248
|
* The same as [`every`]{@link module:Collections.every} but runs only a single async operation at a time.
|
@@ -3620,14 +3620,14 @@ function memoize(fn, hasher) {
|
|
3620
3620
|
queues[key].push(callback);
|
3621
3621
|
} else {
|
3622
3622
|
queues[key] = [callback];
|
3623
|
-
fn.apply(null, args.concat(
|
3623
|
+
fn.apply(null, args.concat(rest(function (args) {
|
3624
3624
|
memo[key] = args;
|
3625
3625
|
var q = queues[key];
|
3626
3626
|
delete queues[key];
|
3627
3627
|
for (var i = 0, l = q.length; i < l; i++) {
|
3628
3628
|
q[i].apply(null, args);
|
3629
3629
|
}
|
3630
|
-
})
|
3630
|
+
})));
|
3631
3631
|
}
|
3632
3632
|
});
|
3633
3633
|
memoized.memo = memo;
|
@@ -4450,7 +4450,7 @@ var retryable = function (opts, task) {
|
|
4450
4450
|
}
|
4451
4451
|
return initialParams(function (args, callback) {
|
4452
4452
|
function taskFn(cb) {
|
4453
|
-
task.apply(null, args.concat(
|
4453
|
+
task.apply(null, args.concat(cb));
|
4454
4454
|
}
|
4455
4455
|
|
4456
4456
|
if (opts) retry(opts, taskFn, callback);else retry(taskFn, callback);
|
@@ -4555,7 +4555,7 @@ function series(tasks, callback) {
|
|
4555
4555
|
* // if result is true then at least one of the files exists
|
4556
4556
|
* });
|
4557
4557
|
*/
|
4558
|
-
var some = _createTester(
|
4558
|
+
var some = doParallel(_createTester(Boolean, identity));
|
4559
4559
|
|
4560
4560
|
/**
|
4561
4561
|
* The same as [`some`]{@link module:Collections.some} but runs a maximum of `limit` async operations at a time.
|
@@ -4578,7 +4578,7 @@ var some = _createTester(eachOf, Boolean, identity);
|
|
4578
4578
|
* Result will be either `true` or `false` depending on the values of the async
|
4579
4579
|
* tests. Invoked with (err, result).
|
4580
4580
|
*/
|
4581
|
-
var someLimit = _createTester(
|
4581
|
+
var someLimit = doParallelLimit(_createTester(Boolean, identity));
|
4582
4582
|
|
4583
4583
|
/**
|
4584
4584
|
* The same as [`some`]{@link module:Collections.some} but runs only a single async operation at a time.
|
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: 2.1.
|
4
|
+
version: 2.1.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jason Chen
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: railties
|