flex_array 0.3.0 → 0.3.1
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 +8 -8
- data/.gitignore +4 -0
- data/docs/Flex_Array_UG.odt +0 -0
- data/docs/Flex_Array_UG_Version_0_3_0.pdf +0 -0
- data/flex_array +119 -0
- data/flex_array.gemspec +36 -0
- data/flex_array.reek +109 -0
- data/lib/flex_array.rb +5 -2
- data/rakefile.rb +17 -31
- data/sire.rb +82 -0
- data/tests/flex_array_test.rb +2 -3
- metadata +52 -30
checksums.yaml
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
---
|
|
2
2
|
!binary "U0hBMQ==":
|
|
3
3
|
metadata.gz: !binary |-
|
|
4
|
-
|
|
4
|
+
ZDViNzhjODQyODZmYzZlZWQyOTY2YjZkN2IyOTc0MzQ1NmViNGI1MA==
|
|
5
5
|
data.tar.gz: !binary |-
|
|
6
|
-
|
|
6
|
+
N2YzN2EzYTA4MzAwNzZlMjY3NDM2NDA5NzBmNGE3ZjRmYjI1ODhmOA==
|
|
7
7
|
SHA512:
|
|
8
8
|
metadata.gz: !binary |-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
NWYxNzgyYzUzM2ZhNzBjYjRjOTE2ZDEzOWI2NmIyNzhkZjhkMmNkYjBlNWY4
|
|
10
|
+
ZmY1MzQxOTM2MjE0MTg0NjdlNDE4MDAxZGE1Y2FjNGZjZDdhY2E2MjEzZGM5
|
|
11
|
+
Y2EyMWU0ZDY2ZjI1MTY0OGIxOTJjYjU3YWI3OTYyMTRmMzY3OWI=
|
|
12
12
|
data.tar.gz: !binary |-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
NWY4YjZmOTQ1MTUxODE0YTdmODNlMDVhY2U5NGM1MTkxNmI3ZDgzOGFmYTI3
|
|
14
|
+
YjJhNGFkYzY3YzdhM2JhYTAzZTg3OTMyNDM3NjVhMDhkZmU0ZGE4NzhiNjFm
|
|
15
|
+
YTRlYWQzMWM3YjRjMGEwYTM4OGM4M2Y0Njk2Y2Y4NGU2ZTU2NDE=
|
data/.gitignore
ADDED
|
Binary file
|
|
Binary file
|
data/flex_array
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
<NotepadPlus>
|
|
2
|
+
<Project name="FlexArray">
|
|
3
|
+
<Folder name="Folder Name">
|
|
4
|
+
<Folder name="docs">
|
|
5
|
+
<File name="docs\Flex_Array_UG.odt" />
|
|
6
|
+
<File name="docs\Flex_Array_UG_Version_0_3_0.pdf" />
|
|
7
|
+
</Folder>
|
|
8
|
+
<Folder name="lib">
|
|
9
|
+
<Folder name="flex_array">
|
|
10
|
+
<File name="lib\flex_array\array.rb" />
|
|
11
|
+
<File name="lib\flex_array\flex_array_append.rb" />
|
|
12
|
+
<File name="lib\flex_array\flex_array_each.rb" />
|
|
13
|
+
<File name="lib\flex_array\flex_array_forever.rb" />
|
|
14
|
+
<File name="lib\flex_array\flex_array_index.rb" />
|
|
15
|
+
<File name="lib\flex_array\flex_array_new.rb" />
|
|
16
|
+
<File name="lib\flex_array\flex_array_process.rb" />
|
|
17
|
+
<File name="lib\flex_array\flex_array_reshape.rb" />
|
|
18
|
+
<File name="lib\flex_array\flex_array_transpose.rb" />
|
|
19
|
+
<File name="lib\flex_array\flex_array_validate.rb" />
|
|
20
|
+
<File name="lib\flex_array\integer.rb" />
|
|
21
|
+
<File name="lib\flex_array\object.rb" />
|
|
22
|
+
<File name="lib\flex_array\range.rb" />
|
|
23
|
+
<File name="lib\flex_array\spec_array.rb" />
|
|
24
|
+
<File name="lib\flex_array\spec_component.rb" />
|
|
25
|
+
</Folder>
|
|
26
|
+
<File name="lib\flex_array.rb" />
|
|
27
|
+
</Folder>
|
|
28
|
+
<Folder name="rdoc">
|
|
29
|
+
<Folder name="FlexArray">
|
|
30
|
+
<File name="rdoc\FlexArray\ForEver.html" />
|
|
31
|
+
</Folder>
|
|
32
|
+
<Folder name="fonts">
|
|
33
|
+
<File name="rdoc\fonts\Lato-Light.ttf" />
|
|
34
|
+
<File name="rdoc\fonts\Lato-LightItalic.ttf" />
|
|
35
|
+
<File name="rdoc\fonts\Lato-Regular.ttf" />
|
|
36
|
+
<File name="rdoc\fonts\Lato-RegularItalic.ttf" />
|
|
37
|
+
<File name="rdoc\fonts\SourceCodePro-Bold.ttf" />
|
|
38
|
+
<File name="rdoc\fonts\SourceCodePro-Regular.ttf" />
|
|
39
|
+
</Folder>
|
|
40
|
+
<Folder name="images">
|
|
41
|
+
<File name="rdoc\images\add.png" />
|
|
42
|
+
<File name="rdoc\images\arrow_up.png" />
|
|
43
|
+
<File name="rdoc\images\brick.png" />
|
|
44
|
+
<File name="rdoc\images\brick_link.png" />
|
|
45
|
+
<File name="rdoc\images\bug.png" />
|
|
46
|
+
<File name="rdoc\images\bullet_black.png" />
|
|
47
|
+
<File name="rdoc\images\bullet_toggle_minus.png" />
|
|
48
|
+
<File name="rdoc\images\bullet_toggle_plus.png" />
|
|
49
|
+
<File name="rdoc\images\date.png" />
|
|
50
|
+
<File name="rdoc\images\delete.png" />
|
|
51
|
+
<File name="rdoc\images\find.png" />
|
|
52
|
+
<File name="rdoc\images\loadingAnimation.gif" />
|
|
53
|
+
<File name="rdoc\images\macFFBgHack.png" />
|
|
54
|
+
<File name="rdoc\images\package.png" />
|
|
55
|
+
<File name="rdoc\images\page_green.png" />
|
|
56
|
+
<File name="rdoc\images\page_white_text.png" />
|
|
57
|
+
<File name="rdoc\images\page_white_width.png" />
|
|
58
|
+
<File name="rdoc\images\plugin.png" />
|
|
59
|
+
<File name="rdoc\images\ruby.png" />
|
|
60
|
+
<File name="rdoc\images\tag_blue.png" />
|
|
61
|
+
<File name="rdoc\images\tag_green.png" />
|
|
62
|
+
<File name="rdoc\images\transparent.png" />
|
|
63
|
+
<File name="rdoc\images\wrench.png" />
|
|
64
|
+
<File name="rdoc\images\wrench_orange.png" />
|
|
65
|
+
<File name="rdoc\images\zoom.png" />
|
|
66
|
+
</Folder>
|
|
67
|
+
<Folder name="js">
|
|
68
|
+
<File name="rdoc\js\darkfish.js" />
|
|
69
|
+
<File name="rdoc\js\jquery.js" />
|
|
70
|
+
<File name="rdoc\js\navigation.js" />
|
|
71
|
+
<File name="rdoc\js\search.js" />
|
|
72
|
+
<File name="rdoc\js\searcher.js" />
|
|
73
|
+
<File name="rdoc\js\search_index.js" />
|
|
74
|
+
</Folder>
|
|
75
|
+
<File name="rdoc\Array.html" />
|
|
76
|
+
<File name="rdoc\created.rid" />
|
|
77
|
+
<File name="rdoc\FlexArray.html" />
|
|
78
|
+
<File name="rdoc\fonts.css" />
|
|
79
|
+
<File name="rdoc\index.html" />
|
|
80
|
+
<File name="rdoc\Integer.html" />
|
|
81
|
+
<File name="rdoc\license_txt.html" />
|
|
82
|
+
<File name="rdoc\Object.html" />
|
|
83
|
+
<File name="rdoc\Range.html" />
|
|
84
|
+
<File name="rdoc\rdoc.css" />
|
|
85
|
+
<File name="rdoc\readme_txt.html" />
|
|
86
|
+
<File name="rdoc\SpecArray.html" />
|
|
87
|
+
<File name="rdoc\SpecComponent.html" />
|
|
88
|
+
<File name="rdoc\table_of_contents.html" />
|
|
89
|
+
</Folder>
|
|
90
|
+
<Folder name="tests">
|
|
91
|
+
<File name="tests\array_test.rb" />
|
|
92
|
+
<File name="tests\flex_array_append_test.rb" />
|
|
93
|
+
<File name="tests\flex_array_each_test.rb" />
|
|
94
|
+
<File name="tests\flex_array_index_test.rb" />
|
|
95
|
+
<File name="tests\flex_array_new_test.rb" />
|
|
96
|
+
<File name="tests\flex_array_reshape_test.rb" />
|
|
97
|
+
<File name="tests\flex_array_test.rb" />
|
|
98
|
+
<File name="tests\flex_array_transpose_test.rb" />
|
|
99
|
+
<File name="tests\flex_array_validate_test.rb" />
|
|
100
|
+
<File name="tests\integer_test.rb" />
|
|
101
|
+
<File name="tests\object_test.rb" />
|
|
102
|
+
<File name="tests\range_test.rb" />
|
|
103
|
+
<File name="tests\spec_array_test.rb" />
|
|
104
|
+
<File name="tests\spec_component_test.rb" />
|
|
105
|
+
</Folder>
|
|
106
|
+
<File name=".gitignore" />
|
|
107
|
+
<File name="flex_array" />
|
|
108
|
+
<File name="flex_array-0.2.0.gem" />
|
|
109
|
+
<File name="flex_array-0.3.0.gem" />
|
|
110
|
+
<File name="flex_array.gemspec" />
|
|
111
|
+
<File name="flex_array.reek" />
|
|
112
|
+
<File name="license.txt" />
|
|
113
|
+
<File name="rakefile.rb" />
|
|
114
|
+
<File name="readme.txt" />
|
|
115
|
+
<File name="reek.txt" />
|
|
116
|
+
<File name="sire.rb" />
|
|
117
|
+
</Folder>
|
|
118
|
+
</Project>
|
|
119
|
+
</NotepadPlus>
|
data/flex_array.gemspec
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
|
|
3
|
+
#Specify the building of the flex_array gem.
|
|
4
|
+
|
|
5
|
+
lib = File.expand_path('../lib', __FILE__)
|
|
6
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
7
|
+
require 'flex_array/version'
|
|
8
|
+
|
|
9
|
+
Gem::Specification.new do |s|
|
|
10
|
+
s.name = "flex_array"
|
|
11
|
+
s.summary = "A flexible array class."
|
|
12
|
+
s.description = 'A flexible, multidimensional array class for Ruby. '
|
|
13
|
+
s.version = FlexArray::VERSION
|
|
14
|
+
s.author = ["Peter Camilleri"]
|
|
15
|
+
s.email = "peter.c.camilleri@gmail.com"
|
|
16
|
+
s.homepage = "http://teuthida-technologies.com/"
|
|
17
|
+
s.platform = Gem::Platform::RUBY
|
|
18
|
+
s.required_ruby_version = '>=1.9.3'
|
|
19
|
+
|
|
20
|
+
s.add_development_dependency "bundler", "~> 1.3"
|
|
21
|
+
s.add_development_dependency 'rake'
|
|
22
|
+
s.add_development_dependency 'reek', "~> 1.3.8"
|
|
23
|
+
s.add_development_dependency 'minitest', "~> 4.7.5"
|
|
24
|
+
s.add_development_dependency 'rdoc', "~> 4.0.1"
|
|
25
|
+
|
|
26
|
+
s.add_runtime_dependency 'in_array'
|
|
27
|
+
|
|
28
|
+
s.files = `git ls-files`.split($/)
|
|
29
|
+
s.extra_rdoc_files = ['license.txt']
|
|
30
|
+
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
|
31
|
+
|
|
32
|
+
s.license = 'MIT'
|
|
33
|
+
s.has_rdoc = true
|
|
34
|
+
s.require_paths = ["lib"]
|
|
35
|
+
end
|
|
36
|
+
|
data/flex_array.reek
ADDED
|
@@ -0,0 +1,109 @@
|
|
|
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
|
data/lib/flex_array.rb
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
require 'in_array'
|
|
2
|
+
|
|
3
|
+
require_relative 'flex_array/version'
|
|
4
|
+
|
|
2
5
|
require_relative 'flex_array/flex_array_forever'
|
|
3
6
|
require_relative 'flex_array/spec_component'
|
|
4
7
|
require_relative 'flex_array/spec_array'
|
|
@@ -25,14 +28,14 @@ class FlexArray
|
|
|
25
28
|
#<br>Returns
|
|
26
29
|
#* A version string; <major>.<minor>.<step>
|
|
27
30
|
def self.version
|
|
28
|
-
|
|
31
|
+
FlexArray::VERSION
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
#The version of the class of this instance.
|
|
32
35
|
#<br>Returns
|
|
33
36
|
#* A version string; <major>.<minor>.<step>
|
|
34
37
|
def version
|
|
35
|
-
|
|
38
|
+
FlexArray::VERSION
|
|
36
39
|
end
|
|
37
40
|
|
|
38
41
|
#The array specifications. An array of spec components.
|
data/rakefile.rb
CHANGED
|
@@ -1,47 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env rake
|
|
2
|
+
# coding: utf-8
|
|
3
|
+
|
|
2
4
|
require 'rake/testtask'
|
|
3
5
|
require 'rdoc/task'
|
|
6
|
+
require "bundler/gem_tasks"
|
|
4
7
|
|
|
5
8
|
RDoc::Task.new do |rdoc|
|
|
6
9
|
rdoc.rdoc_dir = "rdoc"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
"lib/flex_array/flex_array_reshape.rb",
|
|
12
|
-
"lib/flex_array/flex_array_append.rb",
|
|
13
|
-
"lib/flex_array/flex_array_transpose.rb",
|
|
14
|
-
"lib/flex_array/flex_array_process.rb",
|
|
15
|
-
"lib/flex_array/flex_array_validate.rb",
|
|
16
|
-
"lib/flex_array/flex_array_forever.rb",
|
|
17
|
-
"lib/flex_array/object.rb",
|
|
18
|
-
"lib/flex_array/integer.rb",
|
|
19
|
-
"lib/flex_array/range.rb",
|
|
20
|
-
"lib/flex_array/array.rb",
|
|
21
|
-
"lib/flex_array/spec_array.rb",
|
|
22
|
-
"lib/flex_array/spec_component.rb",
|
|
23
|
-
"license.txt", "README.txt"]
|
|
10
|
+
|
|
11
|
+
#List out all the files to be documented.
|
|
12
|
+
rdoc.rdoc_files.include("lib/**/*.rb", "license.txt", "readme.txt")
|
|
13
|
+
|
|
24
14
|
rdoc.options << '--visibility' << 'private'
|
|
25
15
|
end
|
|
26
16
|
|
|
27
17
|
Rake::TestTask.new do |t|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"tests/object_test.rb",
|
|
31
|
-
"tests/integer_test.rb",
|
|
32
|
-
"tests/range_test.rb",
|
|
33
|
-
"tests/array_test.rb",
|
|
34
|
-
"tests/flex_array_new_test.rb",
|
|
35
|
-
"tests/flex_array_index_test.rb",
|
|
36
|
-
"tests/flex_array_each_test.rb",
|
|
37
|
-
"tests/flex_array_reshape_test.rb",
|
|
38
|
-
"tests/flex_array_append_test.rb",
|
|
39
|
-
"tests/flex_array_transpose_test.rb",
|
|
40
|
-
"tests/flex_array_validate_test.rb",
|
|
41
|
-
"tests/flex_array_test.rb"]
|
|
18
|
+
#List out all the test files.
|
|
19
|
+
t.test_files = FileList['tests/**/*.rb']
|
|
42
20
|
t.verbose = false
|
|
43
21
|
end
|
|
44
22
|
|
|
23
|
+
desc "Run a scan for smelly code!"
|
|
45
24
|
task :reek do |t|
|
|
46
25
|
`reek --no-color lib > reek.txt`
|
|
47
26
|
end
|
|
@@ -51,6 +30,7 @@ def eval_puts(str)
|
|
|
51
30
|
eval str
|
|
52
31
|
end
|
|
53
32
|
|
|
33
|
+
desc "Run an interactive flex array session."
|
|
54
34
|
task :console do
|
|
55
35
|
require 'irb'
|
|
56
36
|
require 'irb/completion'
|
|
@@ -62,3 +42,9 @@ task :console do
|
|
|
62
42
|
ARGV.clear
|
|
63
43
|
IRB.start
|
|
64
44
|
end
|
|
45
|
+
|
|
46
|
+
desc "What version of flex_array is this?"
|
|
47
|
+
task :vers do |t|
|
|
48
|
+
puts
|
|
49
|
+
puts "flex_array version = #{FlexArray::VERSION}"
|
|
50
|
+
end
|
data/sire.rb
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# coding: utf-8
|
|
2
|
+
# Really simple program # 3
|
|
3
|
+
# A Simple Interactive Ruby Environment
|
|
4
|
+
# SIRE Version 0.2.6
|
|
5
|
+
|
|
6
|
+
require 'readline'
|
|
7
|
+
require 'pp'
|
|
8
|
+
require_relative 'lib/flex_array'
|
|
9
|
+
include Readline
|
|
10
|
+
|
|
11
|
+
class Object
|
|
12
|
+
def classes
|
|
13
|
+
begin
|
|
14
|
+
klass = self
|
|
15
|
+
|
|
16
|
+
begin
|
|
17
|
+
klass = klass.class unless klass.instance_of?(Class)
|
|
18
|
+
print klass
|
|
19
|
+
klass = klass.superclass
|
|
20
|
+
print " < " if klass
|
|
21
|
+
end while klass
|
|
22
|
+
|
|
23
|
+
puts
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def fp arr
|
|
29
|
+
lim = arr.limits
|
|
30
|
+
ec = lim[-1].max
|
|
31
|
+
pp lim
|
|
32
|
+
arr.each_with_index do |item, index|
|
|
33
|
+
print " #{item} "
|
|
34
|
+
puts if index[-1] == ec
|
|
35
|
+
end
|
|
36
|
+
puts
|
|
37
|
+
nil
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def q
|
|
41
|
+
@done = true
|
|
42
|
+
puts
|
|
43
|
+
"Bye bye for now!"
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def eval_puts(str)
|
|
47
|
+
puts str
|
|
48
|
+
eval str
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
puts "Welcome to SIRE for FlexArray"
|
|
52
|
+
puts "Simple Interactive Ruby Environment"
|
|
53
|
+
puts
|
|
54
|
+
puts "Use command 'q' to quit."
|
|
55
|
+
puts
|
|
56
|
+
@done = false
|
|
57
|
+
|
|
58
|
+
eval_puts "@a = FlexArray.new([2,3,4]) {|i| i.clone}"
|
|
59
|
+
eval_puts "@b = FlexArray.new([2,3,4]) {|i| (i[0]+i[2])*(i[1] + i[2])}"
|
|
60
|
+
eval_puts "@c = FlexArray.new([0,3])"
|
|
61
|
+
eval_puts "@d = FlexArray.new([3,3]) {|i| i[0]*3 + i[1]}"
|
|
62
|
+
puts
|
|
63
|
+
|
|
64
|
+
until @done
|
|
65
|
+
begin
|
|
66
|
+
line = readline('SIRE>', true)
|
|
67
|
+
result = eval line
|
|
68
|
+
pp result unless result.nil?
|
|
69
|
+
rescue Interrupt
|
|
70
|
+
@done = true
|
|
71
|
+
puts
|
|
72
|
+
puts
|
|
73
|
+
pp "I'm done here!"
|
|
74
|
+
rescue Exception => e
|
|
75
|
+
puts
|
|
76
|
+
puts "#{e.class} detected: #{e}"
|
|
77
|
+
puts e.backtrace
|
|
78
|
+
puts
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
puts
|
data/tests/flex_array_test.rb
CHANGED
|
@@ -15,11 +15,10 @@ class FlexArrayTester < MiniTest::Unit::TestCase
|
|
|
15
15
|
end
|
|
16
16
|
|
|
17
17
|
def test_version_reporting
|
|
18
|
-
version = '0.3.0'
|
|
19
18
|
f = FlexArray.new([3,3], 'test')
|
|
20
19
|
|
|
21
|
-
assert_equal(
|
|
22
|
-
assert_equal(
|
|
20
|
+
assert_equal(FlexArray::VERSION, FlexArray.version)
|
|
21
|
+
assert_equal(FlexArray::VERSION, f.version)
|
|
23
22
|
end
|
|
24
23
|
|
|
25
24
|
def test_the_limits_method
|
metadata
CHANGED
|
@@ -1,15 +1,29 @@
|
|
|
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.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Peter Camilleri
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2014-04
|
|
11
|
+
date: 2014-11-04 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
|
+
- !ruby/object:Gem::Dependency
|
|
14
|
+
name: bundler
|
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
|
16
|
+
requirements:
|
|
17
|
+
- - ~>
|
|
18
|
+
- !ruby/object:Gem::Version
|
|
19
|
+
version: '1.3'
|
|
20
|
+
type: :development
|
|
21
|
+
prerelease: false
|
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
23
|
+
requirements:
|
|
24
|
+
- - ~>
|
|
25
|
+
- !ruby/object:Gem::Version
|
|
26
|
+
version: '1.3'
|
|
13
27
|
- !ruby/object:Gem::Dependency
|
|
14
28
|
name: rake
|
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -28,30 +42,44 @@ dependencies:
|
|
|
28
42
|
name: reek
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
30
44
|
requirements:
|
|
31
|
-
- -
|
|
45
|
+
- - ~>
|
|
32
46
|
- !ruby/object:Gem::Version
|
|
33
|
-
version:
|
|
47
|
+
version: 1.3.8
|
|
34
48
|
type: :development
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
|
-
- -
|
|
52
|
+
- - ~>
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version:
|
|
54
|
+
version: 1.3.8
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: minitest
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
44
58
|
requirements:
|
|
45
|
-
- -
|
|
59
|
+
- - ~>
|
|
46
60
|
- !ruby/object:Gem::Version
|
|
47
|
-
version:
|
|
61
|
+
version: 4.7.5
|
|
48
62
|
type: :development
|
|
49
63
|
prerelease: false
|
|
50
64
|
version_requirements: !ruby/object:Gem::Requirement
|
|
51
65
|
requirements:
|
|
52
|
-
- -
|
|
66
|
+
- - ~>
|
|
53
67
|
- !ruby/object:Gem::Version
|
|
54
|
-
version:
|
|
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
|
|
55
83
|
- !ruby/object:Gem::Dependency
|
|
56
84
|
name: in_array
|
|
57
85
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,13 +94,19 @@ dependencies:
|
|
|
66
94
|
- - ! '>='
|
|
67
95
|
- !ruby/object:Gem::Version
|
|
68
96
|
version: '0'
|
|
69
|
-
description: ! 'A flexible array class. '
|
|
97
|
+
description: ! 'A flexible, multidimensional array class for Ruby. '
|
|
70
98
|
email: peter.c.camilleri@gmail.com
|
|
71
99
|
executables: []
|
|
72
100
|
extensions: []
|
|
73
101
|
extra_rdoc_files:
|
|
74
102
|
- license.txt
|
|
75
103
|
files:
|
|
104
|
+
- .gitignore
|
|
105
|
+
- docs/Flex_Array_UG.odt
|
|
106
|
+
- docs/Flex_Array_UG_Version_0_3_0.pdf
|
|
107
|
+
- flex_array
|
|
108
|
+
- flex_array.gemspec
|
|
109
|
+
- flex_array.reek
|
|
76
110
|
- lib/flex_array.rb
|
|
77
111
|
- lib/flex_array/array.rb
|
|
78
112
|
- lib/flex_array/flex_array_append.rb
|
|
@@ -89,6 +123,11 @@ files:
|
|
|
89
123
|
- lib/flex_array/range.rb
|
|
90
124
|
- lib/flex_array/spec_array.rb
|
|
91
125
|
- lib/flex_array/spec_component.rb
|
|
126
|
+
- license.txt
|
|
127
|
+
- rakefile.rb
|
|
128
|
+
- readme.txt
|
|
129
|
+
- reek.txt
|
|
130
|
+
- sire.rb
|
|
92
131
|
- tests/array_test.rb
|
|
93
132
|
- tests/flex_array_append_test.rb
|
|
94
133
|
- tests/flex_array_each_test.rb
|
|
@@ -103,10 +142,6 @@ files:
|
|
|
103
142
|
- tests/range_test.rb
|
|
104
143
|
- tests/spec_array_test.rb
|
|
105
144
|
- tests/spec_component_test.rb
|
|
106
|
-
- rakefile.rb
|
|
107
|
-
- license.txt
|
|
108
|
-
- readme.txt
|
|
109
|
-
- reek.txt
|
|
110
145
|
homepage: http://teuthida-technologies.com/
|
|
111
146
|
licenses:
|
|
112
147
|
- MIT
|
|
@@ -131,18 +166,5 @@ rubygems_version: 2.1.4
|
|
|
131
166
|
signing_key:
|
|
132
167
|
specification_version: 4
|
|
133
168
|
summary: A flexible array class.
|
|
134
|
-
test_files:
|
|
135
|
-
|
|
136
|
-
- tests/flex_array_append_test.rb
|
|
137
|
-
- tests/flex_array_each_test.rb
|
|
138
|
-
- tests/flex_array_index_test.rb
|
|
139
|
-
- tests/flex_array_new_test.rb
|
|
140
|
-
- tests/flex_array_reshape_test.rb
|
|
141
|
-
- tests/flex_array_test.rb
|
|
142
|
-
- tests/flex_array_transpose_test.rb
|
|
143
|
-
- tests/flex_array_validate_test.rb
|
|
144
|
-
- tests/integer_test.rb
|
|
145
|
-
- tests/object_test.rb
|
|
146
|
-
- tests/range_test.rb
|
|
147
|
-
- tests/spec_array_test.rb
|
|
148
|
-
- tests/spec_component_test.rb
|
|
169
|
+
test_files: []
|
|
170
|
+
has_rdoc: true
|