vedeu 0.4.35 → 0.4.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.rubocop.yml +3 -0
- data/Dockerfile +56 -35
- data/bin/vedeu +54 -13
- data/docs/applications.md +92 -0
- data/features/cli_vedeu.feature +5 -0
- data/features/start_stop.feature +1 -1
- data/features/step_definitions/vedeu_steps.rb +0 -0
- data/features/support/env.rb +3 -2
- data/lib/vedeu.rb +1 -0
- data/lib/vedeu/all.rb +6 -0
- data/lib/vedeu/application/all.rb +2 -0
- data/lib/vedeu/application/application_controller.rb +7 -0
- data/lib/vedeu/application/application_helper.rb +7 -0
- data/lib/vedeu/bootstrap.rb +73 -0
- data/lib/vedeu/distributed/templates/default_configuration.vedeu +7 -14
- data/lib/vedeu/generator/all.rb +13 -0
- data/lib/vedeu/generator/application.rb +108 -0
- data/lib/vedeu/generator/helpers.rb +55 -0
- data/lib/vedeu/generator/templates/application/Gemfile +3 -0
- data/lib/vedeu/generator/templates/application/app/controllers/application_controller.erb +7 -0
- data/lib/vedeu/generator/templates/application/app/controllers/name.erb +10 -0
- data/lib/vedeu/generator/templates/application/app/helpers/application_helper.erb +9 -0
- data/lib/vedeu/generator/templates/application/app/helpers/name.erb +9 -0
- data/lib/vedeu/generator/templates/application/app/models/keymaps/_global_.rb +2 -0
- data/lib/vedeu/generator/templates/application/app/models/keymaps/_system_.rb +2 -0
- data/lib/vedeu/generator/templates/application/app/views/interfaces/name.erb +44 -0
- data/lib/vedeu/generator/templates/application/app/views/name.erb +0 -0
- data/lib/vedeu/generator/templates/application/app/views/templates/name.erb +0 -0
- data/lib/vedeu/generator/templates/application/application.rb +9 -0
- data/lib/vedeu/generator/templates/application/bin/name +7 -0
- data/lib/vedeu/generator/templates/application/config/app_name.erb +1 -0
- data/lib/vedeu/generator/templates/application/config/configuration.rb +22 -0
- data/lib/vedeu/generator/templates/application/lib/.gitkeep +0 -0
- data/lib/vedeu/generator/templates/application/test/.gitkeep +0 -0
- data/lib/vedeu/generator/templates/application/vendor/.gitkeep +0 -0
- data/lib/vedeu/generator/view.rb +71 -0
- data/lib/vedeu/geometry/area.rb +21 -21
- data/lib/vedeu/main_loop.rb +0 -1
- data/lib/vedeu/output/esc.rb +5 -4
- data/lib/vedeu/output/refresh.rb +9 -3
- data/lib/vedeu/output/view_helpers/all.rb +0 -2
- data/lib/vedeu/support/log.rb +1 -1
- data/lib/vedeu/support/template.rb +1 -1
- data/lib/vedeu/support/terminal.rb +10 -2
- data/lib/vedeu/tasks/application.rake +28 -0
- data/lib/vedeu/tasks/vedeu.rake +3 -0
- data/lib/vedeu/templating/directive.rb +1 -8
- data/lib/vedeu/traps.rb +2 -2
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/application/application_controller_test.rb +12 -0
- data/test/lib/vedeu/application/application_helper_test.rb +18 -0
- data/test/lib/vedeu/bootstrap_test.rb +30 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +7 -0
- data/test/lib/vedeu/buffers/display_buffer_test.rb +2 -0
- data/test/lib/vedeu/configuration/api_test.rb +6 -0
- data/test/lib/vedeu/cursor/move_test.rb +7 -0
- data/test/lib/vedeu/distributed/client_test.rb +4 -0
- data/test/lib/vedeu/distributed/server_test.rb +9 -0
- data/test/lib/vedeu/dsl/use_test.rb +4 -0
- data/test/lib/vedeu/generator/application_test.rb +55 -0
- data/test/lib/vedeu/generator/helpers_test.rb +80 -0
- data/test/lib/vedeu/generator/view_test.rb +35 -0
- data/test/lib/vedeu/geometry/area_test.rb +8 -0
- data/test/lib/vedeu/launcher_test.rb +2 -0
- data/test/lib/vedeu/main_loop_test.rb +2 -0
- data/test/lib/vedeu/null/interface_test.rb +1 -0
- data/test/lib/vedeu/output/clear_test.rb +3 -0
- data/test/lib/vedeu/output/refresh_test.rb +1 -0
- data/test/lib/vedeu/output/renderers/file_test.rb +1 -0
- data/test/lib/vedeu/repositories/repositories/events_repository_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb +3 -0
- data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/menus_test.rb +2 -0
- data/test/lib/vedeu/repositories/repository_test.rb +1 -0
- data/test/lib/vedeu/support/log_test.rb +5 -0
- data/test/lib/vedeu/support/terminal_test.rb +1 -0
- data/test/lib/vedeu/traps_test.rb +1 -1
- data/test/lib/vedeu_test.rb +1 -0
- data/vedeu.gemspec +7 -4
- metadata +97 -25
|
@@ -35,6 +35,7 @@ module Vedeu
|
|
|
35
35
|
describe '.restart' do
|
|
36
36
|
subject { described.restart }
|
|
37
37
|
|
|
38
|
+
# it { skip }
|
|
38
39
|
# it { subject.must_be_instance_of(NilClass) }
|
|
39
40
|
context 'when the server is not enabled' do
|
|
40
41
|
it { subject.must_equal(:drb_not_enabled) }
|
|
@@ -44,10 +45,12 @@ module Vedeu
|
|
|
44
45
|
|
|
45
46
|
context 'and the server is running' do
|
|
46
47
|
# it { subject.must_equal(:running) }
|
|
48
|
+
# it { skip }
|
|
47
49
|
end
|
|
48
50
|
|
|
49
51
|
context 'and the server is not running' do
|
|
50
52
|
# it { subject.must_equal(:stopped) }
|
|
53
|
+
# it { skip }
|
|
51
54
|
end
|
|
52
55
|
|
|
53
56
|
end
|
|
@@ -69,10 +72,12 @@ module Vedeu
|
|
|
69
72
|
|
|
70
73
|
context 'and the server is running' do
|
|
71
74
|
# it { subject.must_equal(:running) }
|
|
75
|
+
# it { skip }
|
|
72
76
|
end
|
|
73
77
|
|
|
74
78
|
context 'and the server is not running' do
|
|
75
79
|
# it { subject.must_equal(:stopped) }
|
|
80
|
+
# it { skip }
|
|
76
81
|
end
|
|
77
82
|
|
|
78
83
|
it { Vedeu.expects(:trigger).with(:_exit_); subject }
|
|
@@ -91,10 +96,12 @@ module Vedeu
|
|
|
91
96
|
|
|
92
97
|
context 'and the server is running' do
|
|
93
98
|
# it { subject.must_equal(:running) }
|
|
99
|
+
# it { skip }
|
|
94
100
|
end
|
|
95
101
|
|
|
96
102
|
context 'and the server is not running' do
|
|
97
103
|
# it { subject.must_equal(:stopped) }
|
|
104
|
+
# it { skip }
|
|
98
105
|
end
|
|
99
106
|
|
|
100
107
|
end
|
|
@@ -133,10 +140,12 @@ module Vedeu
|
|
|
133
140
|
|
|
134
141
|
context 'and the server is running' do
|
|
135
142
|
# it { subject.must_equal(:running) }
|
|
143
|
+
# it { skip }
|
|
136
144
|
end
|
|
137
145
|
|
|
138
146
|
context 'and the server is not running' do
|
|
139
147
|
# it { subject.must_equal(:stopped) }
|
|
148
|
+
# it { skip }
|
|
140
149
|
end
|
|
141
150
|
|
|
142
151
|
end
|
|
@@ -18,17 +18,21 @@ module Vedeu
|
|
|
18
18
|
|
|
19
19
|
describe '#duplicate' do
|
|
20
20
|
context 'when the model exists' do
|
|
21
|
+
# it { skip }
|
|
21
22
|
end
|
|
22
23
|
|
|
23
24
|
context 'when the model does not exist' do
|
|
25
|
+
# it { skip }
|
|
24
26
|
end
|
|
25
27
|
end
|
|
26
28
|
|
|
27
29
|
describe '#use' do
|
|
28
30
|
context 'when the model exists' do
|
|
31
|
+
# it { skip }
|
|
29
32
|
end
|
|
30
33
|
|
|
31
34
|
context 'when the model does not exist' do
|
|
35
|
+
# it { skip }
|
|
32
36
|
end
|
|
33
37
|
end
|
|
34
38
|
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module Vedeu
|
|
4
|
+
|
|
5
|
+
module Generator
|
|
6
|
+
|
|
7
|
+
describe Application do
|
|
8
|
+
|
|
9
|
+
let(:described) { Vedeu::Generator::Application }
|
|
10
|
+
let(:instance) { described.new(_name) }
|
|
11
|
+
let(:_name) { 'my_first_app' }
|
|
12
|
+
|
|
13
|
+
before do
|
|
14
|
+
FileUtils.stubs(:cp_r)
|
|
15
|
+
FileUtils.stubs(:mkdir)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe '#initialize' do
|
|
19
|
+
it { instance.must_be_instance_of(described) }
|
|
20
|
+
it { instance.instance_variable_get('@name').must_equal(_name) }
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe '.generate' do
|
|
24
|
+
subject { described.generate(_name) }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe '#generate' do
|
|
28
|
+
it { instance.must_respond_to(:generate) }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
describe '#name_as_class' do
|
|
32
|
+
subject { instance.name_as_class }
|
|
33
|
+
|
|
34
|
+
context 'when the name is a single value' do
|
|
35
|
+
let(:_name) { 'VEDEU' }
|
|
36
|
+
|
|
37
|
+
it { subject.must_equal('Vedeu') }
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
context 'when the name is an underscored value' do
|
|
41
|
+
it { subject.must_equal('MyFirstApp') }
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
context 'when the name contains hyphens' do
|
|
45
|
+
let(:_name) { 'hyphenated-APP' }
|
|
46
|
+
|
|
47
|
+
it { subject.must_equal('HyphenatedApp')}
|
|
48
|
+
end
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
end # Application
|
|
52
|
+
|
|
53
|
+
end # Generator
|
|
54
|
+
|
|
55
|
+
end # Vedeu
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module Vedeu
|
|
4
|
+
|
|
5
|
+
module Generator
|
|
6
|
+
|
|
7
|
+
class HelpersTestClass
|
|
8
|
+
|
|
9
|
+
include Vedeu::Generator::Helpers
|
|
10
|
+
|
|
11
|
+
def initialize(name)
|
|
12
|
+
@name = name
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end # HelpersTestClass
|
|
16
|
+
|
|
17
|
+
describe Helpers do
|
|
18
|
+
|
|
19
|
+
let(:described) { Vedeu::Generator::Helpers }
|
|
20
|
+
let(:instance) { Vedeu::Generator::HelpersTestClass.new(_name) }
|
|
21
|
+
let(:_name) { 'my_first_app' }
|
|
22
|
+
|
|
23
|
+
# describe '#app_name' do
|
|
24
|
+
# subject { instance.app_name }
|
|
25
|
+
|
|
26
|
+
# it { subject.must_equal('MyFirstApp') }
|
|
27
|
+
# end
|
|
28
|
+
|
|
29
|
+
describe '#app_name_as_snake_case' do
|
|
30
|
+
let(:_name) { 'MyFirstApp' }
|
|
31
|
+
|
|
32
|
+
subject { instance.app_name_as_snake_case(_name) }
|
|
33
|
+
|
|
34
|
+
it { subject.must_equal('my_first_app') }
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
describe '#make_file' do
|
|
38
|
+
let(:source) {}
|
|
39
|
+
let(:destination) {}
|
|
40
|
+
|
|
41
|
+
subject { instance.make_file(source, destination) }
|
|
42
|
+
end
|
|
43
|
+
|
|
44
|
+
describe '#name' do
|
|
45
|
+
let(:_name) { 'My_First_APP' }
|
|
46
|
+
|
|
47
|
+
subject { instance.name }
|
|
48
|
+
|
|
49
|
+
it { subject.must_be_instance_of(String) }
|
|
50
|
+
|
|
51
|
+
it { subject.must_equal('my_first_app') }
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
describe '#name_as_class' do
|
|
55
|
+
subject { instance.name_as_class }
|
|
56
|
+
|
|
57
|
+
it { subject.must_be_instance_of(String) }
|
|
58
|
+
|
|
59
|
+
it { subject.must_equal('MyFirstApp') }
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
describe '#parse_file' do
|
|
63
|
+
let(:source) {}
|
|
64
|
+
|
|
65
|
+
subject { instance.parse_file(source) }
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
describe '#source' do
|
|
69
|
+
subject { instance.source }
|
|
70
|
+
|
|
71
|
+
it { subject.must_be_instance_of(String) }
|
|
72
|
+
|
|
73
|
+
it { subject.must_match('vedeu/generator/templates/application/.') }
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
end # Helpers
|
|
77
|
+
|
|
78
|
+
end # Generator
|
|
79
|
+
|
|
80
|
+
end # Vedeu
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
require 'test_helper'
|
|
2
|
+
|
|
3
|
+
module Vedeu
|
|
4
|
+
|
|
5
|
+
module Generator
|
|
6
|
+
|
|
7
|
+
describe View do
|
|
8
|
+
|
|
9
|
+
let(:described) { Vedeu::Generator::View }
|
|
10
|
+
let(:instance) { described.new(_name) }
|
|
11
|
+
let(:_name) { 'my_first_view' }
|
|
12
|
+
|
|
13
|
+
before do
|
|
14
|
+
FileUtils.stubs(:cp_r)
|
|
15
|
+
FileUtils.stubs(:mkdir)
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
describe '#initialize' do
|
|
19
|
+
it { instance.must_be_instance_of(described) }
|
|
20
|
+
it { instance.instance_variable_get('@name').must_equal(_name) }
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
describe '.generate' do
|
|
24
|
+
subject { described.generate(_name) }
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
describe '#generate' do
|
|
28
|
+
it { instance.must_respond_to(:generate) }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
end # View
|
|
32
|
+
|
|
33
|
+
end # Generator
|
|
34
|
+
|
|
35
|
+
end # Vedeu
|
|
@@ -105,6 +105,8 @@ module Vedeu
|
|
|
105
105
|
describe '#north' do
|
|
106
106
|
subject { instance.north(offset) }
|
|
107
107
|
|
|
108
|
+
it { subject.must_be_instance_of(Fixnum) }
|
|
109
|
+
|
|
108
110
|
context 'with the default offset' do
|
|
109
111
|
it { subject.must_equal(3) }
|
|
110
112
|
end
|
|
@@ -125,6 +127,8 @@ module Vedeu
|
|
|
125
127
|
describe '#east' do
|
|
126
128
|
subject { instance.east(offset) }
|
|
127
129
|
|
|
130
|
+
it { subject.must_be_instance_of(Fixnum) }
|
|
131
|
+
|
|
128
132
|
context 'with the default offset' do
|
|
129
133
|
it { subject.must_equal(22) }
|
|
130
134
|
end
|
|
@@ -145,6 +149,8 @@ module Vedeu
|
|
|
145
149
|
describe '#south' do
|
|
146
150
|
subject { instance.south(offset) }
|
|
147
151
|
|
|
152
|
+
it { subject.must_be_instance_of(Fixnum) }
|
|
153
|
+
|
|
148
154
|
context 'with the default offset' do
|
|
149
155
|
it { subject.must_equal(10) }
|
|
150
156
|
end
|
|
@@ -165,6 +171,8 @@ module Vedeu
|
|
|
165
171
|
describe '#west' do
|
|
166
172
|
subject { instance.west(offset) }
|
|
167
173
|
|
|
174
|
+
it { subject.must_be_instance_of(Fixnum) }
|
|
175
|
+
|
|
168
176
|
context 'with the default offset' do
|
|
169
177
|
it { subject.must_equal(5) }
|
|
170
178
|
end
|
|
@@ -48,6 +48,7 @@ module Vedeu
|
|
|
48
48
|
subject { described.clear(interface, options) }
|
|
49
49
|
|
|
50
50
|
context 'when the interface is visible' do
|
|
51
|
+
# it { skip }
|
|
51
52
|
# it { subject.must_be_instance_of(Array) }
|
|
52
53
|
end
|
|
53
54
|
|
|
@@ -67,6 +68,7 @@ module Vedeu
|
|
|
67
68
|
it { subject.flatten.size.must_equal(9) }
|
|
68
69
|
|
|
69
70
|
context 'when the interface is visible' do
|
|
71
|
+
# it { skip }
|
|
70
72
|
# it { subject.must_be_instance_of(Array) }
|
|
71
73
|
end
|
|
72
74
|
|
|
@@ -81,6 +83,7 @@ module Vedeu
|
|
|
81
83
|
subject { instance.write }
|
|
82
84
|
|
|
83
85
|
context 'when the interface is visible' do
|
|
86
|
+
# it { skip }
|
|
84
87
|
# it { subject.must_be_instance_of(Array) }
|
|
85
88
|
end
|
|
86
89
|
|
|
@@ -13,19 +13,24 @@ module Vedeu
|
|
|
13
13
|
subject { described.log(message: _message, force: force, type: type) }
|
|
14
14
|
|
|
15
15
|
context 'when logging has been forced' do
|
|
16
|
+
# it { skip }
|
|
16
17
|
end
|
|
17
18
|
|
|
18
19
|
context 'when logging has not been forced' do
|
|
19
20
|
context 'when the configuration requests logging' do
|
|
21
|
+
# it { skip }
|
|
20
22
|
end
|
|
21
23
|
|
|
22
24
|
context 'when the configuration does not request logging' do
|
|
25
|
+
# it { skip }
|
|
23
26
|
end
|
|
24
27
|
end
|
|
25
28
|
end
|
|
26
29
|
|
|
27
30
|
describe '.logger' do
|
|
28
31
|
subject { described.logger }
|
|
32
|
+
|
|
33
|
+
# it { skip }
|
|
29
34
|
end
|
|
30
35
|
|
|
31
36
|
end # Log
|