flex_array 0.3.2 → 0.3.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +0 -15
- data/.reek.yml +17 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/README.md +67 -0
- data/bench/benchmark.rb +243 -0
- data/bench/results.txt +97 -0
- data/flex_array.gemspec +6 -10
- data/irbt.rb +18 -0
- data/lib/flex_array.rb +13 -30
- data/lib/flex_array/array.rb +9 -24
- data/lib/flex_array/flex_array_append.rb +4 -23
- data/lib/flex_array/flex_array_each.rb +33 -208
- data/lib/flex_array/flex_array_forever.rb +6 -4
- data/lib/flex_array/flex_array_index.rb +4 -29
- data/lib/flex_array/flex_array_new.rb +9 -56
- data/lib/flex_array/flex_array_process.rb +23 -63
- data/lib/flex_array/flex_array_reshape.rb +13 -23
- data/lib/flex_array/flex_array_transpose.rb +7 -16
- data/lib/flex_array/flex_array_validate.rb +6 -15
- data/lib/flex_array/integer.rb +4 -13
- data/lib/flex_array/object.rb +4 -13
- data/lib/flex_array/range.rb +4 -13
- data/lib/flex_array/spec_array.rb +5 -9
- data/lib/flex_array/spec_component.rb +14 -22
- data/lib/flex_array/version.rb +1 -2
- data/rakefile.rb +1 -24
- data/reek.txt +9 -2
- data/tests/array_test.rb +0 -4
- data/tests/flex_array_append_test.rb +0 -23
- data/tests/flex_array_each_test.rb +483 -487
- data/tests/flex_array_index_test.rb +0 -4
- data/tests/flex_array_new_test.rb +0 -4
- data/tests/flex_array_reshape_test.rb +4 -4
- data/tests/flex_array_test.rb +0 -4
- data/tests/flex_array_transpose_test.rb +0 -4
- data/tests/flex_array_validate_test.rb +5 -4
- data/tests/integer_test.rb +0 -4
- data/tests/object_test.rb +0 -4
- data/tests/range_test.rb +0 -4
- data/tests/spec_array_test.rb +0 -4
- data/tests/spec_component_test.rb +0 -4
- metadata +19 -49
- data/docs/Flex_Array_UG.odt +0 -0
- data/docs/Flex_Array_UG_Version_0_3_0.pdf +0 -0
- data/flex_array.reek +0 -109
- data/readme.txt +0 -2
- data/sire.rb +0 -82
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class FlexArrayIndexTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_that_it_indexes_correctly
|
12
8
|
q1 = FlexArray.new([3, 3, 3]) {|i| i.dup}
|
13
9
|
|
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class FlexArrayNewTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_the_new_method
|
12
8
|
q1 = FlexArray.new(10, 0)
|
13
9
|
a1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class FlexArrayReshapeTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_the_reshape_method
|
12
8
|
ba1 = [[0,0], [0,1], [0,2], [0,3],
|
13
9
|
[1,0], [1,1], [1,2], [1,3],
|
@@ -59,5 +55,9 @@ class FlexArrayReshapeTester < Minitest::Test
|
|
59
55
|
a = [[0,0],[0,1],[0,2],[1,0],[1,1],[1,2]]
|
60
56
|
assert_equal(a, fa.to_a)
|
61
57
|
assert(fa.array_data.object_id != fa.to_a.object_id)
|
58
|
+
|
59
|
+
fb = fa.transpose(0,1)
|
60
|
+
b = [[0,0],[1,0],[0,1],[1,1],[0,2],[1,2]]
|
61
|
+
assert_equal(b, fb.to_a)
|
62
62
|
end
|
63
63
|
end
|
data/tests/flex_array_test.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class FlexArrayTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_version_reporting
|
12
8
|
f = FlexArray.new([3,3], 'test')
|
13
9
|
|
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class FlexArrayTransposeTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_the_transpose_em_method
|
12
8
|
f = FlexArray.new([3,3]) { |i| i[0]*3 + i[1] }
|
13
9
|
a = [0,1,2,
|
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class FlexArrayValidateTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_the_compatible_method
|
12
8
|
f = FlexArray.new([3,3], 'f')
|
13
9
|
g = FlexArray.new([0...3,0...3], 'g')
|
@@ -19,5 +15,10 @@ class FlexArrayValidateTester < Minitest::Test
|
|
19
15
|
refute(f.compatible?(h))
|
20
16
|
refute(f.compatible?(i))
|
21
17
|
refute(f.compatible?(j))
|
18
|
+
|
19
|
+
assert(j.compatible?([1,2,3]))
|
20
|
+
refute(j.compatible?([1,2,3,4]))
|
21
|
+
|
22
|
+
refute(f.compatible?(42))
|
22
23
|
end
|
23
24
|
end
|
data/tests/integer_test.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class IntegerTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_that_to_spec_component_works
|
12
8
|
lc = (10).to_spec_component(3)
|
13
9
|
assert_equal(0...10, lc.range)
|
data/tests/object_test.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class ObjectTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_that_to_spec_component_fails
|
12
8
|
obj = Object.new
|
13
9
|
assert_raises(ArgumentError) { obj.to_spec_component(42) }
|
data/tests/range_test.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class RangeTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_that_to_spec_component_works
|
12
8
|
lc = (0...10).to_spec_component(3)
|
13
9
|
assert_equal(0...10, lc.range)
|
data/tests/spec_array_test.rb
CHANGED
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class SpecArrayTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def test_that_it_builds_specs
|
12
8
|
spec = SpecArray.new([0...10, 0...8])
|
13
9
|
assert(2, spec.spec_dimensions)
|
@@ -1,13 +1,9 @@
|
|
1
1
|
require_relative '../lib/flex_array'
|
2
2
|
gem 'minitest'
|
3
3
|
require 'minitest/autorun'
|
4
|
-
require 'minitest_visible'
|
5
4
|
|
6
5
|
class SpecComponentTester < Minitest::Test
|
7
6
|
|
8
|
-
#Track mini-test progress.
|
9
|
-
include MinitestVisible
|
10
|
-
|
11
7
|
def setup
|
12
8
|
@lc = SpecComponent.new(1..5, 10)
|
13
9
|
end
|
metadata
CHANGED
@@ -1,57 +1,57 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flex_array
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Camilleri
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-05-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 2.1.0
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 2.1.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 12.3.3
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 12.3.3
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: reek
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: 5.0.2
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: 5.0.2
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: minitest
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -66,34 +66,6 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 4.7.5
|
69
|
-
- !ruby/object:Gem::Dependency
|
70
|
-
name: rdoc
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
72
|
-
requirements:
|
73
|
-
- - "~>"
|
74
|
-
- !ruby/object:Gem::Version
|
75
|
-
version: 4.0.1
|
76
|
-
type: :development
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: 4.0.1
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: minitest_visible
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - ">="
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: 0.1.0
|
90
|
-
type: :development
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - ">="
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 0.1.0
|
97
69
|
- !ruby/object:Gem::Dependency
|
98
70
|
name: in_array
|
99
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,16 +84,18 @@ description: 'A flexible, multidimensional array class for Ruby. '
|
|
112
84
|
email: peter.c.camilleri@gmail.com
|
113
85
|
executables: []
|
114
86
|
extensions: []
|
115
|
-
extra_rdoc_files:
|
116
|
-
- license.txt
|
87
|
+
extra_rdoc_files: []
|
117
88
|
files:
|
118
89
|
- ".gitignore"
|
90
|
+
- ".reek.yml"
|
91
|
+
- CODE_OF_CONDUCT.md
|
119
92
|
- Gemfile
|
120
|
-
-
|
121
|
-
-
|
93
|
+
- README.md
|
94
|
+
- bench/benchmark.rb
|
95
|
+
- bench/results.txt
|
122
96
|
- flex_array
|
123
97
|
- flex_array.gemspec
|
124
|
-
-
|
98
|
+
- irbt.rb
|
125
99
|
- lib/flex_array.rb
|
126
100
|
- lib/flex_array/array.rb
|
127
101
|
- lib/flex_array/flex_array_append.rb
|
@@ -141,9 +115,7 @@ files:
|
|
141
115
|
- lib/flex_array/version.rb
|
142
116
|
- license.txt
|
143
117
|
- rakefile.rb
|
144
|
-
- readme.txt
|
145
118
|
- reek.txt
|
146
|
-
- sire.rb
|
147
119
|
- tests/array_test.rb
|
148
120
|
- tests/flex_array_append_test.rb
|
149
121
|
- tests/flex_array_each_test.rb
|
@@ -158,7 +130,7 @@ files:
|
|
158
130
|
- tests/range_test.rb
|
159
131
|
- tests/spec_array_test.rb
|
160
132
|
- tests/spec_component_test.rb
|
161
|
-
homepage:
|
133
|
+
homepage: https://github.com/PeterCamilleri/flex_array
|
162
134
|
licenses:
|
163
135
|
- MIT
|
164
136
|
metadata: {}
|
@@ -177,10 +149,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
177
149
|
- !ruby/object:Gem::Version
|
178
150
|
version: '0'
|
179
151
|
requirements: []
|
180
|
-
|
181
|
-
rubygems_version: 2.2.2
|
152
|
+
rubygems_version: 3.2.17
|
182
153
|
signing_key:
|
183
154
|
specification_version: 4
|
184
155
|
summary: A flexible array class.
|
185
156
|
test_files: []
|
186
|
-
has_rdoc: true
|
data/docs/Flex_Array_UG.odt
DELETED
Binary file
|
Binary file
|
data/flex_array.reek
DELETED
@@ -1,109 +0,0 @@
|
|
1
|
-
---
|
2
|
-
Attribute:
|
3
|
-
enabled: false
|
4
|
-
exclude: []
|
5
|
-
BooleanParameter:
|
6
|
-
enabled: true
|
7
|
-
exclude: []
|
8
|
-
ClassVariable:
|
9
|
-
enabled: true
|
10
|
-
exclude: []
|
11
|
-
ControlParameter:
|
12
|
-
enabled: true
|
13
|
-
exclude: []
|
14
|
-
DataClump:
|
15
|
-
enabled: true
|
16
|
-
exclude: []
|
17
|
-
max_copies: 2
|
18
|
-
min_clump_size: 2
|
19
|
-
DuplicateMethodCall:
|
20
|
-
enabled: true
|
21
|
-
exclude: []
|
22
|
-
max_calls: 1
|
23
|
-
allow_calls: []
|
24
|
-
FeatureEnvy:
|
25
|
-
enabled: true
|
26
|
-
exclude: []
|
27
|
-
IrresponsibleModule:
|
28
|
-
enabled: true
|
29
|
-
exclude: []
|
30
|
-
LongParameterList:
|
31
|
-
enabled: true
|
32
|
-
exclude: []
|
33
|
-
max_params: 3
|
34
|
-
overrides:
|
35
|
-
initialize:
|
36
|
-
max_params: 5
|
37
|
-
LongYieldList:
|
38
|
-
enabled: true
|
39
|
-
exclude: []
|
40
|
-
max_params: 3
|
41
|
-
NestedIterators:
|
42
|
-
enabled: true
|
43
|
-
exclude: []
|
44
|
-
max_allowed_nesting: 1
|
45
|
-
ignore_iterators: []
|
46
|
-
NilCheck:
|
47
|
-
enabled: true
|
48
|
-
exclude: []
|
49
|
-
PrimaDonnaMethod:
|
50
|
-
enabled: true
|
51
|
-
exclude: []
|
52
|
-
RepeatedConditional:
|
53
|
-
enabled: true
|
54
|
-
exclude: []
|
55
|
-
max_ifs: 2
|
56
|
-
TooManyInstanceVariables:
|
57
|
-
enabled: true
|
58
|
-
exclude: []
|
59
|
-
max_instance_variables: 9
|
60
|
-
TooManyMethods:
|
61
|
-
enabled: true
|
62
|
-
exclude: []
|
63
|
-
max_methods: 25
|
64
|
-
TooManyStatements:
|
65
|
-
enabled: true
|
66
|
-
exclude:
|
67
|
-
- initialize
|
68
|
-
max_statements: 7
|
69
|
-
UncommunicativeMethodName:
|
70
|
-
enabled: true
|
71
|
-
exclude: []
|
72
|
-
reject:
|
73
|
-
- !ruby/regexp /^[a-z]$/
|
74
|
-
- !ruby/regexp /[0-9]$/
|
75
|
-
- !ruby/regexp /[A-Z]/
|
76
|
-
accept: []
|
77
|
-
UncommunicativeModuleName:
|
78
|
-
enabled: true
|
79
|
-
exclude: []
|
80
|
-
reject:
|
81
|
-
- !ruby/regexp /^.$/
|
82
|
-
- !ruby/regexp /[0-9]$/
|
83
|
-
accept:
|
84
|
-
- Inline::C
|
85
|
-
UncommunicativeParameterName:
|
86
|
-
enabled: true
|
87
|
-
exclude: []
|
88
|
-
reject:
|
89
|
-
- !ruby/regexp /^.$/
|
90
|
-
- !ruby/regexp /[0-9]$/
|
91
|
-
- !ruby/regexp /[A-Z]/
|
92
|
-
- !ruby/regexp /^_/
|
93
|
-
accept: []
|
94
|
-
UncommunicativeVariableName:
|
95
|
-
enabled: true
|
96
|
-
exclude: []
|
97
|
-
reject:
|
98
|
-
- !ruby/regexp /^.$/
|
99
|
-
- !ruby/regexp /[0-9]$/
|
100
|
-
- !ruby/regexp /[A-Z]/
|
101
|
-
accept:
|
102
|
-
- _
|
103
|
-
UnusedParameters:
|
104
|
-
enabled: true
|
105
|
-
exclude: []
|
106
|
-
UtilityFunction:
|
107
|
-
enabled: true
|
108
|
-
exclude: []
|
109
|
-
max_helper_calls: 1
|