vedeu 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/docs/dsl.md +4 -4
  4. data/lib/vedeu/all.rb +6 -18
  5. data/lib/vedeu/api.rb +14 -13
  6. data/lib/vedeu/bindings/system.rb +5 -4
  7. data/lib/vedeu/buffers/virtual_buffer.rb +13 -11
  8. data/lib/vedeu/configuration/api.rb +4 -3
  9. data/lib/vedeu/cursors/cursor.rb +23 -18
  10. data/lib/vedeu/distributed/client.rb +11 -6
  11. data/lib/vedeu/distributed/server.rb +4 -3
  12. data/lib/vedeu/dsl/keymap.rb +6 -6
  13. data/lib/vedeu/editor/all.rb +19 -0
  14. data/lib/vedeu/{input/editor → editor}/capture.rb +1 -1
  15. data/lib/vedeu/{input/editor → editor}/cropper.rb +0 -0
  16. data/lib/vedeu/{input/editor → editor}/cursor.rb +0 -0
  17. data/lib/vedeu/{input/editor → editor}/document.rb +0 -0
  18. data/lib/vedeu/{input/editor → editor}/documents.rb +0 -0
  19. data/lib/vedeu/{input/editor → editor}/editor.rb +0 -0
  20. data/lib/vedeu/{input/editor → editor}/insert.rb +0 -0
  21. data/lib/vedeu/{input/editor → editor}/line.rb +0 -0
  22. data/lib/vedeu/{input/editor → editor}/lines.rb +0 -0
  23. data/lib/vedeu/error.rb +21 -18
  24. data/lib/vedeu/esc/borders.rb +6 -4
  25. data/lib/vedeu/esc/colours.rb +13 -12
  26. data/lib/vedeu/esc/esc.rb +11 -10
  27. data/lib/vedeu/input/all.rb +15 -0
  28. data/lib/vedeu/input/input.rb +55 -52
  29. data/lib/vedeu/input/key.rb +36 -30
  30. data/lib/vedeu/input/keymap.rb +101 -92
  31. data/lib/vedeu/input/keymaps.rb +10 -6
  32. data/lib/vedeu/input/keys.rb +8 -4
  33. data/lib/vedeu/input/mapper.rb +125 -121
  34. data/lib/vedeu/input/translator.rb +159 -0
  35. data/lib/vedeu/internal_api.rb +16 -15
  36. data/lib/vedeu/logging/all.rb +13 -0
  37. data/lib/vedeu/logging/debug.rb +84 -0
  38. data/lib/vedeu/logging/lockless_log_device.rb +65 -0
  39. data/lib/vedeu/logging/log.rb +179 -0
  40. data/lib/vedeu/logging/mono_logger.rb +26 -0
  41. data/lib/vedeu/logging/timer.rb +68 -0
  42. data/lib/vedeu/menus/all.rb +12 -0
  43. data/lib/vedeu/{dsl/menu.rb → menus/dsl.rb} +19 -18
  44. data/lib/vedeu/menus/menu.rb +234 -0
  45. data/lib/vedeu/{null/menu.rb → menus/null.rb} +6 -6
  46. data/lib/vedeu/menus/repository.rb +18 -0
  47. data/lib/vedeu/models/cell.rb +62 -55
  48. data/lib/vedeu/models/escape.rb +55 -50
  49. data/lib/vedeu/models/page.rb +74 -69
  50. data/lib/vedeu/models/row.rb +55 -51
  51. data/lib/vedeu/models/views/all.rb +1 -0
  52. data/lib/vedeu/models/views/char.rb +1 -1
  53. data/lib/vedeu/models/views/html_char.rb +165 -0
  54. data/lib/vedeu/output/renderers/html.rb +5 -4
  55. data/lib/vedeu/repositories/model.rb +2 -0
  56. data/lib/vedeu/runtime/application.rb +110 -103
  57. data/lib/vedeu/runtime/bootstrap.rb +109 -103
  58. data/lib/vedeu/runtime/flags.rb +45 -41
  59. data/lib/vedeu/runtime/launcher.rb +1 -1
  60. data/lib/vedeu/runtime/main_loop.rb +51 -46
  61. data/lib/vedeu/runtime/traps.rb +20 -16
  62. data/lib/vedeu/version.rb +1 -1
  63. data/lib/vedeu.rb +2 -2
  64. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +1 -1
  65. data/test/lib/vedeu/cursors/cursor_test.rb +11 -5
  66. data/test/lib/vedeu/dsl/interface_test.rb +1 -1
  67. data/test/lib/vedeu/dsl/keymap_test.rb +2 -2
  68. data/test/lib/vedeu/{input/editor → editor}/capture_test.rb +0 -0
  69. data/test/lib/vedeu/{input/editor → editor}/cropper_test.rb +0 -0
  70. data/test/lib/vedeu/{input/editor → editor}/cursor_test.rb +0 -0
  71. data/test/lib/vedeu/{input/editor → editor}/document_test.rb +0 -0
  72. data/test/lib/vedeu/{input/editor → editor}/documents_test.rb +0 -0
  73. data/test/lib/vedeu/{input/editor → editor}/editor_test.rb +0 -0
  74. data/test/lib/vedeu/{input/editor → editor}/insert_test.rb +0 -0
  75. data/test/lib/vedeu/{input/editor → editor}/line_test.rb +0 -0
  76. data/test/lib/vedeu/{input/editor → editor}/lines_test.rb +0 -0
  77. data/test/lib/vedeu/input/input_test.rb +58 -54
  78. data/test/lib/vedeu/input/key_test.rb +29 -25
  79. data/test/lib/vedeu/input/keymap_test.rb +74 -70
  80. data/test/lib/vedeu/input/keymaps_test.rb +8 -4
  81. data/test/lib/vedeu/input/keys_test.rb +12 -8
  82. data/test/lib/vedeu/input/mapper_test.rb +64 -56
  83. data/test/lib/vedeu/input/translator_test.rb +36 -0
  84. data/test/lib/vedeu/logging/debug_test.rb +39 -0
  85. data/test/lib/vedeu/logging/lockless_log_device_test.rb +42 -0
  86. data/test/lib/vedeu/logging/log_test.rb +52 -0
  87. data/test/lib/vedeu/logging/mono_logger_test.rb +43 -0
  88. data/test/lib/vedeu/logging/timer_test.rb +44 -0
  89. data/test/lib/vedeu/{dsl/menu_test.rb → menus/dsl_test.rb} +6 -6
  90. data/test/lib/vedeu/menus/menu_test.rb +305 -0
  91. data/test/lib/vedeu/{null/menu_test.rb → menus/null_test.rb} +5 -5
  92. data/test/lib/vedeu/menus/repository_test.rb +17 -0
  93. data/test/lib/vedeu/models/cell_test.rb +54 -50
  94. data/test/lib/vedeu/models/escape_test.rb +49 -45
  95. data/test/lib/vedeu/models/page_test.rb +167 -160
  96. data/test/lib/vedeu/models/row_test.rb +71 -67
  97. data/test/lib/vedeu/models/views/html_char_test.rb +110 -0
  98. data/test/lib/vedeu/output/compressor_test.rb +44 -22
  99. data/test/lib/vedeu/output/renderers_test.rb +4 -2
  100. data/test/lib/vedeu/runtime/application_test.rb +36 -32
  101. data/test/lib/vedeu/runtime/bootstrap_test.rb +31 -26
  102. data/test/lib/vedeu/runtime/flags_test.rb +33 -29
  103. data/test/lib/vedeu/runtime/launcher_test.rb +4 -2
  104. data/test/lib/vedeu/runtime/main_loop_test.rb +28 -24
  105. data/test/lib/vedeu/runtime/traps_test.rb +8 -4
  106. data/test/test_helper.rb +4 -2
  107. metadata +66 -63
  108. data/lib/vedeu/input/editor/all.rb +0 -19
  109. data/lib/vedeu/input/input_translator.rb +0 -155
  110. data/lib/vedeu/log/debug.rb +0 -79
  111. data/lib/vedeu/log/lockless_log_device.rb +0 -61
  112. data/lib/vedeu/log/log.rb +0 -172
  113. data/lib/vedeu/log/mono_logger.rb +0 -21
  114. data/lib/vedeu/log/timer.rb +0 -63
  115. data/lib/vedeu/models/menu.rb +0 -217
  116. data/lib/vedeu/models/menus.rb +0 -14
  117. data/lib/vedeu/output/html_char.rb +0 -161
  118. data/test/lib/vedeu/input/input_translator_test.rb +0 -32
  119. data/test/lib/vedeu/log/debug_test.rb +0 -35
  120. data/test/lib/vedeu/log/lockless_log_device_test.rb +0 -29
  121. data/test/lib/vedeu/log/log_test.rb +0 -48
  122. data/test/lib/vedeu/log/mono_logger_test.rb +0 -31
  123. data/test/lib/vedeu/log/timer_test.rb +0 -40
  124. data/test/lib/vedeu/models/menu_test.rb +0 -301
  125. data/test/lib/vedeu/models/menus_test.rb +0 -13
  126. data/test/lib/vedeu/output/html_char_test.rb +0 -106
@@ -1,70 +1,77 @@
1
1
  module Vedeu
2
2
 
3
- # A Cell represents a single square of the terminal.
4
- #
5
- class Cell
3
+ module Models
6
4
 
7
- # @!attribute [r] colour
8
- # @return [NilClass|String]
9
- attr_reader :colour
5
+ # A Cell represents a single square of the terminal.
6
+ #
7
+ class Cell
10
8
 
11
- # @!attribute [r] style
12
- # @return [NilClass|Array<Symbol|String>|Symbol|String]
13
- attr_reader :style
9
+ # @!attribute [r] colour
10
+ # @return [NilClass|String]
11
+ attr_reader :colour
14
12
 
15
- # @!attribute [r] value
16
- # @return [NilClass|String]
17
- attr_reader :value
13
+ # @!attribute [r] style
14
+ # @return [NilClass|Array<Symbol|String>|Symbol|String]
15
+ attr_reader :style
18
16
 
19
- # @!attribute [r] x
20
- # @return [NilClass|Fixnum]
21
- attr_reader :x
17
+ # @!attribute [r] value
18
+ # @return [NilClass|String]
19
+ attr_reader :value
22
20
 
23
- # @!attribute [r] y
24
- # @return [NilClass|Fixnum]
25
- attr_reader :y
21
+ # @!attribute [r] x
22
+ # @return [NilClass|Fixnum]
23
+ attr_reader :x
26
24
 
27
- # Returns a new instance of Vedeu::Cell.
28
- #
29
- # @param attributes [Hash<Symbol => Array<Symbol|String>,
30
- # Fixnum, String, Symbol]
31
- # @option attributes colour [NilClass|String]
32
- # @option attributes style [NilClass|Array<Symbol|String>|Symbol|String]
33
- # @option attributes value [NilClass|String]
34
- # @option attributes x [NilClass|Fixnum]
35
- # @option attributes y [NilClass|Fixnum]
36
- # @return [Vedeu::Cell]
37
- def initialize(attributes = {})
38
- @attributes = defaults.merge!(attributes)
25
+ # @!attribute [r] y
26
+ # @return [NilClass|Fixnum]
27
+ attr_reader :y
39
28
 
40
- @attributes.each { |key, value| instance_variable_set("@#{key}", value) }
41
- end
29
+ # Returns a new instance of Vedeu::Models::Cell.
30
+ #
31
+ # @param attributes [Hash<Symbol => Array<Symbol|String>,
32
+ # Fixnum, String, Symbol]
33
+ # @option attributes colour [NilClass|String]
34
+ # @option attributes style
35
+ # [NilClass|Array<Symbol|String>|Symbol|String]
36
+ # @option attributes value [NilClass|String]
37
+ # @option attributes x [NilClass|Fixnum]
38
+ # @option attributes y [NilClass|Fixnum]
39
+ # @return [Vedeu::Models::Cell]
40
+ def initialize(attributes = {})
41
+ @attributes = defaults.merge!(attributes)
42
42
 
43
- # An object is equal when its values are the same.
44
- #
45
- # @param other [Vedeu::Cell]
46
- # @return [Boolean]
47
- def eql?(other)
48
- self.class == other.class && value == other.value && x == other.x &&
49
- y == other.y
50
- end
51
- alias_method :==, :eql?
43
+ @attributes.each do |key, value|
44
+ instance_variable_set("@#{key}", value)
45
+ end
46
+ end
52
47
 
53
- private
48
+ # An object is equal when its values are the same.
49
+ #
50
+ # @param other [Vedeu::Models::Cell]
51
+ # @return [Boolean]
52
+ def eql?(other)
53
+ self.class == other.class && value == other.value && x == other.x &&
54
+ y == other.y
55
+ end
56
+ alias_method :==, :eql?
54
57
 
55
- # Returns the default options/attributes for this class.
56
- #
57
- # @return [Hash<Symbol => void>]
58
- def defaults
59
- {
60
- colour: nil,
61
- style: nil,
62
- value: nil,
63
- x: nil,
64
- y: nil,
65
- }
66
- end
58
+ private
59
+
60
+ # Returns the default options/attributes for this class.
61
+ #
62
+ # @return [Hash<Symbol => void>]
63
+ def defaults
64
+ {
65
+ colour: nil,
66
+ style: nil,
67
+ value: nil,
68
+ x: nil,
69
+ y: nil,
70
+ }
71
+ end
72
+
73
+ end # Cell
67
74
 
68
- end # Cell
75
+ end # Models
69
76
 
70
77
  end # Vedeu
@@ -1,64 +1,69 @@
1
1
  module Vedeu
2
2
 
3
- # Represents an invisible escape character sequence.
4
- #
5
- class Escape
3
+ module Models
6
4
 
7
- # @!attribute [r] value
8
- # @return [String]
9
- attr_reader :value
10
-
11
- # Returns a new instance of Vedeu::Escape.
5
+ # Represents an invisible escape character sequence.
12
6
  #
13
- # @param attributes [String]
14
- # @option attributes position [Vedeu::Geometry::Position|Array<Fixnum>]
15
- # @option attributes value [String]
16
- # @return [Vedeu::Escape]
17
- def initialize(attributes = {})
18
- defaults.merge!(attributes).each do |key, value|
19
- instance_variable_set("@#{key}", value)
7
+ class Escape
8
+
9
+ # @!attribute [r] value
10
+ # @return [String]
11
+ attr_reader :value
12
+
13
+ # Returns a new instance of Vedeu::Models::Escape.
14
+ #
15
+ # @param attributes [String]
16
+ # @option attributes position
17
+ # [Vedeu::Geometry::Position|Array<Fixnum>]
18
+ # @option attributes value [String]
19
+ # @return [Vedeu::Models::Escape]
20
+ def initialize(attributes = {})
21
+ defaults.merge!(attributes).each do |key, value|
22
+ instance_variable_set("@#{key}", value)
23
+ end
20
24
  end
21
- end
22
25
 
23
- # @return [NilClass]
24
- def null
25
- nil
26
- end
27
- alias_method :background, :null
28
- alias_method :colour, :null
29
- alias_method :foreground, :null
30
- alias_method :style, :null
26
+ # @return [NilClass]
27
+ def null
28
+ nil
29
+ end
30
+ alias_method :background, :null
31
+ alias_method :colour, :null
32
+ alias_method :foreground, :null
33
+ alias_method :style, :null
31
34
 
32
- # An object is equal when its values are the same.
33
- #
34
- # @param other [Vedeu::Views::Char]
35
- # @return [Boolean]
36
- def eql?(other)
37
- self.class == other.class && value == other.value
38
- end
39
- alias_method :==, :eql?
35
+ # An object is equal when its values are the same.
36
+ #
37
+ # @param other [Vedeu::Views::Char]
38
+ # @return [Boolean]
39
+ def eql?(other)
40
+ self.class == other.class && value == other.value
41
+ end
42
+ alias_method :==, :eql?
40
43
 
41
- # @return [String]
42
- def position
43
- Vedeu::Geometry::Position.coerce(@position)
44
- end
44
+ # @return [String]
45
+ def position
46
+ Vedeu::Geometry::Position.coerce(@position)
47
+ end
45
48
 
46
- # @return [String]
47
- def to_s
48
- "#{position}#{value}"
49
- end
50
- alias_method :to_str, :to_s
49
+ # @return [String]
50
+ def to_s
51
+ "#{position}#{value}"
52
+ end
53
+ alias_method :to_str, :to_s
51
54
 
52
- private
55
+ private
56
+
57
+ # @return [Hash]
58
+ def defaults
59
+ {
60
+ position: [1, 1],
61
+ value: '',
62
+ }
63
+ end
53
64
 
54
- # @return [Hash]
55
- def defaults
56
- {
57
- position: [1, 1],
58
- value: '',
59
- }
60
- end
65
+ end # Escape
61
66
 
62
- end # Escape
67
+ end # Models
63
68
 
64
69
  end # Vedeu
@@ -1,89 +1,94 @@
1
1
  module Vedeu
2
2
 
3
- # A Page represents an array of Vedeu::Row objects.
4
- #
5
- class Page
3
+ module Models
6
4
 
7
- include Enumerable
5
+ # A Page represents an array of Vedeu::Models::Row objects.
6
+ #
7
+ class Page
8
+
9
+ include Enumerable
8
10
 
9
- # @!attribute [r] rows
10
- # @return [Array<NilClass|Vedeu::Row>]
11
- attr_reader :rows
11
+ # @!attribute [r] rows
12
+ # @return [Array<NilClass|Vedeu::Models::Row>]
13
+ attr_reader :rows
12
14
 
13
- # @param value [Vedeu::Page|Vedeu::Row|Array<void>|void]
14
- # @return [Vedeu::Page]
15
- def self.coerce(value)
16
- if value.is_a?(Vedeu::Page)
17
- value
15
+ # @param value
16
+ # [Vedeu::Models::Page|Vedeu::Models::Row|Array<void>|void]
17
+ # @return [Vedeu::Models::Page]
18
+ def self.coerce(value)
19
+ if value.is_a?(Vedeu::Models::Page)
20
+ value
18
21
 
19
- elsif value.is_a?(Vedeu::Row)
20
- Vedeu::Page.new([value])
22
+ elsif value.is_a?(Vedeu::Models::Row)
23
+ Vedeu::Models::Page.new([value])
21
24
 
22
- elsif value.is_a?(Array) && value.empty?
23
- Vedeu::Page.new([Vedeu::Row.coerce(value)])
25
+ elsif value.is_a?(Array) && value.empty?
26
+ Vedeu::Models::Page.new([Vedeu::Models::Row.coerce(value)])
24
27
 
25
- elsif value.is_a?(Array)
26
- values = value.map do |v|
27
- if v.is_a?(Vedeu::Row)
28
- v
28
+ elsif value.is_a?(Array)
29
+ values = value.map do |v|
30
+ if v.is_a?(Vedeu::Models::Row)
31
+ v
29
32
 
30
- else
31
- Vedeu::Row.coerce(v)
33
+ else
34
+ Vedeu::Models::Row.coerce(v)
32
35
 
36
+ end
33
37
  end
38
+ Vedeu::Models::Page.new(values)
39
+
40
+ else
41
+ fail Vedeu::Error::InvalidSyntax,
42
+ 'Cannot coerce as value is not an Array.'
43
+
34
44
  end
35
- Vedeu::Page.new(values)
45
+ end
36
46
 
37
- else
38
- fail Vedeu::Error::InvalidSyntax,
39
- 'Cannot coerce as value is not an Array.'
47
+ # Returns an instance of Vedeu::Models::Page.
48
+ #
49
+ # @param rows [Array<NilClass|Vedeu::Models::Row>]
50
+ # @return [Vedeu::Models::Page]
51
+ def initialize(rows = [])
52
+ @rows = rows || []
53
+ end
40
54
 
55
+ # Provides iteration over the collection.
56
+ #
57
+ # @param block [Proc]
58
+ # @return [Enumerator]
59
+ def each(&block)
60
+ rows.each(&block)
41
61
  end
42
- end
43
62
 
44
- # Returns an instance of Vedeu::Page.
45
- #
46
- # @param rows [Array<NilClass|Vedeu::Row>]
47
- # @return [Vedeu::Page]
48
- def initialize(rows = [])
49
- @rows = rows || []
50
- end
63
+ # An object is equal when its values are the same.
64
+ #
65
+ # @param other [Vedeu::Models::Page]
66
+ # @return [Boolean]
67
+ def eql?(other)
68
+ self.class == other.class && rows == other.rows
69
+ end
70
+ alias_method :==, :eql?
51
71
 
52
- # Provides iteration over the collection.
53
- #
54
- # @param block [Proc]
55
- # @return [Enumerator]
56
- def each(&block)
57
- rows.each(&block)
58
- end
72
+ # @param index [Fixnum]
73
+ # @return [NilClass|Vedeu::Models::Row]
74
+ def row(index = nil)
75
+ return nil if index.nil?
59
76
 
60
- # An object is equal when its values are the same.
61
- #
62
- # @param other [Vedeu::Page]
63
- # @return [Boolean]
64
- def eql?(other)
65
- self.class == other.class && rows == other.rows
66
- end
67
- alias_method :==, :eql?
68
-
69
- # @param index [Fixnum]
70
- # @return [NilClass|Vedeu::Row]
71
- def row(index = nil)
72
- return nil if index.nil?
73
-
74
- rows[index]
75
- end
76
-
77
- # @param row_index [Fixnum]
78
- # @param cell_index [Fixnum]
79
- # @return [NilClass|void]
80
- def cell(row_index = nil, cell_index = nil)
81
- return nil if row_index.nil? || cell_index.nil?
82
- return nil unless row(row_index)
83
-
84
- row(row_index)[cell_index]
85
- end
86
-
87
- end # Page
77
+ rows[index]
78
+ end
79
+
80
+ # @param row_index [Fixnum]
81
+ # @param cell_index [Fixnum]
82
+ # @return [NilClass|void]
83
+ def cell(row_index = nil, cell_index = nil)
84
+ return nil if row_index.nil? || cell_index.nil?
85
+ return nil unless row(row_index)
86
+
87
+ row(row_index)[cell_index]
88
+ end
89
+
90
+ end # Page
91
+
92
+ end # Models
88
93
 
89
94
  end # Vedeu
@@ -1,66 +1,70 @@
1
1
  module Vedeu
2
2
 
3
- # A Row represents an array of Vedeu::Cell objects.
4
- #
5
- class Row
3
+ module Models
6
4
 
7
- include Enumerable
5
+ # A Row represents an array of Vedeu::Models::Cell objects.
6
+ #
7
+ class Row
8
+
9
+ include Enumerable
8
10
 
9
- # @!attribute [r] cells
10
- # @return [Array<NilClass|void>]
11
- attr_reader :cells
11
+ # @!attribute [r] cells
12
+ # @return [Array<NilClass|void>]
13
+ attr_reader :cells
12
14
 
13
- # @param value [Vedeu::Row|Array<void>|void]
14
- # @return [Vedeu::Row]
15
- def self.coerce(value)
16
- if value.is_a?(self)
17
- value
15
+ # @param value [Vedeu::Models::Row|Array<void>|void]
16
+ # @return [Vedeu::Models::Row]
17
+ def self.coerce(value)
18
+ if value.is_a?(self)
19
+ value
18
20
 
19
- elsif value.is_a?(Array)
20
- new(value.compact)
21
+ elsif value.is_a?(Array)
22
+ new(value.compact)
21
23
 
22
- elsif value.nil?
23
- new
24
+ elsif value.nil?
25
+ new
24
26
 
25
- else
26
- new([value])
27
+ else
28
+ new([value])
27
29
 
30
+ end
28
31
  end
29
- end
30
32
 
31
- # Returns an instance of Vedeu::Row.
32
- #
33
- # @param cells [Array<NilClass|void>]
34
- # @return [Vedeu::Row]
35
- def initialize(cells = [])
36
- @cells = cells || []
37
- end
33
+ # Returns an instance of Vedeu::Models::Row.
34
+ #
35
+ # @param cells [Array<NilClass|void>]
36
+ # @return [Vedeu::Models::Row]
37
+ def initialize(cells = [])
38
+ @cells = cells || []
39
+ end
38
40
 
39
- # Provides iteration over the collection.
40
- #
41
- # @param block [Proc]
42
- # @return [Enumerator]
43
- def each(&block)
44
- cells.each(&block)
45
- end
41
+ # Provides iteration over the collection.
42
+ #
43
+ # @param block [Proc]
44
+ # @return [Enumerator]
45
+ def each(&block)
46
+ cells.each(&block)
47
+ end
46
48
 
47
- # An object is equal when its values are the same.
48
- #
49
- # @param other [Vedeu::Row]
50
- # @return [Boolean]
51
- def eql?(other)
52
- self.class == other.class && cells == other.cells
53
- end
54
- alias_method :==, :eql?
55
-
56
- # @param index [Fixnum]
57
- # @return [NilClass|void]
58
- def cell(index)
59
- return nil if index.nil?
60
-
61
- cells[index]
62
- end
63
-
64
- end # Row
49
+ # An object is equal when its values are the same.
50
+ #
51
+ # @param other [Vedeu::Models::Row]
52
+ # @return [Boolean]
53
+ def eql?(other)
54
+ self.class == other.class && cells == other.cells
55
+ end
56
+ alias_method :==, :eql?
57
+
58
+ # @param index [Fixnum]
59
+ # @return [NilClass|void]
60
+ def cell(index)
61
+ return nil if index.nil?
62
+
63
+ cells[index]
64
+ end
65
+
66
+ end # Row
67
+
68
+ end # Models
65
69
 
66
70
  end # Vedeu
@@ -9,6 +9,7 @@ module Vedeu
9
9
  end # Vedeu
10
10
 
11
11
  require 'vedeu/models/views/char'
12
+ require 'vedeu/models/views/html_char'
12
13
  require 'vedeu/models/views/collections/chars'
13
14
  require 'vedeu/models/views/stream'
14
15
  require 'vedeu/models/views/collections/streams'
@@ -128,7 +128,7 @@ module Vedeu
128
128
 
129
129
  # @return [String]
130
130
  def to_html
131
- @to_html ||= Vedeu::HTMLChar.render(self)
131
+ @to_html ||= Vedeu::Views::HTMLChar.render(self)
132
132
  end
133
133
 
134
134
  private