distributed_merge 0.1.4 → 0.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +2 -2
- data/Gemfile +7 -9
- data/Gemfile.lock +3 -2
- data/README.md +20 -14
- data/lib/distributed_merge/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c6c33d5b5903da8ebbefeb8e1f47b8a67dbdf7f44b227d6ba72ca5ad18f9548
|
4
|
+
data.tar.gz: 1cbb94a11ba4ae5b49e6cb48ff8099ae5b65813caf82e8a0ec825103f01bdc82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f262f038972d32db950fa259541ec15d11cb47569256053bc129bfb4a96dd051f036900794dc853b840f59993e2daf1416125b04a8ee7d0af4f0ac88b05bd326
|
7
|
+
data.tar.gz: d5bb44d1d4a03d3de7c1d7e414404ba912f4d97e6c33e8ce5a84cfb69f2427c0662b9217136523579598d48cc62c41088d5faa2f189210e8e22aedd388852153
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
## [Released]
|
2
2
|
|
3
|
+
## [0.1.5] - 2024-12-29
|
4
|
+
- Update readme
|
3
5
|
## [0.1.4] - 2023-05-06
|
4
6
|
- Improvements related to .flatten method, fixing typos
|
5
7
|
## [0.1.3] - 2023-04-15
|
@@ -11,5 +13,3 @@
|
|
11
13
|
- Updates to CI workflow
|
12
14
|
## [0.1.0] - 2023-04-15
|
13
15
|
- Initial release
|
14
|
-
|
15
|
-
|
data/Gemfile
CHANGED
@@ -5,12 +5,10 @@ source "https://rubygems.org"
|
|
5
5
|
# Specify your gem's dependencies in distributed_merge.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
gem "minitest", "~> 5.0"
|
11
|
-
|
12
|
-
gem "rubocop", "~> 1.21"
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
gem "bundle-audit", "~> 0.1.0"
|
8
|
+
group :development, :test do
|
9
|
+
gem "bundle-audit", "~> 0.1.0"
|
10
|
+
gem "minitest", "~> 5.0"
|
11
|
+
gem "rake", "~> 13.0"
|
12
|
+
gem "rubocop", "~> 1.21"
|
13
|
+
gem "single_cov", "~> 1.9"
|
14
|
+
end
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
distributed_merge (0.1.
|
4
|
+
distributed_merge (0.1.5)
|
5
5
|
|
6
6
|
GEM
|
7
7
|
remote: https://rubygems.org/
|
@@ -20,7 +20,7 @@ GEM
|
|
20
20
|
rainbow (3.1.1)
|
21
21
|
rake (13.0.6)
|
22
22
|
regexp_parser (2.7.0)
|
23
|
-
rexml (3.
|
23
|
+
rexml (3.4.0)
|
24
24
|
rubocop (1.50.1)
|
25
25
|
json (~> 2.3)
|
26
26
|
parallel (~> 1.10)
|
@@ -39,6 +39,7 @@ GEM
|
|
39
39
|
unicode-display_width (2.4.2)
|
40
40
|
|
41
41
|
PLATFORMS
|
42
|
+
ruby
|
42
43
|
x86_64-darwin-19
|
43
44
|
x86_64-linux
|
44
45
|
|
data/README.md
CHANGED
@@ -1,36 +1,42 @@
|
|
1
1
|
# DistributedMerge
|
2
2
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
distributed. The method can be called on a two-dimensional array containing two
|
8
|
-
or more sub-arrays of various size.
|
3
|
+
`distributed_merge` is a Ruby gem that extends the `Array` class with a method for merging
|
4
|
+
and interleaving arrays of varying lengths, ensuring that elements are distributed as
|
5
|
+
evenly as possible. This method can be applied to any two-dimensional array containing two
|
6
|
+
or more sub-arrays of different sizes.
|
9
7
|
|
10
8
|
## Installation
|
11
9
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
If bundler is not being used to manage dependencies, install the gem by executing:
|
10
|
+
Add the gem to your project by running:
|
11
|
+
```bash
|
12
|
+
bundle add distributed_merge
|
13
|
+
```
|
17
14
|
|
18
|
-
|
15
|
+
If you are not using Bundler to manage dependencies, install the gem directly with:
|
16
|
+
```bash
|
17
|
+
gem install distributed_merge
|
18
|
+
```
|
19
19
|
|
20
20
|
## Usage
|
21
21
|
|
22
|
-
To
|
22
|
+
To use the `distributed_merge` method, include the gem in your project:
|
23
23
|
```ruby
|
24
24
|
require 'distributed_merge'
|
25
25
|
```
|
26
26
|
|
27
|
-
|
27
|
+
Once included, you can call the `distributed_merge` method on any two-dimensional array
|
28
|
+
containing sub-arrays of varying lengths. The method will return a single merged array
|
29
|
+
with all elements interleaved and evenly distributed.
|
28
30
|
|
29
31
|
```ruby
|
30
32
|
[[1, 2, 3, 4], ['a', 'b'], ['C']].distributed_merge
|
31
33
|
# => [1, "b", 2, "C", 3, "a", 4]
|
32
34
|
```
|
33
35
|
|
36
|
+
In this example:
|
37
|
+
* The method merges the sub-arrays `[1, 2, 3, 4]`, `['a', 'b']`, and `['C']`.
|
38
|
+
* It ensures the elements are interleaved and distributed as evenly as possible in the final array.
|
39
|
+
|
34
40
|
## Contributing
|
35
41
|
|
36
42
|
Bug reports and pull requests are welcome at https://github.com/msuliq/distributed_merge. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/msuliq/distributed_merge/blob/main/CODE_OF_CONDUCT.md).
|
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.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- msuliq
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |-
|
14
14
|
This gem extends Array class with the distributed_merge method that
|
@@ -39,7 +39,7 @@ metadata:
|
|
39
39
|
homepage_uri: https://github.com/msuliq/distributed_merge
|
40
40
|
source_code_uri: https://github.com/msuliq/distributed_merge
|
41
41
|
changelog_uri: https://github.com/msuliq/distributed_merge/blob/main/CHANGELOG.md
|
42
|
-
post_install_message:
|
42
|
+
post_install_message:
|
43
43
|
rdoc_options: []
|
44
44
|
require_paths:
|
45
45
|
- lib
|
@@ -55,7 +55,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
55
55
|
version: '0'
|
56
56
|
requirements: []
|
57
57
|
rubygems_version: 3.1.6
|
58
|
-
signing_key:
|
58
|
+
signing_key:
|
59
59
|
specification_version: 4
|
60
60
|
summary: Gem that adds the method to merge arrays of unequal size with distribution
|
61
61
|
of elements.
|