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.
Files changed (48) hide show
  1. checksums.yaml +5 -5
  2. data/.gitignore +0 -15
  3. data/.reek.yml +17 -0
  4. data/CODE_OF_CONDUCT.md +49 -0
  5. data/README.md +67 -0
  6. data/bench/benchmark.rb +243 -0
  7. data/bench/results.txt +97 -0
  8. data/flex_array.gemspec +6 -10
  9. data/irbt.rb +18 -0
  10. data/lib/flex_array.rb +13 -30
  11. data/lib/flex_array/array.rb +9 -24
  12. data/lib/flex_array/flex_array_append.rb +4 -23
  13. data/lib/flex_array/flex_array_each.rb +33 -208
  14. data/lib/flex_array/flex_array_forever.rb +6 -4
  15. data/lib/flex_array/flex_array_index.rb +4 -29
  16. data/lib/flex_array/flex_array_new.rb +9 -56
  17. data/lib/flex_array/flex_array_process.rb +23 -63
  18. data/lib/flex_array/flex_array_reshape.rb +13 -23
  19. data/lib/flex_array/flex_array_transpose.rb +7 -16
  20. data/lib/flex_array/flex_array_validate.rb +6 -15
  21. data/lib/flex_array/integer.rb +4 -13
  22. data/lib/flex_array/object.rb +4 -13
  23. data/lib/flex_array/range.rb +4 -13
  24. data/lib/flex_array/spec_array.rb +5 -9
  25. data/lib/flex_array/spec_component.rb +14 -22
  26. data/lib/flex_array/version.rb +1 -2
  27. data/rakefile.rb +1 -24
  28. data/reek.txt +9 -2
  29. data/tests/array_test.rb +0 -4
  30. data/tests/flex_array_append_test.rb +0 -23
  31. data/tests/flex_array_each_test.rb +483 -487
  32. data/tests/flex_array_index_test.rb +0 -4
  33. data/tests/flex_array_new_test.rb +0 -4
  34. data/tests/flex_array_reshape_test.rb +4 -4
  35. data/tests/flex_array_test.rb +0 -4
  36. data/tests/flex_array_transpose_test.rb +0 -4
  37. data/tests/flex_array_validate_test.rb +5 -4
  38. data/tests/integer_test.rb +0 -4
  39. data/tests/object_test.rb +0 -4
  40. data/tests/range_test.rb +0 -4
  41. data/tests/spec_array_test.rb +0 -4
  42. data/tests/spec_component_test.rb +0 -4
  43. metadata +19 -49
  44. data/docs/Flex_Array_UG.odt +0 -0
  45. data/docs/Flex_Array_UG_Version_0_3_0.pdf +0 -0
  46. data/flex_array.reek +0 -109
  47. data/readme.txt +0 -2
  48. data/sire.rb +0 -82
data/readme.txt DELETED
@@ -1,2 +0,0 @@
1
- This project contains the Ruby FlexArray gem. A gem used to facilitate the
2
- creation and processing of multi-dimensional arrays in a flexible manner.
data/sire.rb DELETED
@@ -1,82 +0,0 @@
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