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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 64ac2664781f303aaed9720fc21269db8bffcb91
4
- data.tar.gz: 62b8a5a0a474ad0a9b8119eb3f549c3c740ea839
3
+ metadata.gz: 068d8675ffd8a61568db7cd9fbf23a465dab50b3
4
+ data.tar.gz: 24d8779a76a34332eace9e7570c8aea6c4a75635
5
5
  SHA512:
6
- metadata.gz: 001dbc16fb0ff32ce7d5042d161bb3bc1eca7dcde3d743596f3fb9631cc5e94af22edb61d0dbb1a0698014f641d2e1320ff23eeb04e136bd3a111cd6be659190
7
- data.tar.gz: e91be46d2d677607550eb87ad59405c52f9b26996896bfd7c03529c8bd64e71dda9f4d580ec2ec22fbbb0a989d688e3660823c83002e5d8db94f40d275108a14
6
+ metadata.gz: 5331b11ecd1c6291792628eca381009d2e258ae64a11b64d7cfd3df95cc08b20585853ee2220ba3f9dc8ba6b39590c1825bf38665776c51a464ed5d4299cc7a7
7
+ data.tar.gz: 67307faee27128d841ac8ece9b51c043d38235f66fbb077487399527e585295d9bc758ee042f5ecb9652024b392046846ad1d3ef1c4382b22ae53494a11ba182
@@ -1,5 +1,5 @@
1
1
  module Async
2
2
  module Rails
3
- VERSION = "0.7.0"
3
+ VERSION = "0.8.0"
4
4
  end
5
5
  end
@@ -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
- eachfn(arr, function (x, callback) {
235
- iterator(x.value, function (err, v) {
236
- results[x.index] = v;
237
- callback(err);
240
+ if (!callback) {
241
+ eachfn(arr, function (x, callback) {
242
+ iterator(x.value, function (err) {
243
+ callback(err);
244
+ });
238
245
  });
239
- }, function (err) {
240
- callback(err, results);
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);
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jason Chen