Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

distributed_merge

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

distributed_merge

  • 0.1.4
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

DistributedMerge

Coverage

'distributed_merge' is a Ruby gem that adds a method to Array class that allows merge interleaving arrays of non-equal length with elements being equally distributed. The method can be called on a two-dimensional array containing two or more sub-arrays of various size.

Installation

To install the gem run the following command in the terminal:

$ bundle add distributed_merge

If bundler is not being used to manage dependencies, install the gem by executing:

$ gem install distributed_merge

Usage

To add the distributed_merge method to your project include it in your project like so:

require 'distributed_merge'

When included the method can be called on any two-dimensional array containing sub-arrays of various size (non-equal length) and it will return a single layer merged array with all the elements of the sub-arrays evenly interleaved and distributed.

[[1, 2, 3, 4], ['a', 'b'], ['C']].distributed_merge
# => [1, "b", 2, "C", 3, "a", 4]

Contributing

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.

The best way to contribute would be to fork this repo, create a new branch from main, to merge the branch into main of the fork once the new code is in place and then open a pull request to merge forked main into the main of the present repo.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the DistributedMerge project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

FAQs

Package last updated on 06 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc