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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f5665242cec8b96ae4c52a0a85521956d17332c302672f084256f2d7ff22dbb2
4
- data.tar.gz: 6588197a9292d3c6eed3f5b9dfb8a27ad62a6691637dff057ee5671b6433f4cb
3
+ metadata.gz: edbbcafe015e0b5f38bfa846b4d201272326fe31ad5fa48af143177c68be99fe
4
+ data.tar.gz: 7d57ad55cbde23c9e111c2a5b399cbb652c27a301aee055b4a42da6134051ae0
5
5
  SHA512:
6
- metadata.gz: 07ef185fad03e8ef4153296792b91ec0e0596aea4628c38c3b502a7d101df32584be80de97986498e683d93a580847637ba401b801d1004fb1a4e51b20ac8f1d
7
- data.tar.gz: ab4eee5a0845299db8283e176a384ae02c52939585c12942e2eb7955d2b04e6c06bddbb78db0100ffbaf6fe1618fa702f0f8eb782753ee0b19f22b7185e4e65d
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.0] - 2023-04-15
4
- - Initial release
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
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- distributed_merge (0.1.3)
4
+ distributed_merge (0.1.4)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DistributedMerge
4
- VERSION = "0.1.3"
4
+ VERSION = "0.1.4"
5
5
  end
@@ -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
- return self unless two_dimensional?
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
- flatten(1).none? { |arg| arg.instance_of?(Array) } && flatten(1).count > 1
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.3
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-04-15 00:00:00.000000000 Z
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