vedeu 0.6.19 → 0.6.20
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/configuration.md +6 -4
- data/docs/dsl.md +23 -21
- data/docs/events/system.md +9 -9
- data/docs/getting_started.md +54 -48
- data/docs/object_graph.md +4 -4
- data/lib/vedeu/all.rb +1 -1
- data/lib/vedeu/api/external.rb +10 -10
- data/lib/vedeu/api/internal.rb +2 -2
- data/lib/vedeu/bindings/application.rb +5 -2
- data/lib/vedeu/bindings/bindings.rb +15 -2
- data/lib/vedeu/bindings/movement.rb +10 -5
- data/lib/vedeu/bindings/refresh.rb +1 -1
- data/lib/vedeu/bindings/system.rb +1 -1
- data/lib/vedeu/bindings/visibility.rb +20 -37
- data/lib/vedeu/cursors/cursor.rb +1 -14
- data/lib/vedeu/dsl/all.rb +0 -1
- data/lib/vedeu/dsl/interface.rb +1 -1
- data/lib/vedeu/esc/colours.rb +1 -1
- data/lib/vedeu/geometry/geometry.rb +19 -25
- data/lib/vedeu/groups/all.rb +16 -0
- data/lib/vedeu/{output/clear/group.rb → groups/clear.rb} +7 -7
- data/lib/vedeu/{dsl/group.rb → groups/dsl.rb} +10 -10
- data/lib/vedeu/{models → groups}/group.rb +14 -31
- data/lib/vedeu/{output/refresh/refresh_group.rb → groups/refresh.rb} +7 -7
- data/lib/vedeu/groups/repository.rb +24 -0
- data/lib/vedeu/models/all.rb +0 -2
- data/lib/vedeu/models/interface.rb +0 -12
- data/lib/vedeu/models/toggleable.rb +1 -1
- data/lib/vedeu/output/clear/all.rb +0 -1
- data/lib/vedeu/output/wordwrap.rb +3 -5
- data/lib/vedeu/repositories/model.rb +8 -1
- data/lib/vedeu/runtime/main_loop.rb +2 -2
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/api/external_test.rb +1 -1
- data/test/lib/vedeu/bindings/application_test.rb +1 -0
- data/test/lib/vedeu/bindings/bindings_test.rb +27 -0
- data/test/lib/vedeu/borders/border_test.rb +43 -37
- data/test/lib/vedeu/borders/render_test.rb +5 -1
- data/test/lib/vedeu/buffers/buffer_test.rb +9 -7
- data/test/lib/vedeu/cursors/cursor_test.rb +11 -9
- data/test/lib/vedeu/distributed/test_application_test.rb +18 -16
- data/test/lib/vedeu/dsl/interface_test.rb +2 -2
- data/test/lib/vedeu/editor/cursor_test.rb +18 -16
- data/test/lib/vedeu/editor/document_test.rb +7 -5
- data/test/lib/vedeu/esc/actions_test.rb +0 -2
- data/test/lib/vedeu/esc/borders_test.rb +0 -2
- data/test/lib/vedeu/esc/colours_test.rb +0 -2
- data/test/lib/vedeu/events/aliases_test.rb +1 -1
- data/test/lib/vedeu/geometry/area_test.rb +10 -8
- data/test/lib/vedeu/geometry/dsl_test.rb +2 -2
- data/test/lib/vedeu/geometry/geometry_test.rb +18 -30
- data/test/lib/vedeu/geometry/position_test.rb +6 -4
- data/test/lib/vedeu/{output/clear/group_test.rb → groups/clear_test.rb} +8 -8
- data/test/lib/vedeu/{dsl/group_test.rb → groups/dsl_test.rb} +8 -8
- data/test/lib/vedeu/{models → groups}/group_test.rb +12 -10
- data/test/lib/vedeu/{output/refresh/refresh_group_test.rb → groups/refresh_test.rb} +7 -7
- data/test/lib/vedeu/{models/groups_test.rb → groups/repository_test.rb} +6 -6
- data/test/lib/vedeu/menus/menu_test.rb +7 -5
- data/test/lib/vedeu/models/cell_test.rb +5 -3
- data/test/lib/vedeu/models/interface_test.rb +18 -42
- data/test/lib/vedeu/models/toggleable_test.rb +5 -3
- data/test/lib/vedeu/models/views/char_test.rb +8 -6
- data/test/lib/vedeu/models/views/composition_test.rb +6 -4
- data/test/lib/vedeu/models/views/line_test.rb +5 -3
- data/test/lib/vedeu/models/views/stream_test.rb +9 -7
- data/test/lib/vedeu/models/views/view_test.rb +30 -12
- data/test/lib/vedeu/output/presentation/style_test.rb +4 -2
- data/test/lib/vedeu/plugins/plugin_test.rb +8 -6
- data/test/lib/vedeu/repositories/collection_test.rb +8 -6
- data/test/lib/vedeu/runtime/application_test.rb +1 -1
- data/test/test_helper.rb +1 -0
- metadata +18 -17
- data/lib/vedeu/models/groups.rb +0 -24
@@ -2,13 +2,13 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
module
|
5
|
+
module Groups
|
6
6
|
|
7
|
-
describe
|
7
|
+
describe DSL do
|
8
8
|
|
9
|
-
let(:described) { Vedeu::DSL
|
9
|
+
let(:described) { Vedeu::Groups::DSL }
|
10
10
|
let(:instance) { described.new(model, client) }
|
11
|
-
let(:model) { Vedeu::
|
11
|
+
let(:model) { Vedeu::Groups::Group.new }
|
12
12
|
let(:client) {}
|
13
13
|
let(:group_name) { 'main_screen' }
|
14
14
|
|
@@ -42,7 +42,7 @@ module Vedeu
|
|
42
42
|
end
|
43
43
|
}
|
44
44
|
|
45
|
-
it { subject.must_be_instance_of(Vedeu::
|
45
|
+
it { subject.must_be_instance_of(Vedeu::Groups::Group) }
|
46
46
|
|
47
47
|
it { subject.members.must_equal(Set['editor_interface']) }
|
48
48
|
end
|
@@ -58,7 +58,7 @@ module Vedeu
|
|
58
58
|
end
|
59
59
|
}
|
60
60
|
|
61
|
-
it { subject.must_be_instance_of(Vedeu::
|
61
|
+
it { subject.must_be_instance_of(Vedeu::Groups::Group) }
|
62
62
|
|
63
63
|
it { subject.members.must_equal(expected) }
|
64
64
|
end
|
@@ -109,8 +109,8 @@ module Vedeu
|
|
109
109
|
) }
|
110
110
|
end
|
111
111
|
|
112
|
-
end
|
112
|
+
end # DSL
|
113
113
|
|
114
|
-
end #
|
114
|
+
end # Groups
|
115
115
|
|
116
116
|
end # Vedeu
|
@@ -2,11 +2,11 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
module
|
5
|
+
module Groups
|
6
6
|
|
7
7
|
describe Group do
|
8
8
|
|
9
|
-
let(:described) { Vedeu::
|
9
|
+
let(:described) { Vedeu::Groups::Group }
|
10
10
|
let(:instance) { described.new(attributes) }
|
11
11
|
let(:attributes) {
|
12
12
|
{
|
@@ -32,17 +32,19 @@ module Vedeu
|
|
32
32
|
end
|
33
33
|
|
34
34
|
describe 'accessors' do
|
35
|
-
it {
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
35
|
+
it {
|
36
|
+
instance.must_respond_to(:name)
|
37
|
+
instance.must_respond_to(:name=)
|
38
|
+
instance.must_respond_to(:visible)
|
39
|
+
instance.must_respond_to(:visible=)
|
40
|
+
instance.must_respond_to(:visible?)
|
41
|
+
}
|
40
42
|
end
|
41
43
|
|
42
44
|
describe '#add' do
|
43
45
|
subject { instance.add('hydrogen') }
|
44
46
|
|
45
|
-
it { subject.must_be_instance_of(Vedeu::
|
47
|
+
it { subject.must_be_instance_of(Vedeu::Groups::Group) }
|
46
48
|
|
47
49
|
context 'when the member already exists' do
|
48
50
|
it 'does not add the member again but returns a new Group' do
|
@@ -121,7 +123,7 @@ module Vedeu
|
|
121
123
|
describe '#reset' do
|
122
124
|
subject { instance.reset }
|
123
125
|
|
124
|
-
it { subject.must_be_instance_of(Vedeu::
|
126
|
+
it { subject.must_be_instance_of(Vedeu::Groups::Group) }
|
125
127
|
it { subject.members.must_be_empty }
|
126
128
|
end
|
127
129
|
|
@@ -133,6 +135,6 @@ module Vedeu
|
|
133
135
|
|
134
136
|
end # Group
|
135
137
|
|
136
|
-
end #
|
138
|
+
end # Groups
|
137
139
|
|
138
140
|
end # Vedeu
|
@@ -2,13 +2,13 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
module
|
5
|
+
module Groups
|
6
6
|
|
7
|
-
describe
|
7
|
+
describe Refresh do
|
8
8
|
|
9
|
-
let(:described) { Vedeu::
|
9
|
+
let(:described) { Vedeu::Groups::Refresh }
|
10
10
|
let(:instance) { described.new(_name) }
|
11
|
-
let(:_name) { 'Vedeu::
|
11
|
+
let(:_name) { 'Vedeu::Groups::Refresh' }
|
12
12
|
|
13
13
|
describe '#initialize' do
|
14
14
|
it { instance.must_be_instance_of(described) }
|
@@ -26,7 +26,7 @@ module Vedeu
|
|
26
26
|
|
27
27
|
context 'when the name is present' do
|
28
28
|
it {
|
29
|
-
Vedeu::
|
29
|
+
Vedeu::Groups::Refresh.expects(:by_name).with(_name)
|
30
30
|
subject
|
31
31
|
}
|
32
32
|
end
|
@@ -36,8 +36,8 @@ module Vedeu
|
|
36
36
|
it { instance.must_respond_to(:by_name) }
|
37
37
|
end
|
38
38
|
|
39
|
-
end #
|
39
|
+
end # Refresh
|
40
40
|
|
41
|
-
end #
|
41
|
+
end # Groups
|
42
42
|
|
43
43
|
end # Vedeu
|
@@ -2,11 +2,11 @@ require 'test_helper'
|
|
2
2
|
|
3
3
|
module Vedeu
|
4
4
|
|
5
|
-
module
|
5
|
+
module Groups
|
6
6
|
|
7
|
-
describe
|
7
|
+
describe Repository do
|
8
8
|
|
9
|
-
let(:described) { Vedeu::
|
9
|
+
let(:described) { Vedeu::Groups::Repository }
|
10
10
|
|
11
11
|
it { described.must_respond_to(:groups) }
|
12
12
|
|
@@ -15,11 +15,11 @@ module Vedeu
|
|
15
15
|
|
16
16
|
subject { described.groups.by_name(_name) }
|
17
17
|
|
18
|
-
it { subject.must_be_instance_of(Vedeu::
|
18
|
+
it { subject.must_be_instance_of(Vedeu::Groups::Group) }
|
19
19
|
end
|
20
20
|
|
21
|
-
end #
|
21
|
+
end # Repository
|
22
22
|
|
23
|
-
end #
|
23
|
+
end # Groups
|
24
24
|
|
25
25
|
end # Vedeu
|
@@ -51,11 +51,13 @@ module Vedeu
|
|
51
51
|
end
|
52
52
|
|
53
53
|
describe 'accessors' do
|
54
|
-
it {
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
54
|
+
it {
|
55
|
+
instance.must_respond_to(:collection)
|
56
|
+
instance.must_respond_to(:collection=)
|
57
|
+
instance.must_respond_to(:current=)
|
58
|
+
instance.must_respond_to(:name)
|
59
|
+
instance.must_respond_to(:name=)
|
60
|
+
}
|
59
61
|
end
|
60
62
|
|
61
63
|
describe '#current' do
|
@@ -30,9 +30,11 @@ module Vedeu
|
|
30
30
|
end
|
31
31
|
|
32
32
|
describe 'accessors' do
|
33
|
-
it {
|
34
|
-
|
35
|
-
|
33
|
+
it {
|
34
|
+
instance.must_respond_to(:colour)
|
35
|
+
instance.must_respond_to(:style)
|
36
|
+
instance.must_respond_to(:value)
|
37
|
+
}
|
36
38
|
end
|
37
39
|
|
38
40
|
describe '#eql?' do
|
@@ -49,22 +49,24 @@ module Vedeu
|
|
49
49
|
end
|
50
50
|
|
51
51
|
describe 'accessors' do
|
52
|
-
it {
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
52
|
+
it {
|
53
|
+
instance.must_respond_to(:client)
|
54
|
+
instance.must_respond_to(:client=)
|
55
|
+
instance.must_respond_to(:delay)
|
56
|
+
instance.must_respond_to(:delay=)
|
57
|
+
instance.must_respond_to(:group)
|
58
|
+
instance.must_respond_to(:group=)
|
59
|
+
instance.must_respond_to(:name)
|
60
|
+
instance.must_respond_to(:name=)
|
61
|
+
instance.must_respond_to(:parent)
|
62
|
+
instance.must_respond_to(:parent=)
|
63
|
+
instance.must_respond_to(:zindex)
|
64
|
+
instance.must_respond_to(:zindex=)
|
65
|
+
instance.must_respond_to(:visible)
|
66
|
+
instance.must_respond_to(:visible=)
|
67
|
+
instance.must_respond_to(:visible?)
|
68
|
+
instance.must_respond_to(:attributes)
|
69
|
+
}
|
68
70
|
end
|
69
71
|
|
70
72
|
describe '#hide' do
|
@@ -93,32 +95,6 @@ module Vedeu
|
|
93
95
|
}
|
94
96
|
end
|
95
97
|
|
96
|
-
describe '#toggle' do
|
97
|
-
let(:buffer) { Vedeu::Buffers::Buffer.new }
|
98
|
-
|
99
|
-
before { Vedeu.buffers.stubs(:by_name).returns(buffer) }
|
100
|
-
|
101
|
-
subject { instance.toggle }
|
102
|
-
|
103
|
-
context 'when the interface is not visible' do
|
104
|
-
let(:visible) { false }
|
105
|
-
|
106
|
-
it {
|
107
|
-
Vedeu.buffers.by_name('hydrogen').expects(:show)
|
108
|
-
subject
|
109
|
-
}
|
110
|
-
end
|
111
|
-
|
112
|
-
context 'when the interface is visible' do
|
113
|
-
let(:visible) { true }
|
114
|
-
|
115
|
-
it {
|
116
|
-
Vedeu.buffers.by_name('hydrogen').expects(:hide)
|
117
|
-
subject
|
118
|
-
}
|
119
|
-
end
|
120
|
-
end
|
121
|
-
|
122
98
|
end # Interface
|
123
99
|
|
124
100
|
end # Models
|
@@ -21,9 +21,11 @@ module Vedeu
|
|
21
21
|
let(:visible) { false }
|
22
22
|
|
23
23
|
describe 'accessors' do
|
24
|
-
it {
|
25
|
-
|
26
|
-
|
24
|
+
it {
|
25
|
+
instance.must_respond_to(:visible)
|
26
|
+
instance.must_respond_to(:visible=)
|
27
|
+
instance.must_respond_to(:visible?)
|
28
|
+
}
|
27
29
|
end
|
28
30
|
|
29
31
|
describe '#hide' do
|
@@ -58,12 +58,14 @@ module Vedeu
|
|
58
58
|
end
|
59
59
|
|
60
60
|
describe 'accessors' do
|
61
|
-
it {
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
61
|
+
it {
|
62
|
+
instance.must_respond_to(:border)
|
63
|
+
instance.must_respond_to(:border=)
|
64
|
+
instance.must_respond_to(:parent)
|
65
|
+
instance.must_respond_to(:parent=)
|
66
|
+
instance.must_respond_to(:attributes)
|
67
|
+
instance.must_respond_to(:value=)
|
68
|
+
}
|
67
69
|
end
|
68
70
|
|
69
71
|
describe '#chars' do
|
@@ -43,10 +43,12 @@ module Vedeu
|
|
43
43
|
end
|
44
44
|
|
45
45
|
describe 'accessors' do
|
46
|
-
it {
|
47
|
-
|
48
|
-
|
49
|
-
|
46
|
+
it {
|
47
|
+
instance.must_respond_to(:attributes)
|
48
|
+
instance.must_respond_to(:parent)
|
49
|
+
instance.must_respond_to(:value)
|
50
|
+
instance.must_respond_to(:views)
|
51
|
+
}
|
50
52
|
end
|
51
53
|
|
52
54
|
describe '#add' do
|
@@ -70,9 +70,11 @@ module Vedeu
|
|
70
70
|
end
|
71
71
|
|
72
72
|
describe 'accessors' do
|
73
|
-
it {
|
74
|
-
|
75
|
-
|
73
|
+
it {
|
74
|
+
instance.must_respond_to(:attributes)
|
75
|
+
instance.must_respond_to(:parent)
|
76
|
+
instance.must_respond_to(:parent=)
|
77
|
+
}
|
76
78
|
end
|
77
79
|
|
78
80
|
describe '#add' do
|
@@ -52,13 +52,15 @@ module Vedeu
|
|
52
52
|
end
|
53
53
|
|
54
54
|
describe 'accessors' do
|
55
|
-
it {
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
55
|
+
it {
|
56
|
+
instance.must_respond_to(:parent)
|
57
|
+
instance.must_respond_to(:parent=)
|
58
|
+
instance.must_respond_to(:value)
|
59
|
+
instance.must_respond_to(:content)
|
60
|
+
instance.must_respond_to(:text)
|
61
|
+
instance.must_respond_to(:value=)
|
62
|
+
instance.must_respond_to(:attributes)
|
63
|
+
}
|
62
64
|
end
|
63
65
|
|
64
66
|
describe '#add' do
|
@@ -29,16 +29,18 @@ module Vedeu
|
|
29
29
|
let(:_name) { 'Vedeu::Views::View' }
|
30
30
|
|
31
31
|
describe 'accessors' do
|
32
|
-
it {
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
32
|
+
it {
|
33
|
+
instance.must_respond_to(:attributes)
|
34
|
+
instance.must_respond_to(:client)
|
35
|
+
instance.must_respond_to(:client=)
|
36
|
+
instance.must_respond_to(:name)
|
37
|
+
instance.must_respond_to(:name=)
|
38
|
+
instance.must_respond_to(:parent)
|
39
|
+
instance.must_respond_to(:parent=)
|
40
|
+
instance.must_respond_to(:lines=)
|
41
|
+
instance.must_respond_to(:zindex)
|
42
|
+
instance.must_respond_to(:zindex=)
|
43
|
+
}
|
42
44
|
end
|
43
45
|
|
44
46
|
describe '#add' do
|
@@ -65,8 +67,24 @@ module Vedeu
|
|
65
67
|
end
|
66
68
|
|
67
69
|
context 'when the view is visible' do
|
68
|
-
|
69
|
-
|
70
|
+
let(:interface) { Vedeu::Models::Interface.new(visible: true) }
|
71
|
+
let(:border) { Vedeu::Borders::Border.new(name: _name, enabled: false) }
|
72
|
+
|
73
|
+
before do
|
74
|
+
Vedeu.stubs(:trigger)
|
75
|
+
Vedeu.interfaces.stubs(:by_name).with(_name).returns(interface)
|
76
|
+
Vedeu::Output::Viewport.stubs(:render)
|
77
|
+
Vedeu.borders.stubs(:by_name).with(_name).returns(border)
|
78
|
+
border.stubs(:render)
|
79
|
+
end
|
80
|
+
|
81
|
+
it {
|
82
|
+
Vedeu.expects(:trigger).with(:_clear_view_, _name)
|
83
|
+
Vedeu::Output::Viewport.expects(:render).with(instance)
|
84
|
+
Vedeu.borders.expects(:by_name).with(_name).returns(border)
|
85
|
+
border.expects(:render)
|
86
|
+
subject
|
87
|
+
}
|
70
88
|
end
|
71
89
|
end
|
72
90
|
|
@@ -20,8 +20,10 @@ module Vedeu
|
|
20
20
|
end
|
21
21
|
|
22
22
|
describe 'accessors' do
|
23
|
-
it {
|
24
|
-
|
23
|
+
it {
|
24
|
+
instance.must_respond_to(:value)
|
25
|
+
instance.must_respond_to(:value=)
|
26
|
+
}
|
25
27
|
end
|
26
28
|
|
27
29
|
describe '.coerce' do
|