cotcube-helpers 0.1.5 → 0.1.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/VERSION +1 -1
- data/lib/cotcube-helpers/parallelize.rb +3 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3d088e43fd870ff67a238501fd680f1c5688c7108bc90ace92e01cd8c33627b
|
4
|
+
data.tar.gz: 72b07a1f0e502a29e9cb818d62a8d398fe5e094efade358300eab4578b64ceae
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7b92ec6b178328bd6944f61828848d1d1c4aa164e9a3680054345189503d237a809ea082441eeab476ff693eeebdf5bf27bec300b3606af589598da946ce1c0a
|
7
|
+
data.tar.gz: 00d63e82c5ed3cfcc9986f4ec3222e2282a692ed0ad54602cb4e212b9285d8c51182d9c87a4e8b9672d2f305409b6f01d27437b73aa40df6872a35e4ea962b8e
|
data/CHANGELOG.md
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.5
|
1
|
+
0.1.5.1
|
@@ -7,9 +7,9 @@ module Cotcube
|
|
7
7
|
def parallelize(ary, processes: 1, threads: 1, progress: '', &block)
|
8
8
|
chunks = []
|
9
9
|
if [0, 1].include? processes
|
10
|
-
result = Parallel.map(ary, in_threads: threads
|
11
|
-
elsif [0, 1].include?
|
12
|
-
result = Parallel.map(ary, in_processes: processes
|
10
|
+
result = Parallel.map(ary, in_threads: threads, &block)
|
11
|
+
elsif [0, 1].include? threads
|
12
|
+
result = Parallel.map(ary, in_processes: processes, &block)
|
13
13
|
else
|
14
14
|
ary.each_slice(threads) { |chunk| chunks << chunk }
|
15
15
|
result = if progress == ''
|