array_arithmetic 1.0.1 → 1.1.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/array_arithmetic-1.0.0.gem +0 -0
- data/lib/array_arithmetic/version.rb +1 -1
- data/lib/array_arithmetic.rb +10 -2
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0bce38302e30997f0f9c98d1e9c6368a465bec7
|
4
|
+
data.tar.gz: 8b1f681c286858ba42b743a7977f716a27b6381d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6ea2a2ec5150424aba72d1724877691e44b0ac1cd1e903d1da1d772664a131b4a4eff6a291e4ca5dbc1b0cfaa039084c678e822562a12760c7eea147cea0395
|
7
|
+
data.tar.gz: b8899279db01675f91eca2ec5ab3f4e943c6dc57426659b3539c9cc33a2284fcc4eee7854c34af51efdeec51b815f457efde8391f11923871dd3d9a876043a83
|
Binary file
|
data/lib/array_arithmetic.rb
CHANGED
@@ -194,7 +194,11 @@ def update_array_length(arr_one, arr_two)
|
|
194
194
|
if arr_one.length == 1
|
195
195
|
adjusted_arr_one << arr_one[0]
|
196
196
|
elsif index >= arr_one.length
|
197
|
-
|
197
|
+
if index >= arr_one.length * 2
|
198
|
+
adjusted_arr_one << arr_one[index % arr_one.length]
|
199
|
+
else
|
200
|
+
adjusted_arr_one << arr_one[index - arr_one.length]
|
201
|
+
end
|
198
202
|
else
|
199
203
|
adjusted_arr_one << arr_one[index]
|
200
204
|
end
|
@@ -206,7 +210,11 @@ def update_array_length(arr_one, arr_two)
|
|
206
210
|
if arr_two.length == 1
|
207
211
|
adjusted_arr_two << arr_two[0]
|
208
212
|
elsif index >= arr_two.length
|
209
|
-
|
213
|
+
if index >= arr_two.length * 2
|
214
|
+
adjusted_arr_two << arr_two[index % arr_two.length]
|
215
|
+
else
|
216
|
+
adjusted_arr_two << arr_two[index - arr_two.length]
|
217
|
+
end
|
210
218
|
else
|
211
219
|
adjusted_arr_two << arr_two[index]
|
212
220
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: array_arithmetic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- C.J. Adeszko
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-07-
|
11
|
+
date: 2019-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -68,6 +68,7 @@ files:
|
|
68
68
|
- README.md
|
69
69
|
- Rakefile
|
70
70
|
- array_arithmetic-0.1.0.gem
|
71
|
+
- array_arithmetic-1.0.0.gem
|
71
72
|
- array_arithmetic.gemspec
|
72
73
|
- bin/console
|
73
74
|
- bin/setup
|