distributed_merge 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -7
- data/Gemfile.lock +1 -1
- data/lib/distributed_merge/version.rb +1 -1
- data/lib/distributed_merge.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: edbbcafe015e0b5f38bfa846b4d201272326fe31ad5fa48af143177c68be99fe
|
4
|
+
data.tar.gz: 7d57ad55cbde23c9e111c2a5b399cbb652c27a301aee055b4a42da6134051ae0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 909d55b3872cec0722fb2f14dd7a09946eab0650333948007903c23b3882c0a132ee7484c2a6cc6a9acaa2884849278aa5de0277ee3c14b440e864ca1a0cca7c
|
7
|
+
data.tar.gz: 1b4832754218550ef260a2d8aad8b92afe7f7c0fe4c2f1bd6e7147cbd4b0900272d625ff6cabf660f6322e32613518a8017adf6411f5e1f0422fa7e9161ca1d5
|
data/CHANGELOG.md
CHANGED
@@ -1,14 +1,15 @@
|
|
1
1
|
## [Released]
|
2
2
|
|
3
|
-
## [0.1.
|
4
|
-
-
|
5
|
-
|
3
|
+
## [0.1.4] - 2023-05-06
|
4
|
+
- Improvements related to .flatten method, fixing typos
|
5
|
+
## [0.1.3] - 2023-04-15
|
6
|
+
- Templates added for PR's, bug reports and feature requests
|
7
|
+
## [0.1.2] - 2023-04-15
|
8
|
+
- Improvements to CI workflow
|
6
9
|
## [0.1.1] - 2023-04-15
|
7
10
|
- Fixes for broken links
|
8
11
|
- Updates to CI workflow
|
12
|
+
## [0.1.0] - 2023-04-15
|
13
|
+
- Initial release
|
9
14
|
|
10
|
-
## [0.1.2] - 2023-04-15
|
11
|
-
- Improvements to CI workflow
|
12
15
|
|
13
|
-
## [0.1.3] - 2023-04-16
|
14
|
-
- Templates added for PR's, bug reports and feature requests
|
data/Gemfile.lock
CHANGED
data/lib/distributed_merge.rb
CHANGED
@@ -17,7 +17,7 @@ module DistributedMerge
|
|
17
17
|
# Accepts a two-dimensional array with subarrays of varying size and returns
|
18
18
|
# merged array with the elements distributed across.
|
19
19
|
def distributed_merge
|
20
|
-
|
20
|
+
raise ArgumentError, "Input must be an array of arrays" unless two_dimensional?
|
21
21
|
|
22
22
|
data = sort_arrays_by_size
|
23
23
|
largest = data.first
|
@@ -44,7 +44,9 @@ module DistributedMerge
|
|
44
44
|
def two_dimensional?
|
45
45
|
return false unless all_arrays?
|
46
46
|
|
47
|
-
|
47
|
+
flattened_array = flatten(1)
|
48
|
+
|
49
|
+
flattened_array.none? { |arg| arg.instance_of?(Array) } && flattened_array.count > 1
|
48
50
|
end
|
49
51
|
|
50
52
|
def all_arrays?
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: distributed_merge
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- msuliq
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-05-06 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
This gem extends Array class with the distributed_merge method that
|