jabara_group 0.1.1 → 0.2.0
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/.github/workflows/test.yml +10 -3
- data/CHANGELOG.md +9 -0
- data/README.md +1 -1
- data/lib/jabara_group/version.rb +1 -1
- data/lib/jabara_group.rb +14 -0
- data/sig/jabara_group.rbs +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f3146fa943e7c76cb41fea4a2a0029a0b3dcefb2d7cebdc63db124d6e70184db
|
4
|
+
data.tar.gz: 9101738b638da7d9bbc2ee1eab20368dc14da2e00b852cbaaca53ac9628f8146
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5889df9191b542cf47d51f497b894ecdf601a744aa71b6273a95a7946db975df832f8e21e1248c149bb353e80b299839409004ee2a87bc5b62b968079525bf5f
|
7
|
+
data.tar.gz: 7f245a6eba794a691f3d163d0cccf591d97cd7b10e9be885cf1f6715074f07f3fe0d0dfbce1d625e5d1d522073957a9fd3dd03f8a81a55f710d307f1ff2ba43f
|
data/.github/workflows/test.yml
CHANGED
@@ -9,15 +9,22 @@ on:
|
|
9
9
|
jobs:
|
10
10
|
test:
|
11
11
|
runs-on: ubuntu-latest
|
12
|
+
if: >-
|
13
|
+
${{!(false
|
14
|
+
|| contains(github.event.head_commit.message, '[DOC]')
|
15
|
+
|| contains(github.event.pull_request.title, '[DOC]')
|
16
|
+
)}}
|
17
|
+
|
12
18
|
strategy:
|
13
19
|
matrix:
|
14
|
-
ruby-version: ['3.1', '3.
|
20
|
+
ruby-version: ['3.1', '3.2', '3.3', '3.4']
|
15
21
|
steps:
|
16
|
-
- uses: actions/checkout@
|
22
|
+
- uses: actions/checkout@v4
|
17
23
|
- name: Set up Ruby ${{ matrix.ruby-version }}
|
18
|
-
uses: ruby/setup-ruby@
|
24
|
+
uses: ruby/setup-ruby@v1
|
19
25
|
with:
|
20
26
|
ruby-version: ${{ matrix.ruby-version }}
|
27
|
+
bundler-cache: true
|
21
28
|
- name: Install dependencies
|
22
29
|
run: bundle install
|
23
30
|
- name: Run tests
|
data/CHANGELOG.md
ADDED
data/README.md
CHANGED
data/lib/jabara_group/version.rb
CHANGED
data/lib/jabara_group.rb
CHANGED
@@ -37,4 +37,18 @@ module Enumerable
|
|
37
37
|
index += direction
|
38
38
|
end
|
39
39
|
end
|
40
|
+
|
41
|
+
# Divides +self+ for +keys+.
|
42
|
+
#
|
43
|
+
# This method divides +self+ into +self.size+ groups and returns a +Hash+ with +keys+ as keys and groups as values.
|
44
|
+
#
|
45
|
+
# ("a".."l").jabara_for(%w(A B C)) # => { "A" => ["a", "f", "g", "l"], "B" => ["b", "e", "h", "k"], "C" => ["c", "d", "i", "j"] }
|
46
|
+
#
|
47
|
+
# @param keys [Enumerable]
|
48
|
+
# @return [Hash<Object, Array<Object>>]
|
49
|
+
def jabara_for(keys)
|
50
|
+
keys_array = keys.to_a
|
51
|
+
groups = jabara(keys_array.size)
|
52
|
+
keys_array.zip(groups).to_h
|
53
|
+
end
|
40
54
|
end
|
data/sig/jabara_group.rbs
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jabara_group
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kouhei Yanagita
|
@@ -73,6 +73,7 @@ extra_rdoc_files: []
|
|
73
73
|
files:
|
74
74
|
- ".github/workflows/test.yml"
|
75
75
|
- ".gitignore"
|
76
|
+
- CHANGELOG.md
|
76
77
|
- Gemfile
|
77
78
|
- LICENSE.txt
|
78
79
|
- README.md
|