vedeu 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.travis.yml +1 -1
- data/README.md +2 -6
- data/config/rubocop_enabled.yml +0 -6
- data/docs/dsl/by_method/clock_time.md +4 -1
- data/lib/vedeu/application/application_controller.rb +2 -2
- data/lib/vedeu/application/controller.rb +3 -3
- data/lib/vedeu/borders/border.rb +6 -6
- data/lib/vedeu/borders/dsl.rb +26 -26
- data/lib/vedeu/borders/refresh.rb +2 -2
- data/lib/vedeu/borders/title.rb +4 -4
- data/lib/vedeu/buffers/refresh.rb +8 -7
- data/lib/vedeu/buffers/terminal.rb +1 -1
- data/lib/vedeu/buffers/view.rb +2 -2
- data/lib/vedeu/cells/clear.rb +1 -1
- data/lib/vedeu/cells/cursor.rb +6 -6
- data/lib/vedeu/cells/empty.rb +2 -2
- data/lib/vedeu/cells/escape.rb +6 -6
- data/lib/vedeu/coercers/alignment.rb +1 -1
- data/lib/vedeu/coercers/colour_attributes.rb +8 -16
- data/lib/vedeu/colours/background.rb +4 -8
- data/lib/vedeu/colours/colour.rb +4 -4
- data/lib/vedeu/colours/foreground.rb +4 -8
- data/lib/vedeu/colours/repository.rb +1 -1
- data/lib/vedeu/colours/translator.rb +6 -6
- data/lib/vedeu/common.rb +1 -1
- data/lib/vedeu/configuration/api.rb +15 -15
- data/lib/vedeu/configuration/configuration.rb +8 -8
- data/lib/vedeu/cursors/coordinate.rb +4 -4
- data/lib/vedeu/cursors/cursor.rb +2 -2
- data/lib/vedeu/distributed/client.rb +2 -2
- data/lib/vedeu/distributed/server.rb +8 -10
- data/lib/vedeu/distributed/subprocess.rb +1 -1
- data/lib/vedeu/distributed/uri.rb +1 -1
- data/lib/vedeu/dsl/cursors.rb +2 -2
- data/lib/vedeu/dsl/elements.rb +5 -5
- data/lib/vedeu/dsl/helpers/align.rb +1 -1
- data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
- data/lib/vedeu/dsl/presentation.rb +15 -15
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/dsl/views.rb +1 -1
- data/lib/vedeu/editor/cursor.rb +1 -1
- data/lib/vedeu/editor/line.rb +2 -2
- data/lib/vedeu/editor/lines.rb +2 -2
- data/lib/vedeu/esc/borders.rb +19 -19
- data/lib/vedeu/esc/colours.rb +1 -1
- data/lib/vedeu/events/aliases.rb +3 -15
- data/lib/vedeu/events/event.rb +14 -14
- data/lib/vedeu/events/repository.rb +1 -1
- data/lib/vedeu/geometries/area/area.rb +5 -5
- data/lib/vedeu/geometries/area/dimension.rb +1 -1
- data/lib/vedeu/geometries/dsl/dsl.rb +7 -7
- data/lib/vedeu/geometries/geometry.rb +2 -2
- data/lib/vedeu/geometries/position.rb +6 -6
- data/lib/vedeu/groups/clear.rb +2 -2
- data/lib/vedeu/groups/group.rb +2 -2
- data/lib/vedeu/input/dsl.rb +1 -1
- data/lib/vedeu/input/key.rb +3 -3
- data/lib/vedeu/input/mapper.rb +2 -2
- data/lib/vedeu/input/read.rb +2 -4
- data/lib/vedeu/input/store.rb +1 -17
- data/lib/vedeu/input/translator.rb +49 -45
- data/lib/vedeu/interfaces/clear.rb +3 -3
- data/lib/vedeu/interfaces/dsl.rb +4 -4
- data/lib/vedeu/interfaces/interface.rb +2 -2
- data/lib/vedeu/logging/clock_time.rb +3 -3
- data/lib/vedeu/logging/debug.rb +14 -6
- data/lib/vedeu/logging/log.rb +1 -1
- data/lib/vedeu/menus/dsl.rb +2 -2
- data/lib/vedeu/menus/menu.rb +9 -9
- data/lib/vedeu/models/focus.rb +11 -11
- data/lib/vedeu/models/page.rb +1 -1
- data/lib/vedeu/models/row.rb +1 -1
- data/lib/vedeu/models/toggleable.rb +7 -7
- data/lib/vedeu/null/generic.rb +29 -29
- data/lib/vedeu/output/compressor_cache.rb +1 -11
- data/lib/vedeu/output/viewport.rb +4 -12
- data/lib/vedeu/output/write.rb +3 -3
- data/lib/vedeu/plugins/plugin.rb +1 -1
- data/lib/vedeu/presentation/colour.rb +1 -1
- data/lib/vedeu/presentation/presentation.rb +1 -1
- data/lib/vedeu/presentation/style.rb +4 -4
- data/lib/vedeu/renderers/all.rb +1 -14
- data/lib/vedeu/renderers/options.rb +1 -1
- data/lib/vedeu/repositories/all.rb +1 -0
- data/lib/vedeu/repositories/assemblage.rb +1 -1
- data/lib/vedeu/repositories/collection.rb +4 -4
- data/lib/vedeu/repositories/registerable.rb +2 -2
- data/lib/vedeu/repositories/repositories.rb +1 -1
- data/lib/vedeu/repositories/repository.rb +3 -3
- data/lib/vedeu/repositories/storage.rb +38 -0
- data/lib/vedeu/repositories/store.rb +5 -22
- data/lib/vedeu/runtime/application.rb +1 -1
- data/lib/vedeu/runtime/flags.rb +3 -3
- data/lib/vedeu/runtime/router.rb +3 -18
- data/lib/vedeu/templating/helpers.rb +5 -3
- data/lib/vedeu/templating/view_template.rb +26 -18
- data/lib/vedeu/terminal/terminal.rb +5 -5
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/chars.rb +1 -1
- data/lib/vedeu/views/composition.rb +4 -4
- data/lib/vedeu/views/default_attributes.rb +2 -2
- data/lib/vedeu/views/line.rb +6 -6
- data/lib/vedeu/views/lines.rb +1 -1
- data/lib/vedeu/views/stream.rb +6 -6
- data/lib/vedeu/views/streams.rb +1 -1
- data/lib/vedeu/views/view.rb +4 -4
- data/test/lib/vedeu/borders/border_test.rb +1 -1
- data/test/lib/vedeu/borders/caption_test.rb +1 -1
- data/test/lib/vedeu/borders/dsl_test.rb +2 -3
- data/test/lib/vedeu/borders/refresh_test.rb +1 -1
- data/test/lib/vedeu/borders/title_test.rb +1 -1
- data/test/lib/vedeu/buffers/buffer_test.rb +7 -7
- data/test/lib/vedeu/buffers/refresh_test.rb +1 -1
- data/test/lib/vedeu/colours/background_test.rb +27 -0
- data/test/lib/vedeu/colours/foreground_test.rb +27 -0
- data/test/lib/vedeu/cursors/cursor_test.rb +3 -3
- data/test/lib/vedeu/cursors/move_test.rb +1 -1
- data/test/lib/vedeu/cursors/refresh_test.rb +1 -1
- data/test/lib/vedeu/cursors/reposition_test.rb +2 -2
- data/test/lib/vedeu/dsl/view_test.rb +6 -8
- data/test/lib/vedeu/editor/cropper_test.rb +1 -1
- data/test/lib/vedeu/editor/cursor_test.rb +1 -1
- data/test/lib/vedeu/editor/document_test.rb +1 -1
- data/test/lib/vedeu/editor/editor_test.rb +1 -1
- data/test/lib/vedeu/events/aliases_test.rb +0 -14
- data/test/lib/vedeu/geometries/area/area_test.rb +1 -1
- data/test/lib/vedeu/geometries/geometry_test.rb +1 -1
- data/test/lib/vedeu/geometries/move_test.rb +1 -1
- data/test/lib/vedeu/groups/clear_test.rb +1 -1
- data/test/lib/vedeu/groups/dsl_test.rb +1 -1
- data/test/lib/vedeu/groups/group_test.rb +1 -1
- data/test/lib/vedeu/groups/refresh_test.rb +1 -1
- data/test/lib/vedeu/input/capture_test.rb +2 -2
- data/test/lib/vedeu/input/store_test.rb +0 -34
- data/test/lib/vedeu/interfaces/clear_test.rb +1 -1
- data/test/lib/vedeu/interfaces/dsl_test.rb +4 -4
- data/test/lib/vedeu/interfaces/interface_test.rb +1 -1
- data/test/lib/vedeu/menus/dsl_test.rb +1 -1
- data/test/lib/vedeu/null/generic_test.rb +1 -1
- data/test/lib/vedeu/output/compressor_cache_test.rb +0 -33
- data/test/lib/vedeu/renderers/all_test.rb +0 -8
- data/test/lib/vedeu/repositories/repository_test.rb +2 -2
- data/test/lib/vedeu/repositories/storage_test.rb +74 -0
- data/test/lib/vedeu/repositories/store_test.rb +10 -28
- data/test/lib/vedeu/runtime/router_test.rb +0 -8
- data/test/lib/vedeu/views/default_attributes_test.rb +5 -5
- data/test/lib/vedeu/views/view_test.rb +5 -2
- data/test/test_helper.rb +1 -1
- data/vedeu.gemspec +1 -1
- metadata +7 -4
@@ -34,7 +34,7 @@ module Vedeu
|
|
34
34
|
y: y,
|
35
35
|
}
|
36
36
|
}
|
37
|
-
let(:_name) {
|
37
|
+
let(:_name) { :vedeu_cursors_cursor }
|
38
38
|
let(:ox) { 3 }
|
39
39
|
let(:oy) { 2 }
|
40
40
|
let(:repository) { Vedeu.cursors }
|
@@ -64,7 +64,7 @@ module Vedeu
|
|
64
64
|
subject { instance }
|
65
65
|
|
66
66
|
it { subject.must_be_instance_of(described) }
|
67
|
-
it { subject.instance_variable_get('@name').must_equal(
|
67
|
+
it { subject.instance_variable_get('@name').must_equal( _name) }
|
68
68
|
it { subject.instance_variable_get('@ox').must_equal(ox) }
|
69
69
|
it { subject.instance_variable_get('@oy').must_equal(oy) }
|
70
70
|
it do
|
@@ -147,7 +147,7 @@ module Vedeu
|
|
147
147
|
|
148
148
|
describe '#inspect' do
|
149
149
|
let(:expected) {
|
150
|
-
"<Vedeu::Cursors::Cursor name:'
|
150
|
+
"<Vedeu::Cursors::Cursor name:'vedeu_cursors_cursor', x:19, y:8, ox:3, oy:2, " \
|
151
151
|
"visible:true>"
|
152
152
|
}
|
153
153
|
|
@@ -14,7 +14,7 @@ module Vedeu
|
|
14
14
|
|
15
15
|
let(:described) { Vedeu::Cursors::Refresh }
|
16
16
|
let(:instance) { described.new(_name) }
|
17
|
-
let(:_name) {
|
17
|
+
let(:_name) { :vedeu_cursors_refresh }
|
18
18
|
let(:expected) {}
|
19
19
|
let(:cursor) {
|
20
20
|
Vedeu::Cursors::Cursor.store(name: _name,
|
@@ -11,7 +11,7 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Cursors::Reposition }
|
12
12
|
let(:instance) { described.new(attributes) }
|
13
13
|
let(:mode) {}
|
14
|
-
let(:_name) { :
|
14
|
+
let(:_name) { :vedeu_cursors_reposition }
|
15
15
|
let(:x) { 0 }
|
16
16
|
let(:y) { 0 }
|
17
17
|
let(:attributes) {
|
@@ -24,7 +24,7 @@ module Vedeu
|
|
24
24
|
}
|
25
25
|
|
26
26
|
before {
|
27
|
-
Vedeu.interface
|
27
|
+
Vedeu.interface _name do
|
28
28
|
geometry do
|
29
29
|
x 4
|
30
30
|
y 4
|
@@ -14,7 +14,7 @@ module Vedeu
|
|
14
14
|
let(:client) {}
|
15
15
|
|
16
16
|
describe '#view' do
|
17
|
-
let(:_name) { :
|
17
|
+
let(:_name) { :vedeu_dsl_view }
|
18
18
|
|
19
19
|
subject {
|
20
20
|
instance.view(_name) do
|
@@ -47,8 +47,9 @@ module Vedeu
|
|
47
47
|
end
|
48
48
|
|
49
49
|
describe '#template_for' do
|
50
|
-
let(:_name) {}
|
51
|
-
let(:filename) {}
|
50
|
+
let(:_name) { :vedeu_dsl_view }
|
51
|
+
let(:filename) { 'my_interface.erb' }
|
52
|
+
|
52
53
|
let(:object) {}
|
53
54
|
let(:content) { "Hydrogen\nCarbon\nOxygen\nNitrogen" }
|
54
55
|
let(:options) { {} }
|
@@ -56,21 +57,18 @@ module Vedeu
|
|
56
57
|
subject { instance.template_for(_name, filename, object, options) }
|
57
58
|
|
58
59
|
context 'when the name of the view is not given' do
|
59
|
-
let(:
|
60
|
+
let(:_name) {}
|
60
61
|
|
61
62
|
it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) }
|
62
63
|
end
|
63
64
|
|
64
65
|
context 'when the filename of the template is not given' do
|
65
|
-
let(:
|
66
|
+
let(:filename) {}
|
66
67
|
|
67
68
|
it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) }
|
68
69
|
end
|
69
70
|
|
70
71
|
context 'when the name and filename are given' do
|
71
|
-
let(:_name) { 'my_interface' }
|
72
|
-
let(:filename) { 'my_interface.erb' }
|
73
|
-
|
74
72
|
before do
|
75
73
|
Vedeu::Templating::ViewTemplate.expects(:parse).
|
76
74
|
with(object, filename, options).returns(content)
|
@@ -17,7 +17,7 @@ module Vedeu
|
|
17
17
|
described.new(input: input, name: _name)
|
18
18
|
}
|
19
19
|
let(:input) {}
|
20
|
-
let(:_name) {
|
20
|
+
let(:_name) { :vedeu_editor_editor }
|
21
21
|
let(:document) { Vedeu::Editor::Document.new(data: data, name: _name) }
|
22
22
|
let(:data) {
|
23
23
|
"Hydrogen\n" \
|
@@ -90,20 +90,6 @@ module Vedeu
|
|
90
90
|
end
|
91
91
|
end
|
92
92
|
|
93
|
-
describe '.reset!' do
|
94
|
-
subject { described.reset! }
|
95
|
-
|
96
|
-
it { described.must_respond_to(:reset) }
|
97
|
-
|
98
|
-
it { subject.must_equal({}) }
|
99
|
-
end
|
100
|
-
|
101
|
-
describe '.storage' do
|
102
|
-
subject { described.storage }
|
103
|
-
|
104
|
-
it { subject.must_equal({}) }
|
105
|
-
end
|
106
|
-
|
107
93
|
describe '.trigger' do
|
108
94
|
let(:alias_name) { :some_alias }
|
109
95
|
let(:args) {}
|
@@ -10,7 +10,7 @@ module Vedeu
|
|
10
10
|
|
11
11
|
let(:described) { Vedeu::Geometries::Area }
|
12
12
|
let(:instance) { described.new(name: _name, y: y, yn: yn, x: x, xn: xn) }
|
13
|
-
let(:_name) {
|
13
|
+
let(:_name) { :vedeu_geometries_area }
|
14
14
|
let(:y) { 4 }
|
15
15
|
let(:yn) { 9 }
|
16
16
|
let(:x) { 6 }
|
@@ -11,7 +11,7 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Geometries::Move }
|
12
12
|
let(:instance) { described.new(attributes) }
|
13
13
|
let(:direction) {}
|
14
|
-
let(:_name) {
|
14
|
+
let(:_name) { :vedeu_geometries_move }
|
15
15
|
let(:offset) {}
|
16
16
|
let(:attributes) {
|
17
17
|
{
|
@@ -14,7 +14,7 @@ module Vedeu
|
|
14
14
|
|
15
15
|
let(:described) { Vedeu::Groups::Clear }
|
16
16
|
let(:instance) { described.new(_name) }
|
17
|
-
let(:_name) {
|
17
|
+
let(:_name) { :vedeu_groups_clear }
|
18
18
|
|
19
19
|
describe '#initialize' do
|
20
20
|
it { instance.must_be_instance_of(described) }
|
@@ -14,7 +14,7 @@ module Vedeu
|
|
14
14
|
|
15
15
|
let(:described) { Vedeu::Groups::Refresh }
|
16
16
|
let(:instance) { described.new(_name) }
|
17
|
-
let(:_name) {
|
17
|
+
let(:_name) { :vedeu_groups_refresh }
|
18
18
|
|
19
19
|
describe '#initialize' do
|
20
20
|
it { instance.must_be_instance_of(described) }
|
@@ -24,7 +24,7 @@ module Vedeu
|
|
24
24
|
let(:is_fake_mode) { false }
|
25
25
|
let(:is_raw_mode) { false }
|
26
26
|
let(:keypress) {}
|
27
|
-
let(:_name) {
|
27
|
+
let(:_name) { :vedeu_input_capture }
|
28
28
|
let(:interface) {
|
29
29
|
Vedeu::Interfaces::Interface.new(editable: editable,
|
30
30
|
name: _name)
|
@@ -72,7 +72,7 @@ module Vedeu
|
|
72
72
|
|
73
73
|
it do
|
74
74
|
Vedeu.expects(:trigger).
|
75
|
-
with(:_keypress_, translated,
|
75
|
+
with(:_keypress_, translated, _name)
|
76
76
|
subject
|
77
77
|
end
|
78
78
|
end
|
@@ -100,40 +100,6 @@ module Vedeu
|
|
100
100
|
end
|
101
101
|
end
|
102
102
|
|
103
|
-
describe '#reset' do
|
104
|
-
subject { described.reset! }
|
105
|
-
|
106
|
-
it { subject.must_equal({ commands: [], keypresses: [] }) }
|
107
|
-
end
|
108
|
-
|
109
|
-
describe '#storage' do
|
110
|
-
subject { described.storage }
|
111
|
-
|
112
|
-
it { described.must_respond_to(:all) }
|
113
|
-
|
114
|
-
context 'when empty' do
|
115
|
-
it { subject.must_equal({ commands: [], keypresses: [] }) }
|
116
|
-
end
|
117
|
-
|
118
|
-
context 'when not empty' do
|
119
|
-
let(:expected) {
|
120
|
-
{
|
121
|
-
commands: ['command_1', 'command_2'],
|
122
|
-
keypresses: ['a', 'b'],
|
123
|
-
}
|
124
|
-
}
|
125
|
-
|
126
|
-
before do
|
127
|
-
described.add_command('command_1')
|
128
|
-
described.add_command('command_2')
|
129
|
-
described.add_keypress('a')
|
130
|
-
described.add_keypress('b')
|
131
|
-
end
|
132
|
-
|
133
|
-
it { subject.must_equal(expected) }
|
134
|
-
end
|
135
|
-
end
|
136
|
-
|
137
103
|
end # Store
|
138
104
|
|
139
105
|
end # Input
|
@@ -13,7 +13,7 @@ module Vedeu
|
|
13
13
|
let(:model) {
|
14
14
|
Vedeu::Interfaces::Interface.new(name: _name)
|
15
15
|
}
|
16
|
-
let(:_name) {
|
16
|
+
let(:_name) { :vedeu_interfaces_dsl }
|
17
17
|
let(:client) {}
|
18
18
|
|
19
19
|
describe '.interface' do
|
@@ -91,7 +91,7 @@ module Vedeu
|
|
91
91
|
context 'when the interface has a name' do
|
92
92
|
before { Vedeu::Models::Focus.reset }
|
93
93
|
|
94
|
-
it { subject.must_equal([
|
94
|
+
it { subject.must_equal([_name]) }
|
95
95
|
end
|
96
96
|
end
|
97
97
|
|
@@ -111,7 +111,7 @@ module Vedeu
|
|
111
111
|
end
|
112
112
|
|
113
113
|
context 'when the named group exists' do
|
114
|
-
let(:members) { Set[
|
114
|
+
let(:members) { Set[_name, 'lanthanum'] }
|
115
115
|
|
116
116
|
before do
|
117
117
|
Vedeu::Groups::Group.new(name: 'elements',
|
@@ -127,7 +127,7 @@ module Vedeu
|
|
127
127
|
context 'when the named group does not exist' do
|
128
128
|
it do
|
129
129
|
subject
|
130
|
-
Vedeu.groups.find('elements').members.must_equal(Set[
|
130
|
+
Vedeu.groups.find('elements').members.must_equal(Set[_name])
|
131
131
|
end
|
132
132
|
end
|
133
133
|
end
|
@@ -11,7 +11,7 @@ module Vedeu
|
|
11
11
|
let(:described) { Vedeu::Menus::DSL }
|
12
12
|
let(:instance) { described.new(model) }
|
13
13
|
let(:model) { Vedeu::Menus::Menu.new(attributes) }
|
14
|
-
let(:_name) {
|
14
|
+
let(:_name) { :vedeu_menus_dsl }
|
15
15
|
let(:collection) { [:sodium, :magnesium, :aluminium, :silicon] }
|
16
16
|
let(:attributes) {
|
17
17
|
{
|
@@ -65,39 +65,6 @@ module Vedeu
|
|
65
65
|
end
|
66
66
|
end
|
67
67
|
|
68
|
-
describe '#reset!' do
|
69
|
-
before { described.write(:original, [:original_data]) }
|
70
|
-
|
71
|
-
subject { described.reset! }
|
72
|
-
|
73
|
-
it { described.must_respond_to(:reset) }
|
74
|
-
it { subject.must_equal(empty) }
|
75
|
-
end
|
76
|
-
|
77
|
-
describe '#storage' do
|
78
|
-
subject { described.storage }
|
79
|
-
|
80
|
-
context 'when the storage is empty' do
|
81
|
-
it { subject.must_equal(empty) }
|
82
|
-
end
|
83
|
-
|
84
|
-
context 'when the storage is not empty' do
|
85
|
-
let(:expected) {
|
86
|
-
{
|
87
|
-
compressed: 'compressed_data',
|
88
|
-
original: [:original_data],
|
89
|
-
}
|
90
|
-
}
|
91
|
-
|
92
|
-
before {
|
93
|
-
described.write(:original, [:original_data])
|
94
|
-
described.write(:compressed, 'compressed_data')
|
95
|
-
}
|
96
|
-
|
97
|
-
it { subject.must_equal(expected) }
|
98
|
-
end
|
99
|
-
end
|
100
|
-
|
101
68
|
describe '#write' do
|
102
69
|
let(:key) {}
|
103
70
|
let(:_value) {}
|
@@ -37,14 +37,6 @@ module Vedeu
|
|
37
37
|
it { described.must_respond_to(:render) }
|
38
38
|
end
|
39
39
|
|
40
|
-
describe '.reset!' do
|
41
|
-
subject { described.reset! }
|
42
|
-
|
43
|
-
it { described.must_respond_to(:reset) }
|
44
|
-
it { subject.must_be_instance_of(Set) }
|
45
|
-
it { subject.size.must_equal(1) }
|
46
|
-
end
|
47
|
-
|
48
40
|
end # Renderers
|
49
41
|
|
50
42
|
end # Vedeu
|
@@ -9,7 +9,7 @@ module Vedeu
|
|
9
9
|
class RepositoriesTestClass < Vedeu::Repositories::Repository
|
10
10
|
|
11
11
|
attr_accessor :storage
|
12
|
-
|
12
|
+
alias in_memory storage
|
13
13
|
|
14
14
|
def initialize(storage = {})
|
15
15
|
@storage = storage
|
@@ -99,7 +99,7 @@ module Vedeu
|
|
99
99
|
end
|
100
100
|
|
101
101
|
describe '#by_name' do
|
102
|
-
let(:_name) {
|
102
|
+
let(:_name) { :vedeu_repositories_repository }
|
103
103
|
|
104
104
|
subject { instance.by_name(_name) }
|
105
105
|
|