in-parallel 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/in_parallel/version.rb +1 -1
- data/lib/parallel_enumerable.rb +1 -1
- 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: 58e993aeb43d7857ec9b54e106fa8edc5eaea927
|
4
|
+
data.tar.gz: 212e1572691d6abb29010bac6b5c6e50d96d9266
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 67292f6cb91c332d2989a2815427258271dc526ab4085e393fe064d70aa15af8a7dceaa71dbc204db0675e3e22180d665686fb89738b469d0ef4db539d3695ff
|
7
|
+
data.tar.gz: 82523c788f279d02977d3090cc84ab193d4d5255c7fb02202ba7e43ddaab888d2bd5257dd8645e671eb372d3c3d4a723d2f640bad9add629c9901520d2dbc953
|
data/in_parallel/version.rb
CHANGED
data/lib/parallel_enumerable.rb
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
# }
|
6
6
|
module Enumerable
|
7
7
|
def each_in_parallel(method_sym=nil, &block)
|
8
|
-
if Process.respond_to?(:fork) &&
|
8
|
+
if Process.respond_to?(:fork) && count > 1
|
9
9
|
method_sym ||= "#{caller_locations[0]}"
|
10
10
|
each do |item|
|
11
11
|
out = InParallel._execute_in_parallel(method_sym) {block.call(item)}
|