async-rails 0.7.0 → 0.8.0
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 +23 -8
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 068d8675ffd8a61568db7cd9fbf23a465dab50b3
|
4
|
+
data.tar.gz: 24d8779a76a34332eace9e7570c8aea6c4a75635
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5331b11ecd1c6291792628eca381009d2e258ae64a11b64d7cfd3df95cc08b20585853ee2220ba3f9dc8ba6b39590c1825bf38665776c51a464ed5d4299cc7a7
|
7
|
+
data.tar.gz: 67307faee27128d841ac8ece9b51c043d38235f66fbb077487399527e585295d9bc758ee042f5ecb9652024b392046846ad1d3ef1c4382b22ae53494a11ba182
|
data/lib/async-rails/version.rb
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
/*!
|
2
|
+
* async
|
3
|
+
* https://github.com/caolan/async
|
4
|
+
*
|
5
|
+
* Copyright 2010-2014 Caolan McMahon
|
6
|
+
* Released under the MIT license
|
7
|
+
*/
|
1
8
|
/*jshint onevar: false, indent:4 */
|
2
9
|
/*global setImmediate: false, setTimeout: false, console: false */
|
3
10
|
(function () {
|
@@ -227,18 +234,26 @@
|
|
227
234
|
|
228
235
|
|
229
236
|
var _asyncMap = function (eachfn, arr, iterator, callback) {
|
230
|
-
var results = [];
|
231
237
|
arr = _map(arr, function (x, i) {
|
232
238
|
return {index: i, value: x};
|
233
239
|
});
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
240
|
+
if (!callback) {
|
241
|
+
eachfn(arr, function (x, callback) {
|
242
|
+
iterator(x.value, function (err) {
|
243
|
+
callback(err);
|
244
|
+
});
|
238
245
|
});
|
239
|
-
}
|
240
|
-
|
241
|
-
|
246
|
+
} else {
|
247
|
+
var results = [];
|
248
|
+
eachfn(arr, function (x, callback) {
|
249
|
+
iterator(x.value, function (err, v) {
|
250
|
+
results[x.index] = v;
|
251
|
+
callback(err);
|
252
|
+
});
|
253
|
+
}, function (err) {
|
254
|
+
callback(err, results);
|
255
|
+
});
|
256
|
+
}
|
242
257
|
};
|
243
258
|
async.map = doParallel(_asyncMap);
|
244
259
|
async.mapSeries = doSeries(_asyncMap);
|