vedeu 0.4.35 → 0.4.36

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +3 -0
  3. data/Dockerfile +56 -35
  4. data/bin/vedeu +54 -13
  5. data/docs/applications.md +92 -0
  6. data/features/cli_vedeu.feature +5 -0
  7. data/features/start_stop.feature +1 -1
  8. data/features/step_definitions/vedeu_steps.rb +0 -0
  9. data/features/support/env.rb +3 -2
  10. data/lib/vedeu.rb +1 -0
  11. data/lib/vedeu/all.rb +6 -0
  12. data/lib/vedeu/application/all.rb +2 -0
  13. data/lib/vedeu/application/application_controller.rb +7 -0
  14. data/lib/vedeu/application/application_helper.rb +7 -0
  15. data/lib/vedeu/bootstrap.rb +73 -0
  16. data/lib/vedeu/distributed/templates/default_configuration.vedeu +7 -14
  17. data/lib/vedeu/generator/all.rb +13 -0
  18. data/lib/vedeu/generator/application.rb +108 -0
  19. data/lib/vedeu/generator/helpers.rb +55 -0
  20. data/lib/vedeu/generator/templates/application/Gemfile +3 -0
  21. data/lib/vedeu/generator/templates/application/app/controllers/application_controller.erb +7 -0
  22. data/lib/vedeu/generator/templates/application/app/controllers/name.erb +10 -0
  23. data/lib/vedeu/generator/templates/application/app/helpers/application_helper.erb +9 -0
  24. data/lib/vedeu/generator/templates/application/app/helpers/name.erb +9 -0
  25. data/lib/vedeu/generator/templates/application/app/models/keymaps/_global_.rb +2 -0
  26. data/lib/vedeu/generator/templates/application/app/models/keymaps/_system_.rb +2 -0
  27. data/lib/vedeu/generator/templates/application/app/views/interfaces/name.erb +44 -0
  28. data/lib/vedeu/generator/templates/application/app/views/name.erb +0 -0
  29. data/lib/vedeu/generator/templates/application/app/views/templates/name.erb +0 -0
  30. data/lib/vedeu/generator/templates/application/application.rb +9 -0
  31. data/lib/vedeu/generator/templates/application/bin/name +7 -0
  32. data/lib/vedeu/generator/templates/application/config/app_name.erb +1 -0
  33. data/lib/vedeu/generator/templates/application/config/configuration.rb +22 -0
  34. data/lib/vedeu/generator/templates/application/lib/.gitkeep +0 -0
  35. data/lib/vedeu/generator/templates/application/test/.gitkeep +0 -0
  36. data/lib/vedeu/generator/templates/application/vendor/.gitkeep +0 -0
  37. data/lib/vedeu/generator/view.rb +71 -0
  38. data/lib/vedeu/geometry/area.rb +21 -21
  39. data/lib/vedeu/main_loop.rb +0 -1
  40. data/lib/vedeu/output/esc.rb +5 -4
  41. data/lib/vedeu/output/refresh.rb +9 -3
  42. data/lib/vedeu/output/view_helpers/all.rb +0 -2
  43. data/lib/vedeu/support/log.rb +1 -1
  44. data/lib/vedeu/support/template.rb +1 -1
  45. data/lib/vedeu/support/terminal.rb +10 -2
  46. data/lib/vedeu/tasks/application.rake +28 -0
  47. data/lib/vedeu/tasks/vedeu.rake +3 -0
  48. data/lib/vedeu/templating/directive.rb +1 -8
  49. data/lib/vedeu/traps.rb +2 -2
  50. data/lib/vedeu/version.rb +1 -1
  51. data/test/lib/vedeu/application/application_controller_test.rb +12 -0
  52. data/test/lib/vedeu/application/application_helper_test.rb +18 -0
  53. data/test/lib/vedeu/bootstrap_test.rb +30 -0
  54. data/test/lib/vedeu/buffers/buffer_test.rb +7 -0
  55. data/test/lib/vedeu/buffers/display_buffer_test.rb +2 -0
  56. data/test/lib/vedeu/configuration/api_test.rb +6 -0
  57. data/test/lib/vedeu/cursor/move_test.rb +7 -0
  58. data/test/lib/vedeu/distributed/client_test.rb +4 -0
  59. data/test/lib/vedeu/distributed/server_test.rb +9 -0
  60. data/test/lib/vedeu/dsl/use_test.rb +4 -0
  61. data/test/lib/vedeu/generator/application_test.rb +55 -0
  62. data/test/lib/vedeu/generator/helpers_test.rb +80 -0
  63. data/test/lib/vedeu/generator/view_test.rb +35 -0
  64. data/test/lib/vedeu/geometry/area_test.rb +8 -0
  65. data/test/lib/vedeu/launcher_test.rb +2 -0
  66. data/test/lib/vedeu/main_loop_test.rb +2 -0
  67. data/test/lib/vedeu/null/interface_test.rb +1 -0
  68. data/test/lib/vedeu/output/clear_test.rb +3 -0
  69. data/test/lib/vedeu/output/refresh_test.rb +1 -0
  70. data/test/lib/vedeu/output/renderers/file_test.rb +1 -0
  71. data/test/lib/vedeu/repositories/repositories/events_repository_test.rb +2 -0
  72. data/test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb +3 -0
  73. data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +2 -0
  74. data/test/lib/vedeu/repositories/repositories/menus_test.rb +2 -0
  75. data/test/lib/vedeu/repositories/repository_test.rb +1 -0
  76. data/test/lib/vedeu/support/log_test.rb +5 -0
  77. data/test/lib/vedeu/support/terminal_test.rb +1 -0
  78. data/test/lib/vedeu/traps_test.rb +1 -1
  79. data/test/lib/vedeu_test.rb +1 -0
  80. data/vedeu.gemspec +7 -4
  81. 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
@@ -28,9 +28,11 @@ module Vedeu
28
28
  subject { instance.debug_execute! }
29
29
 
30
30
  context 'when debugging is enabled in the configuration' do
31
+ # it { skip }
31
32
  end
32
33
 
33
34
  context 'when debugging is not enabled in the configuration' do
35
+ # it { skip }
34
36
  end
35
37
  end
36
38
 
@@ -21,9 +21,11 @@ module Vedeu
21
21
 
22
22
  context 'when the application has started' do
23
23
  context 'when the loop is running' do
24
+ # it { skip }
24
25
  end
25
26
 
26
27
  context 'when the loop is not running' do
28
+ # it { skip }
27
29
  end
28
30
  end
29
31
  end
@@ -36,6 +36,7 @@ module Vedeu
36
36
  describe '#visible=' do
37
37
  subject { instance.visible=(:irrelevant) }
38
38
 
39
+ # it { skip }
39
40
  # it { subject.must_be_instance_of(FalseClass) }
40
41
  end
41
42
 
@@ -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
 
@@ -28,6 +28,7 @@ module Vedeu
28
28
  end
29
29
 
30
30
  context 'when there are registered interfaces' do
31
+ # it { skip }
31
32
  end
32
33
  end
33
34
 
@@ -31,6 +31,7 @@ module Vedeu
31
31
 
32
32
  it { subject.must_be_instance_of(String) }
33
33
 
34
+ # it { skip }
34
35
  # context 'when the timestamp option is true' do
35
36
  # before { Time.stubs(:now).returns(_time) }
36
37
 
@@ -6,6 +6,8 @@ module Vedeu
6
6
 
7
7
  let(:described) { Vedeu::EventsRepository }
8
8
 
9
+ # it { skip }
10
+
9
11
  end # EventsRepository
10
12
 
11
13
  end # Vedeu
@@ -3,6 +3,9 @@ require 'test_helper'
3
3
  module Vedeu
4
4
 
5
5
  describe InterfacesRepository do
6
+
7
+ # it { skip }
8
+
6
9
  end # InterfacesRepository
7
10
 
8
11
  end # Vedeu
@@ -6,6 +6,8 @@ module Vedeu
6
6
 
7
7
  let(:described) { Vedeu::Keymaps }
8
8
 
9
+ # it { skip }
10
+
9
11
  end # Keymaps
10
12
 
11
13
  end # Vedeu
@@ -6,6 +6,8 @@ module Vedeu
6
6
 
7
7
  let(:described) { Vedeu::Menus }
8
8
 
9
+ # it { skip }
10
+
9
11
  end # Menus
10
12
 
11
13
  end # Vedeu
@@ -97,6 +97,7 @@ module Vedeu
97
97
  describe '#current' do
98
98
  subject { instance.current }
99
99
 
100
+ # it { skip }
100
101
  # it { subject.must_equal('') }
101
102
  end
102
103
 
@@ -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