vedeu 0.8.2 → 0.8.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/examples/views/_interfaces.rb +127 -0
- data/examples/views/empty_template.rb +10 -0
- data/examples/views/expected/vedeu_full_screen.html +140 -0
- data/examples/views/expected/vedeu_full_screen.json +96050 -0
- data/examples/views/expected/vedeu_full_screen.out +1 -0
- data/examples/views/expected/vedeu_full_screen.txt +50 -0
- data/examples/views/expected/vedeu_line.html +140 -0
- data/examples/views/expected/vedeu_line.json +96050 -0
- data/examples/views/expected/vedeu_line.out +1 -0
- data/examples/views/expected/vedeu_line.txt +58 -0
- data/examples/views/expected/vedeu_lines.html +140 -0
- data/examples/views/expected/vedeu_lines.json +96050 -0
- data/examples/views/expected/{lines.out → vedeu_lines.out} +1 -1
- data/examples/views/expected/vedeu_lines_alignment.html +80 -0
- data/examples/views/expected/vedeu_lines_alignment.json +46370 -0
- data/examples/views/expected/vedeu_lines_alignment.out +1 -0
- data/examples/views/full_screen.rb +10 -0
- data/examples/views/line.rb +11 -106
- data/examples/views/lines.rb +8 -127
- data/examples/views/lines_alignment.rb +17 -125
- data/examples/views/runner.sh +65 -19
- data/lib/vedeu/borders/border.rb +6 -6
- data/lib/vedeu/borders/refresh.rb +4 -6
- data/lib/vedeu/buffers/buffer.rb +1 -1
- data/lib/vedeu/buffers/terminal.rb +4 -4
- data/lib/vedeu/buffers/view.rb +2 -2
- data/lib/vedeu/cells/all.rb +2 -2
- data/lib/vedeu/cells/border.rb +5 -0
- data/lib/vedeu/cells/borders/all.rb +2 -8
- data/lib/vedeu/cells/borders/edges/all.rb +6 -0
- data/lib/vedeu/cells/borders/{bottom_horizontal.rb → edges/bottom_horizontal.rb} +0 -0
- data/lib/vedeu/cells/borders/{left_vertical.rb → edges/left_vertical.rb} +0 -0
- data/lib/vedeu/cells/borders/{right_vertical.rb → edges/right_vertical.rb} +0 -0
- data/lib/vedeu/cells/borders/{top_horizontal.rb → edges/top_horizontal.rb} +0 -0
- data/lib/vedeu/cells/borders/horizontal.rb +5 -0
- data/lib/vedeu/cells/borders/vertical.rb +5 -0
- data/lib/vedeu/cells/borders/vertices/all.rb +6 -0
- data/lib/vedeu/cells/borders/{bottom_left.rb → vertices/bottom_left.rb} +5 -0
- data/lib/vedeu/cells/borders/{bottom_right.rb → vertices/bottom_right.rb} +5 -0
- data/lib/vedeu/cells/borders/{top_left.rb → vertices/top_left.rb} +5 -0
- data/lib/vedeu/cells/borders/{top_right.rb → vertices/top_right.rb} +5 -0
- data/lib/vedeu/cells/char.rb +16 -0
- data/lib/vedeu/cells/clear.rb +5 -0
- data/lib/vedeu/cells/cursor.rb +70 -0
- data/lib/vedeu/cells/empty.rb +24 -14
- data/lib/vedeu/cells/escape.rb +8 -7
- data/lib/vedeu/cells/support/all.rb +3 -0
- data/lib/vedeu/cells/support/html.rb +98 -0
- data/lib/vedeu/colours/background.rb +21 -1
- data/lib/vedeu/colours/colour.rb +10 -2
- data/lib/vedeu/colours/foreground.rb +21 -1
- data/lib/vedeu/colours/translator.rb +17 -24
- data/lib/vedeu/colours/validator.rb +9 -9
- data/lib/vedeu/configuration/api.rb +1 -1
- data/lib/vedeu/cursors/cursor.rb +5 -5
- data/lib/vedeu/dsl/elements.rb +22 -79
- data/lib/vedeu/dsl/string/text.rb +3 -3
- data/lib/vedeu/editor/cropper.rb +2 -2
- data/lib/vedeu/editor/cursor.rb +1 -1
- data/lib/vedeu/editor/document.rb +1 -1
- data/lib/vedeu/geometries/area/dimension.rb +1 -1
- data/lib/vedeu/geometries/position.rb +5 -2
- data/lib/vedeu/interfaces/clear.rb +5 -5
- data/lib/vedeu/models/row.rb +4 -3
- data/lib/vedeu/output/compressor.rb +7 -7
- data/lib/vedeu/output/output.rb +8 -13
- data/lib/vedeu/output/viewport.rb +1 -1
- data/lib/vedeu/presentation/background.rb +2 -2
- data/lib/vedeu/presentation/colour.rb +0 -4
- data/lib/vedeu/presentation/foreground.rb +2 -2
- data/lib/vedeu/presentation/style.rb +1 -1
- data/lib/vedeu/presentation/styles.rb +0 -3
- data/lib/vedeu/renderers/file.rb +10 -68
- data/lib/vedeu/renderers/html.rb +28 -96
- data/lib/vedeu/renderers/json.rb +15 -31
- data/lib/vedeu/renderers/options.rb +160 -14
- data/lib/vedeu/renderers/templates/html_renderer.vedeu +1 -0
- data/lib/vedeu/renderers/terminal.rb +16 -17
- data/lib/vedeu/renderers/text.rb +32 -41
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/all.rb +0 -2
- data/lib/vedeu/views/chars.rb +6 -3
- data/lib/vedeu/views/stream.rb +3 -2
- data/test/lib/vedeu/borders/caption_test.rb +17 -17
- data/test/lib/vedeu/borders/title_test.rb +12 -12
- data/test/lib/vedeu/cells/border_test.rb +6 -0
- data/test/lib/vedeu/cells/borders/{bottom_horizontal_test.rb → edges/bottom_horizontal_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/{left_vertical_test.rb → edges/left_vertical_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/{right_vertical_test.rb → edges/right_vertical_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/{top_horizontal_test.rb → edges/top_horizontal_test.rb} +0 -0
- data/test/lib/vedeu/cells/borders/horizontal_test.rb +6 -0
- data/test/lib/vedeu/cells/borders/vertical_test.rb +6 -0
- data/test/lib/vedeu/cells/borders/{bottom_left_test.rb → vertices/bottom_left_test.rb} +6 -0
- data/test/lib/vedeu/cells/borders/{bottom_right_test.rb → vertices/bottom_right_test.rb} +6 -0
- data/test/lib/vedeu/cells/borders/{top_left_test.rb → vertices/top_left_test.rb} +6 -0
- data/test/lib/vedeu/cells/borders/{top_right_test.rb → vertices/top_right_test.rb} +6 -0
- data/test/lib/vedeu/cells/char_test.rb +18 -0
- data/test/lib/vedeu/cells/clear_test.rb +6 -0
- data/test/lib/vedeu/cells/cursor_test.rb +113 -0
- data/test/lib/vedeu/cells/empty_test.rb +100 -7
- data/test/lib/vedeu/cells/escape_test.rb +29 -13
- data/test/lib/vedeu/cells/support/html_test.rb +100 -0
- data/test/lib/vedeu/colours/background_test.rb +35 -3
- data/test/lib/vedeu/colours/colour_test.rb +66 -0
- data/test/lib/vedeu/colours/foreground_test.rb +35 -3
- data/test/lib/vedeu/colours/translator_test.rb +0 -34
- data/test/lib/vedeu/colours/validator_test.rb +84 -6
- data/test/lib/vedeu/cursors/cursor_test.rb +4 -4
- data/test/lib/vedeu/cursors/refresh_test.rb +4 -1
- data/test/lib/vedeu/dsl/string/text_test.rb +36 -36
- data/test/lib/vedeu/editor/cropper_test.rb +15 -15
- data/test/lib/vedeu/geometries/position_test.rb +14 -1
- data/test/lib/vedeu/models/page_test.rb +10 -10
- data/test/lib/vedeu/models/row_test.rb +7 -7
- data/test/lib/vedeu/output/compressor_test.rb +63 -50
- data/test/lib/vedeu/renderers/file_test.rb +64 -35
- data/test/lib/vedeu/renderers/html_test.rb +15 -12
- data/test/lib/vedeu/renderers/json_test.rb +79 -56
- data/test/lib/vedeu/renderers/options_test.rb +74 -26
- data/test/lib/vedeu/renderers/terminal_test.rb +34 -4
- data/test/lib/vedeu/renderers/text_test.rb +35 -3
- data/test/lib/vedeu/views/chars_test.rb +6 -0
- metadata +50 -41
- data/examples/views/expected/line.out +0 -1
- data/examples/views/expected/lines_alignment.out +0 -1
- data/lib/vedeu/cells/html.rb +0 -21
- data/lib/vedeu/cells/json.rb +0 -21
- data/lib/vedeu/views/char.rb +0 -180
- data/lib/vedeu/views/html_char.rb +0 -133
- data/test/lib/vedeu/cells/html_test.rb +0 -15
- data/test/lib/vedeu/cells/json_test.rb +0 -15
- data/test/lib/vedeu/views/char_test.rb +0 -283
- data/test/lib/vedeu/views/html_char_test.rb +0 -125
@@ -4,40 +4,39 @@ module Vedeu
|
|
4
4
|
|
5
5
|
module Renderers
|
6
6
|
|
7
|
-
# Converts a grid of {Vedeu::
|
7
|
+
# Converts a grid of {Vedeu::Cells::Char} objects into a stream of
|
8
8
|
# escape sequences and content suitable for a terminal.
|
9
9
|
#
|
10
10
|
class Terminal
|
11
11
|
|
12
12
|
include Vedeu::Renderers::Options
|
13
13
|
|
14
|
-
# Returns a new instance of Vedeu::Renderers::Terminal.
|
15
|
-
#
|
16
|
-
# @param options [Hash]
|
17
|
-
# @return [Vedeu::Renderers::Terminal]
|
18
|
-
def initialize(options = {})
|
19
|
-
@options = options || {}
|
20
|
-
end
|
21
|
-
|
22
14
|
# Render a cleared output.
|
23
15
|
#
|
24
16
|
# @return [String]
|
25
17
|
def clear
|
26
18
|
Vedeu::Terminal.clear
|
19
|
+
|
20
|
+
render('')
|
27
21
|
end
|
28
22
|
|
29
|
-
#
|
30
|
-
#
|
31
|
-
|
32
|
-
|
23
|
+
# Render the output (either content or clearing) to the console.
|
24
|
+
#
|
25
|
+
# @return [String]
|
26
|
+
def write
|
27
|
+
if write_file?
|
28
|
+
Vedeu::Terminal.output(write_file)
|
29
|
+
|
30
|
+
else
|
31
|
+
Vedeu::Terminal.output(content)
|
32
|
+
|
33
|
+
end
|
33
34
|
end
|
34
35
|
|
35
36
|
private
|
36
37
|
|
37
|
-
|
38
|
-
|
39
|
-
def parse(output)
|
40
|
-
Vedeu::Output::Compressor.render(output, options)
|
38
|
+
def content
|
39
|
+
compression
|
41
40
|
end
|
42
41
|
|
43
42
|
end # Terminal
|
data/lib/vedeu/renderers/text.rb
CHANGED
@@ -5,33 +5,39 @@ module Vedeu
|
|
5
5
|
module Renderers
|
6
6
|
|
7
7
|
# Converts a grid of {Vedeu::Cells} objects or
|
8
|
-
# {Vedeu::
|
8
|
+
# {Vedeu::Cells::Char} objects into a stream of characters without
|
9
9
|
# escape sequences.
|
10
10
|
#
|
11
11
|
class Text < Vedeu::Renderers::File
|
12
12
|
|
13
|
-
include Vedeu::Common
|
14
13
|
include Vedeu::Renderers::Options
|
15
14
|
|
16
|
-
#
|
15
|
+
# Render a cleared output.
|
17
16
|
#
|
18
|
-
# @
|
19
|
-
|
20
|
-
|
21
|
-
@options = options || {}
|
17
|
+
# @return [String]
|
18
|
+
def clear
|
19
|
+
render('')
|
22
20
|
end
|
23
21
|
|
24
|
-
|
22
|
+
private
|
23
|
+
|
24
|
+
# Combine all characters in a row to produce a line, then all
|
25
|
+
# lines should be terminated with `\n`. Convert to an array of
|
26
|
+
# UTF8 codepoints, and any codepoint above 255 should be
|
27
|
+
# converted to a space.
|
25
28
|
#
|
26
29
|
# @return [String]
|
27
|
-
def
|
28
|
-
''
|
30
|
+
def content
|
31
|
+
return '' if string?(output) || absent?(output)
|
32
|
+
|
33
|
+
buffer.map(&:join).join("\n").unpack('U*').map do |c|
|
34
|
+
(c > 255) ? ' ' : c.chr
|
35
|
+
end.join
|
29
36
|
end
|
30
37
|
|
31
|
-
# @param output [Vedeu::Models::Page]
|
32
38
|
# @return [Array<String>]
|
33
|
-
def
|
34
|
-
|
39
|
+
def buffer
|
40
|
+
empty = Array.new(Vedeu.height) { Array.new(Vedeu.width) { ' ' } }
|
35
41
|
|
36
42
|
output.each do |row|
|
37
43
|
row.each do |char|
|
@@ -39,29 +45,11 @@ module Vedeu
|
|
39
45
|
positionable?(char) &&
|
40
46
|
textual?(char)
|
41
47
|
|
42
|
-
|
43
|
-
|
44
|
-
buffer[char.position.y - 1][char.position.x - 1] = char.text
|
48
|
+
empty[char.position.y - 1][char.position.x - 1] = char.text
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|
48
|
-
|
49
|
-
|
50
|
-
data
|
51
|
-
end
|
52
|
-
|
53
|
-
private
|
54
|
-
|
55
|
-
# @return [Array<String>]
|
56
|
-
def buffer
|
57
|
-
@buffer ||= Array.new(Vedeu.height) { Array.new(Vedeu.width) { ' ' } }
|
58
|
-
end
|
59
|
-
|
60
|
-
# @return [String]
|
61
|
-
def data
|
62
|
-
@data ||= buffer.map(&:join).join("\n").unpack('U*').map do |c|
|
63
|
-
(c > 255) ? ' ' : c.chr
|
64
|
-
end.join
|
52
|
+
empty
|
65
53
|
end
|
66
54
|
|
67
55
|
# @return [Boolean]
|
@@ -73,18 +61,21 @@ module Vedeu
|
|
73
61
|
# @return [Array<Class>]
|
74
62
|
def renderables
|
75
63
|
[
|
76
|
-
Vedeu::Cells::
|
77
|
-
Vedeu::Cells::
|
78
|
-
Vedeu::Cells::
|
64
|
+
Vedeu::Cells::Border,
|
65
|
+
Vedeu::Cells::BottomHorizontal,
|
66
|
+
Vedeu::Cells::BottomLeft,
|
67
|
+
Vedeu::Cells::BottomRight,
|
68
|
+
Vedeu::Cells::Corner,
|
79
69
|
Vedeu::Cells::Char,
|
80
|
-
Vedeu::Cells::TopRight,
|
81
|
-
Vedeu::Views::Char,
|
82
70
|
Vedeu::Cells::Clear,
|
71
|
+
Vedeu::Cells::Empty,
|
72
|
+
Vedeu::Cells::Horizontal,
|
83
73
|
Vedeu::Cells::LeftVertical,
|
84
74
|
Vedeu::Cells::RightVertical,
|
85
|
-
Vedeu::Cells::
|
86
|
-
Vedeu::Cells::
|
87
|
-
Vedeu::Cells::
|
75
|
+
Vedeu::Cells::TopHorizontal,
|
76
|
+
Vedeu::Cells::TopLeft,
|
77
|
+
Vedeu::Cells::TopRight,
|
78
|
+
Vedeu::Cells::Vertical,
|
88
79
|
]
|
89
80
|
end
|
90
81
|
|
data/lib/vedeu/version.rb
CHANGED
data/lib/vedeu/views/all.rb
CHANGED
@@ -14,8 +14,6 @@ require 'vedeu/views/default_attributes'
|
|
14
14
|
require 'vedeu/views/value'
|
15
15
|
|
16
16
|
require 'vedeu/views/chars'
|
17
|
-
require 'vedeu/views/char'
|
18
|
-
require 'vedeu/views/html_char'
|
19
17
|
require 'vedeu/views/streams'
|
20
18
|
require 'vedeu/views/stream'
|
21
19
|
require 'vedeu/views/lines'
|
data/lib/vedeu/views/chars.rb
CHANGED
@@ -4,7 +4,7 @@ module Vedeu
|
|
4
4
|
|
5
5
|
module Views
|
6
6
|
|
7
|
-
# A collection of {Vedeu::
|
7
|
+
# A collection of {Vedeu::Cells::Char} instances.
|
8
8
|
#
|
9
9
|
# @api private
|
10
10
|
#
|
@@ -25,12 +25,15 @@ module Vedeu
|
|
25
25
|
|
26
26
|
coerced_collection = []
|
27
27
|
collection.each do |element|
|
28
|
-
coerced_collection << element if element.is_a?(Vedeu::
|
28
|
+
coerced_collection << element if element.is_a?(Vedeu::Cells::Char)
|
29
29
|
end
|
30
30
|
|
31
31
|
new(coerced_collection, parent, name)
|
32
32
|
|
33
33
|
elsif collection.is_a?(Vedeu::Views::Stream)
|
34
|
+
Vedeu::Views::Chars.coerce(collection.value,
|
35
|
+
collection.parent,
|
36
|
+
collection.name)
|
34
37
|
|
35
38
|
elsif collection.is_a?(String)
|
36
39
|
return new([], parent, name) if collection.empty?
|
@@ -44,7 +47,7 @@ module Vedeu
|
|
44
47
|
|
45
48
|
else
|
46
49
|
fail Vedeu::Error::InvalidSyntax,
|
47
|
-
'Cannot coerce for Vedeu::View::
|
50
|
+
'Cannot coerce for Vedeu::View::Chars, as collection is ' \
|
48
51
|
'unrecognised.'
|
49
52
|
|
50
53
|
end
|
data/lib/vedeu/views/stream.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'vedeu/dsl/all'
|
2
|
+
require 'vedeu/cells/all'
|
2
3
|
|
3
4
|
# frozen_string_literal: true
|
4
5
|
|
@@ -32,7 +33,7 @@ module Vedeu
|
|
32
33
|
include Vedeu::Views::Value
|
33
34
|
collection Vedeu::Views::Chars
|
34
35
|
deputy Vedeu::Views::Stream::DSL
|
35
|
-
entity Vedeu::
|
36
|
+
entity Vedeu::Cells::Char
|
36
37
|
parent Vedeu::Views::Streams
|
37
38
|
|
38
39
|
def_delegators :value,
|
@@ -73,7 +74,7 @@ module Vedeu
|
|
73
74
|
|
74
75
|
# An object is equal when its values are the same.
|
75
76
|
#
|
76
|
-
# @param other [
|
77
|
+
# @param other [void]
|
77
78
|
# @return [Boolean]
|
78
79
|
def eql?(other)
|
79
80
|
self.class == other.class && value == other.value
|
@@ -8,25 +8,25 @@ module Vedeu
|
|
8
8
|
|
9
9
|
describe Caption do
|
10
10
|
|
11
|
-
let(:described)
|
12
|
-
let(:instance)
|
13
|
-
let(:_name)
|
14
|
-
let(:_value)
|
11
|
+
let(:described) { Vedeu::Borders::Caption }
|
12
|
+
let(:instance) { described.new(_name, _value, horizontal) }
|
13
|
+
let(:_name) { 'Vedeu::Borders::Caption' }
|
14
|
+
let(:_value) { 'Bismuth' }
|
15
|
+
let(:type) { :bottom_horizontal }
|
15
16
|
let(:horizontal) {
|
16
17
|
[
|
17
|
-
Vedeu::
|
18
|
-
Vedeu::
|
19
|
-
Vedeu::
|
20
|
-
Vedeu::
|
21
|
-
Vedeu::
|
22
|
-
Vedeu::
|
23
|
-
Vedeu::
|
24
|
-
Vedeu::
|
25
|
-
Vedeu::
|
26
|
-
Vedeu::
|
18
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 1]),
|
19
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 2]),
|
20
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 3]),
|
21
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 4]),
|
22
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 5]),
|
23
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 6]),
|
24
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 7]),
|
25
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 8]),
|
26
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 9]),
|
27
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 10]),
|
27
28
|
]
|
28
29
|
}
|
29
|
-
let(:type) { :bottom_horizontal }
|
30
30
|
|
31
31
|
describe '#render' do
|
32
32
|
subject { instance.render }
|
@@ -50,7 +50,7 @@ module Vedeu
|
|
50
50
|
}
|
51
51
|
let(:expected) {
|
52
52
|
[
|
53
|
-
Vedeu::
|
53
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 1]),
|
54
54
|
Vedeu::Cells::Char.new(value: ' ', position: [4, 2]),
|
55
55
|
Vedeu::Cells::Char.new(value: 'B', position: [4, 3]),
|
56
56
|
Vedeu::Cells::Char.new(value: 'i', position: [4, 4]),
|
@@ -59,7 +59,7 @@ module Vedeu
|
|
59
59
|
Vedeu::Cells::Char.new(value: 'u', position: [4, 7]),
|
60
60
|
Vedeu::Cells::Char.new(value: 't', position: [4, 8]),
|
61
61
|
Vedeu::Cells::Char.new(value: ' ', position: [4, 9]),
|
62
|
-
Vedeu::
|
62
|
+
Vedeu::Cells::BottomHorizontal.new(position: [4, 10]),
|
63
63
|
]
|
64
64
|
}
|
65
65
|
|
@@ -14,16 +14,16 @@ module Vedeu
|
|
14
14
|
let(:_value) { 'Aluminium' }
|
15
15
|
let(:horizontal) {
|
16
16
|
[
|
17
|
-
Vedeu::
|
18
|
-
Vedeu::
|
19
|
-
Vedeu::
|
20
|
-
Vedeu::
|
21
|
-
Vedeu::
|
22
|
-
Vedeu::
|
23
|
-
Vedeu::
|
24
|
-
Vedeu::
|
25
|
-
Vedeu::
|
26
|
-
Vedeu::
|
17
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 1]),
|
18
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 2]),
|
19
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 3]),
|
20
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 4]),
|
21
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 5]),
|
22
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 6]),
|
23
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 7]),
|
24
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 8]),
|
25
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 9]),
|
26
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 10]),
|
27
27
|
]
|
28
28
|
}
|
29
29
|
let(:type) { :top_horizontal }
|
@@ -47,7 +47,7 @@ module Vedeu
|
|
47
47
|
context 'when the title is not empty' do
|
48
48
|
let(:expected) {
|
49
49
|
[
|
50
|
-
Vedeu::
|
50
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 1]),
|
51
51
|
Vedeu::Cells::Char.new(value: ' ', position: [1, 2]),
|
52
52
|
Vedeu::Cells::Char.new(value: 'A', position: [1, 3]),
|
53
53
|
Vedeu::Cells::Char.new(value: 'l', position: [1, 4]),
|
@@ -56,7 +56,7 @@ module Vedeu
|
|
56
56
|
Vedeu::Cells::Char.new(value: 'i', position: [1, 7]),
|
57
57
|
Vedeu::Cells::Char.new(value: 'n', position: [1, 8]),
|
58
58
|
Vedeu::Cells::Char.new(value: ' ', position: [1, 9]),
|
59
|
-
Vedeu::
|
59
|
+
Vedeu::Cells::TopHorizontal.new(position: [1, 10]),
|
60
60
|
]
|
61
61
|
}
|
62
62
|
|
data/test/lib/vedeu/cells/borders/{bottom_horizontal_test.rb → edges/bottom_horizontal_test.rb}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -11,6 +11,12 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Cells::Horizontal }
|
12
12
|
let(:instance) { described.new }
|
13
13
|
|
14
|
+
describe '#as_html' do
|
15
|
+
subject { instance.as_html }
|
16
|
+
|
17
|
+
it { subject.must_equal('─') }
|
18
|
+
end
|
19
|
+
|
14
20
|
describe '#text' do
|
15
21
|
subject { instance.text }
|
16
22
|
|
@@ -11,6 +11,12 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Cells::Vertical }
|
12
12
|
let(:instance) { described.new }
|
13
13
|
|
14
|
+
describe '#as_html' do
|
15
|
+
subject { instance.as_html }
|
16
|
+
|
17
|
+
it { subject.must_equal('│') }
|
18
|
+
end
|
19
|
+
|
14
20
|
describe '#text' do
|
15
21
|
subject { instance.text }
|
16
22
|
|
@@ -11,6 +11,12 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Cells::BottomLeft }
|
12
12
|
let(:instance) { described.new }
|
13
13
|
|
14
|
+
describe '#as_html' do
|
15
|
+
subject { instance.as_html }
|
16
|
+
|
17
|
+
it { subject.must_equal('└') }
|
18
|
+
end
|
19
|
+
|
14
20
|
describe '#type' do
|
15
21
|
subject { instance.type }
|
16
22
|
|
@@ -11,6 +11,12 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Cells::BottomRight }
|
12
12
|
let(:instance) { described.new }
|
13
13
|
|
14
|
+
describe '#as_html' do
|
15
|
+
subject { instance.as_html }
|
16
|
+
|
17
|
+
it { subject.must_equal('┘') }
|
18
|
+
end
|
19
|
+
|
14
20
|
describe '#type' do
|
15
21
|
subject { instance.type }
|
16
22
|
|
@@ -11,6 +11,12 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Cells::TopLeft }
|
12
12
|
let(:instance) { described.new }
|
13
13
|
|
14
|
+
describe '#as_html' do
|
15
|
+
subject { instance.as_html }
|
16
|
+
|
17
|
+
it { subject.must_equal('┌') }
|
18
|
+
end
|
19
|
+
|
14
20
|
describe '#type' do
|
15
21
|
subject { instance.type }
|
16
22
|
|