vedeu 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/LICENSE.txt +3 -0
- data/Rakefile +16 -7
- data/examples/borders_app.rb +58 -55
- data/lib/vedeu/api.rb +1 -1
- data/lib/vedeu/application.rb +25 -25
- data/lib/vedeu/bindings.rb +5 -7
- data/lib/vedeu/configuration/api.rb +0 -2
- data/lib/vedeu/configuration/cli.rb +0 -2
- data/lib/vedeu/configuration/configuration.rb +0 -2
- data/lib/vedeu/cursor/cursor.rb +0 -2
- data/lib/vedeu/debug.rb +2 -2
- data/lib/vedeu/distributed/server.rb +0 -2
- data/lib/vedeu/dsl/components/border.rb +15 -19
- data/lib/vedeu/dsl/components/geometry.rb +14 -18
- data/lib/vedeu/dsl/components/keymap.rb +28 -32
- data/lib/vedeu/dsl/composition.rb +27 -9
- data/lib/vedeu/events/all.rb +1 -0
- data/lib/vedeu/events/event.rb +6 -8
- data/lib/vedeu/events/events.rb +10 -0
- data/lib/vedeu/events/trigger.rb +6 -12
- data/lib/vedeu/geometry/grid.rb +0 -2
- data/lib/vedeu/geometry/position.rb +0 -2
- data/lib/vedeu/geometry/position_validator.rb +0 -14
- data/lib/vedeu/input/input.rb +0 -2
- data/lib/vedeu/models/collection.rb +0 -2
- data/lib/vedeu/models/focus.rb +0 -1
- data/lib/vedeu/models/geometry.rb +7 -3
- data/lib/vedeu/models/group.rb +0 -2
- data/lib/vedeu/models/menu.rb +23 -29
- data/lib/vedeu/models/model.rb +0 -2
- data/lib/vedeu/models/view/char.rb +14 -10
- data/lib/vedeu/models/view/composition.rb +7 -9
- data/lib/vedeu/models/view/interface.rb +0 -1
- data/lib/vedeu/models/view/line.rb +2 -3
- data/lib/vedeu/models/view/stream.rb +0 -3
- data/lib/vedeu/output/all.rb +1 -0
- data/lib/vedeu/output/background.rb +0 -2
- data/lib/vedeu/output/colour.rb +0 -2
- data/lib/vedeu/output/compositor.rb +0 -2
- data/lib/vedeu/output/foreground.rb +0 -2
- data/lib/vedeu/output/html_renderer.rb +6 -0
- data/lib/vedeu/output/index_position.rb +35 -0
- data/lib/vedeu/output/output.rb +3 -1
- data/lib/vedeu/output/position_index.rb +2 -2
- data/lib/vedeu/output/presentation.rb +0 -2
- data/lib/vedeu/output/style.rb +0 -1
- data/lib/vedeu/output/translator.rb +18 -20
- data/lib/vedeu/output/viewport.rb +76 -51
- data/lib/vedeu/output/virtual_terminal.rb +2 -1
- data/lib/vedeu/repositories/all.rb +4 -4
- data/lib/vedeu/repositories/repository.rb +0 -2
- data/lib/vedeu/support/coercions.rb +0 -2
- data/lib/vedeu/support/common.rb +0 -2
- data/lib/vedeu/support/esc.rb +0 -2
- data/lib/vedeu/support/log.rb +86 -3
- data/lib/vedeu/support/refresh.rb +0 -2
- data/lib/vedeu/support/sentence.rb +5 -9
- data/lib/vedeu/support/terminal.rb +0 -2
- data/lib/vedeu/support/trace.rb +0 -2
- data/lib/vedeu/support/visible.rb +1 -1
- data/test/lib/vedeu/configuration/api_test.rb +14 -0
- data/test/lib/vedeu/configuration/configuration_test.rb +10 -0
- data/test/lib/vedeu/distributed/server_test.rb +5 -0
- data/test/lib/vedeu/dsl/components/border_test.rb +7 -0
- data/test/lib/vedeu/dsl/components/geometry_test.rb +8 -3
- data/test/lib/vedeu/dsl/interface_test.rb +5 -0
- data/test/lib/vedeu/dsl/line_test.rb +4 -0
- data/test/lib/vedeu/dsl/shared/colour_test.rb +7 -7
- data/test/lib/vedeu/dsl/shared/style_test.rb +5 -2
- data/test/lib/vedeu/dsl/stream_test.rb +4 -1
- data/test/lib/vedeu/events/event_test.rb +6 -0
- data/test/lib/vedeu/geometry/bounding_area_test.rb +30 -30
- data/test/lib/vedeu/geometry/position_test.rb +5 -0
- data/test/lib/vedeu/models/view/char_test.rb +1 -14
- data/test/lib/vedeu/output/index_position_test.rb +64 -0
- data/test/lib/vedeu/output/style_test.rb +4 -0
- data/test/lib/vedeu/output/translator_test.rb +4 -0
- data/test/lib/vedeu/output/virtual_terminal_test.rb +2 -0
- data/test/lib/vedeu/output/wordwrap_test.rb +5 -0
- data/test/lib/vedeu/repositories/all_test.rb +3 -3
- data/test/lib/vedeu/repositories/repository_test.rb +8 -0
- data/test/lib/vedeu/support/console_test.rb +14 -0
- data/test/lib/vedeu/support/esc_test.rb +6 -0
- data/test/lib/vedeu/support/terminal_test.rb +13 -0
- data/vedeu.gemspec +4 -4
- metadata +12 -24
- data/test/integration/distributed_test.rb +0 -16
- data/test/integration/dsl/compositions_test.rb +0 -19
- data/test/integration/dsl/interfaces_test.rb +0 -193
- data/test/integration/dsl/keymaps_test.rb +0 -30
- data/test/integration/dsl/lines_test.rb +0 -104
- data/test/integration/dsl/menus_test.rb +0 -59
- data/test/integration/dsl/streams_test.rb +0 -103
- data/test/integration/dsl/views_test.rb +0 -45
@@ -1,30 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
describe 'Keymaps' do
|
4
|
-
|
5
|
-
describe '#key' do
|
6
|
-
subject {
|
7
|
-
Vedeu.keymap 'keymaps' do
|
8
|
-
key '' do
|
9
|
-
end
|
10
|
-
end
|
11
|
-
}
|
12
|
-
|
13
|
-
context 'when no value is provided' do
|
14
|
-
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe '#name' do
|
19
|
-
subject {
|
20
|
-
Vedeu.keymap 'keymaps' do
|
21
|
-
name ''
|
22
|
-
end
|
23
|
-
}
|
24
|
-
|
25
|
-
context 'when no value is provided' do
|
26
|
-
|
27
|
-
end
|
28
|
-
end
|
29
|
-
|
30
|
-
end
|
@@ -1,104 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
describe 'Lines' do
|
4
|
-
|
5
|
-
describe '#background' do
|
6
|
-
subject {
|
7
|
-
Vedeu.interface 'lines' do
|
8
|
-
lines do
|
9
|
-
background ''
|
10
|
-
end
|
11
|
-
end
|
12
|
-
}
|
13
|
-
|
14
|
-
context 'when no value is provided' do
|
15
|
-
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
describe '#colour' do
|
20
|
-
subject {
|
21
|
-
Vedeu.interface 'lines' do
|
22
|
-
lines do
|
23
|
-
colour ''
|
24
|
-
end
|
25
|
-
end
|
26
|
-
}
|
27
|
-
|
28
|
-
context 'when no value is provided' do
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe '#foreground' do
|
34
|
-
subject {
|
35
|
-
Vedeu.interface 'lines' do
|
36
|
-
lines do
|
37
|
-
foreground ''
|
38
|
-
end
|
39
|
-
end
|
40
|
-
}
|
41
|
-
|
42
|
-
context 'when no value is provided' do
|
43
|
-
|
44
|
-
end
|
45
|
-
end
|
46
|
-
|
47
|
-
describe '#line' do
|
48
|
-
subject {
|
49
|
-
Vedeu.interface 'lines' do
|
50
|
-
lines do
|
51
|
-
line ''
|
52
|
-
end
|
53
|
-
end
|
54
|
-
}
|
55
|
-
|
56
|
-
context 'when no value is provided' do
|
57
|
-
|
58
|
-
end
|
59
|
-
end
|
60
|
-
|
61
|
-
describe '#stream' do
|
62
|
-
subject {
|
63
|
-
Vedeu.interface 'lines' do
|
64
|
-
lines do
|
65
|
-
stream ''
|
66
|
-
end
|
67
|
-
end
|
68
|
-
}
|
69
|
-
|
70
|
-
context 'when no value is provided' do
|
71
|
-
|
72
|
-
end
|
73
|
-
end
|
74
|
-
|
75
|
-
describe '#streams' do
|
76
|
-
subject {
|
77
|
-
Vedeu.interface 'lines' do
|
78
|
-
lines do
|
79
|
-
streams do
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
83
|
-
}
|
84
|
-
|
85
|
-
context 'when no value is provided' do
|
86
|
-
|
87
|
-
end
|
88
|
-
end
|
89
|
-
|
90
|
-
describe '#style' do
|
91
|
-
subject {
|
92
|
-
Vedeu.interface 'lines' do
|
93
|
-
lines do
|
94
|
-
style ''
|
95
|
-
end
|
96
|
-
end
|
97
|
-
}
|
98
|
-
|
99
|
-
context 'when no value is provided' do
|
100
|
-
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
end
|
@@ -1,59 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
describe 'Menus' do
|
4
|
-
|
5
|
-
describe '#item' do
|
6
|
-
subject {
|
7
|
-
Vedeu.menu 'menus' do
|
8
|
-
item 'hydrogen'
|
9
|
-
end
|
10
|
-
}
|
11
|
-
|
12
|
-
it { subject.must_be_instance_of(Vedeu::Menu) }
|
13
|
-
|
14
|
-
it 'allows the use of item within Vedeu.menu' do
|
15
|
-
subject.collection.must_equal(['hydrogen'])
|
16
|
-
end
|
17
|
-
|
18
|
-
context 'when no value is provided' do
|
19
|
-
|
20
|
-
end
|
21
|
-
end
|
22
|
-
|
23
|
-
describe '#items' do
|
24
|
-
subject {
|
25
|
-
Vedeu.menu 'menus' do
|
26
|
-
items ['lithium', 'beryllium']
|
27
|
-
end
|
28
|
-
}
|
29
|
-
|
30
|
-
it { subject.must_be_instance_of(Vedeu::Menu) }
|
31
|
-
|
32
|
-
it 'allows the use of item within Vedeu.menu' do
|
33
|
-
subject.collection.must_equal(['lithium', 'beryllium'])
|
34
|
-
end
|
35
|
-
|
36
|
-
context 'when no value is provided' do
|
37
|
-
|
38
|
-
end
|
39
|
-
end
|
40
|
-
|
41
|
-
describe '#name' do
|
42
|
-
subject {
|
43
|
-
Vedeu.menu 'menus' do
|
44
|
-
name 'elements'
|
45
|
-
end
|
46
|
-
}
|
47
|
-
|
48
|
-
it { subject.must_be_instance_of(Vedeu::Menu) }
|
49
|
-
|
50
|
-
it 'allows the use of name within Vedeu.menu' do
|
51
|
-
subject.name.must_equal('elements')
|
52
|
-
end
|
53
|
-
|
54
|
-
context 'when no value is provided' do
|
55
|
-
|
56
|
-
end
|
57
|
-
end
|
58
|
-
|
59
|
-
end
|
@@ -1,103 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
describe 'Streams' do
|
4
|
-
|
5
|
-
describe '#align' do
|
6
|
-
subject {
|
7
|
-
Vedeu.interface 'streams' do
|
8
|
-
lines do
|
9
|
-
streams do
|
10
|
-
align 'Some text...'
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
14
|
-
}
|
15
|
-
|
16
|
-
context 'when no value is provided' do
|
17
|
-
|
18
|
-
end
|
19
|
-
end
|
20
|
-
|
21
|
-
describe '#background' do
|
22
|
-
subject {
|
23
|
-
Vedeu.interface 'streams' do
|
24
|
-
lines do
|
25
|
-
streams do
|
26
|
-
background ''
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
}
|
31
|
-
|
32
|
-
context 'when no value is provided' do
|
33
|
-
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
describe '#colour' do
|
38
|
-
subject {
|
39
|
-
Vedeu.interface 'streams' do
|
40
|
-
lines do
|
41
|
-
streams do
|
42
|
-
colour ''
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
}
|
47
|
-
|
48
|
-
context 'when no value is provided' do
|
49
|
-
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe '#foreground' do
|
54
|
-
subject {
|
55
|
-
Vedeu.interface 'streams' do
|
56
|
-
lines do
|
57
|
-
streams do
|
58
|
-
foreground ''
|
59
|
-
end
|
60
|
-
end
|
61
|
-
end
|
62
|
-
}
|
63
|
-
|
64
|
-
context 'when no value is provided' do
|
65
|
-
|
66
|
-
end
|
67
|
-
end
|
68
|
-
|
69
|
-
describe '#style' do
|
70
|
-
let(:value) { '' }
|
71
|
-
|
72
|
-
subject {
|
73
|
-
Vedeu.interface 'lines' do
|
74
|
-
lines do
|
75
|
-
streams do
|
76
|
-
style value
|
77
|
-
end
|
78
|
-
end
|
79
|
-
end
|
80
|
-
}
|
81
|
-
|
82
|
-
context 'when no value is provided' do
|
83
|
-
let(:value) {}
|
84
|
-
end
|
85
|
-
end
|
86
|
-
|
87
|
-
describe '#text' do
|
88
|
-
subject {
|
89
|
-
Vedeu.interface 'streams' do
|
90
|
-
lines do
|
91
|
-
streams do
|
92
|
-
text 'Some text...'
|
93
|
-
end
|
94
|
-
end
|
95
|
-
end
|
96
|
-
}
|
97
|
-
|
98
|
-
context 'when no value is provided' do
|
99
|
-
|
100
|
-
end
|
101
|
-
end
|
102
|
-
|
103
|
-
end
|
@@ -1,45 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
describe 'Views' do
|
4
|
-
|
5
|
-
describe '.interface' do
|
6
|
-
subject {
|
7
|
-
Vedeu.interface 'keymaps' do
|
8
|
-
# ...
|
9
|
-
end
|
10
|
-
}
|
11
|
-
|
12
|
-
context 'when no value is provided' do
|
13
|
-
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
describe '.renders' do
|
18
|
-
subject {
|
19
|
-
Vedeu.renders do
|
20
|
-
# ...
|
21
|
-
end
|
22
|
-
}
|
23
|
-
|
24
|
-
context 'when no block is given' do
|
25
|
-
subject { Vedeu.renders }
|
26
|
-
|
27
|
-
it { proc { subject }.must_raise(Vedeu::InvalidSyntax) }
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
describe '.views' do
|
32
|
-
subject {
|
33
|
-
Vedeu.views do
|
34
|
-
# ...
|
35
|
-
end
|
36
|
-
}
|
37
|
-
|
38
|
-
context 'when no block is given' do
|
39
|
-
subject { Vedeu.views }
|
40
|
-
|
41
|
-
it { proc { subject }.must_raise(Vedeu::InvalidSyntax) }
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
end
|