vedeu 0.6.29 → 0.6.30

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -0
  3. data/Guardfile +6 -5
  4. data/README.md +50 -4
  5. data/Rakefile +16 -4
  6. data/docs/dsl.md +3 -3
  7. data/lib/vedeu/all.rb +6 -8
  8. data/lib/vedeu/bindings/all.rb +43 -13
  9. data/lib/vedeu/borders/border.rb +26 -3
  10. data/lib/vedeu/borders/refresh.rb +5 -0
  11. data/lib/vedeu/buffers/refresh.rb +10 -0
  12. data/lib/vedeu/cursors/cursor.rb +59 -0
  13. data/lib/vedeu/cursors/refresh.rb +5 -0
  14. data/lib/vedeu/distributed/server.rb +12 -0
  15. data/lib/vedeu/distributed/subprocess.rb +7 -2
  16. data/lib/vedeu/editor/editor.rb +5 -0
  17. data/lib/vedeu/editor/repository.rb +41 -0
  18. data/lib/vedeu/geometry/geometry.rb +19 -8
  19. data/lib/vedeu/geometry/repository.rb +25 -0
  20. data/lib/vedeu/groups/clear.rb +3 -0
  21. data/lib/vedeu/groups/group.rb +9 -0
  22. data/lib/vedeu/groups/refresh.rb +5 -0
  23. data/lib/vedeu/input/dsl.rb +4 -4
  24. data/lib/vedeu/input/mapper.rb +3 -0
  25. data/lib/vedeu/interfaces/all.rb +1 -0
  26. data/lib/vedeu/interfaces/dsl.rb +1 -1
  27. data/lib/vedeu/interfaces/interface.rb +12 -0
  28. data/lib/vedeu/logging/log.rb +3 -0
  29. data/lib/vedeu/menus/repository.rb +40 -0
  30. data/lib/vedeu/models/focus.rb +9 -0
  31. data/lib/vedeu/output/clear/interface.rb +9 -1
  32. data/lib/vedeu/output/refresh/refresh.rb +3 -0
  33. data/lib/vedeu/repositories/model.rb +1 -9
  34. data/lib/vedeu/runtime/application.rb +7 -0
  35. data/lib/vedeu/runtime/flags.rb +3 -0
  36. data/lib/vedeu/runtime/launcher.rb +2 -0
  37. data/lib/vedeu/runtime/router.rb +7 -0
  38. data/lib/vedeu/terminal/buffer.rb +11 -0
  39. data/lib/vedeu/terminal/terminal.rb +3 -0
  40. data/lib/vedeu/version.rb +1 -1
  41. data/test/lib/vedeu/bindings/all_test.rb +19 -0
  42. data/test/lib/vedeu/borders/border_test.rb +0 -4
  43. data/test/lib/vedeu/borders/refresh_test.rb +4 -0
  44. data/test/lib/vedeu/buffers/refresh_test.rb +5 -0
  45. data/test/lib/vedeu/cursors/cursor_test.rb +21 -0
  46. data/test/lib/vedeu/cursors/refresh_test.rb +4 -0
  47. data/test/lib/vedeu/distributed/server_test.rb +7 -0
  48. data/test/lib/vedeu/editor/editor_test.rb +4 -0
  49. data/test/lib/vedeu/editor/repository_test.rb +12 -0
  50. data/test/lib/vedeu/events/aliases_test.rb +0 -1
  51. data/test/lib/vedeu/geometry/geometry_test.rb +0 -3
  52. data/test/lib/vedeu/geometry/repository_test.rb +13 -0
  53. data/test/lib/vedeu/groups/clear_test.rb +4 -0
  54. data/test/lib/vedeu/groups/group_test.rb +6 -0
  55. data/test/lib/vedeu/groups/refresh_test.rb +4 -0
  56. data/test/lib/vedeu/input/dsl_test.rb +3 -3
  57. data/test/lib/vedeu/input/mapper_test.rb +4 -0
  58. data/test/lib/vedeu/interfaces/interface_test.rb +9 -0
  59. data/test/lib/vedeu/logging/log_test.rb +4 -0
  60. data/test/lib/vedeu/menus/repository_test.rb +13 -0
  61. data/test/lib/vedeu/models/focus_test.rb +6 -0
  62. data/test/lib/vedeu/output/clear/interface_test.rb +5 -0
  63. data/test/lib/vedeu/output/refresh/refresh_test.rb +4 -0
  64. data/test/lib/vedeu/repositories/model_test.rb +0 -15
  65. data/test/lib/vedeu/runtime/application_test.rb +5 -0
  66. data/test/lib/vedeu/runtime/flags_test.rb +4 -0
  67. data/test/lib/vedeu/runtime/router_test.rb +26 -0
  68. data/test/lib/vedeu/terminal/buffer_test.rb +8 -0
  69. data/test/lib/vedeu/terminal/terminal_test.rb +4 -0
  70. data/test/support/examples/material_colours_app.rb +24 -4
  71. data/test/test_helper.rb +23 -23
  72. metadata +4 -40
  73. data/lib/vedeu/bindings/application.rb +0 -41
  74. data/lib/vedeu/bindings/bindings.rb +0 -46
  75. data/lib/vedeu/bindings/cursors.rb +0 -101
  76. data/lib/vedeu/bindings/document.rb +0 -97
  77. data/lib/vedeu/bindings/drb.rb +0 -78
  78. data/lib/vedeu/bindings/focus.rb +0 -46
  79. data/lib/vedeu/bindings/menus.rb +0 -99
  80. data/lib/vedeu/bindings/movement.rb +0 -51
  81. data/lib/vedeu/bindings/refresh.rb +0 -74
  82. data/lib/vedeu/bindings/system.rb +0 -81
  83. data/lib/vedeu/bindings/view.rb +0 -50
  84. data/lib/vedeu/bindings/visibility.rb +0 -118
  85. data/test/lib/vedeu/bindings/application_test.rb +0 -39
  86. data/test/lib/vedeu/bindings/bindings_test.rb +0 -109
  87. data/test/lib/vedeu/bindings/cursors_test.rb +0 -24
  88. data/test/lib/vedeu/bindings/document_test.rb +0 -25
  89. data/test/lib/vedeu/bindings/drb_test.rb +0 -27
  90. data/test/lib/vedeu/bindings/focus_test.rb +0 -19
  91. data/test/lib/vedeu/bindings/menus_test.rb +0 -26
  92. data/test/lib/vedeu/bindings/movement_test.rb +0 -24
  93. data/test/lib/vedeu/bindings/refresh_test.rb +0 -22
  94. data/test/lib/vedeu/bindings/system_test.rb +0 -24
  95. data/test/lib/vedeu/bindings/view_test.rb +0 -19
  96. data/test/lib/vedeu/bindings/visibility_test.rb +0 -52
  97. data/test/support/all_seeds.sh +0 -9
@@ -0,0 +1,19 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Bindings
6
+
7
+ describe 'Bindings' do
8
+ before do
9
+ Vedeu.stubs(:log)
10
+ end
11
+
12
+ it { Vedeu.bound?(:_drb_input_).must_equal(true) }
13
+ it { Vedeu.bound?(:_cleanup_).must_equal(true) }
14
+ it { Vedeu.bound?(:_command_).must_equal(true) }
15
+ end
16
+
17
+ end # Bindings
18
+
19
+ end # Vedeu
@@ -46,10 +46,6 @@ module Vedeu
46
46
 
47
47
  describe '#initialize' do
48
48
  it { instance.must_be_instance_of(described) }
49
- it do
50
- instance.instance_variable_get('@attributes').
51
- must_equal(attributes)
52
- end
53
49
  end
54
50
 
55
51
  describe 'accessors' do
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_refresh_border_).must_equal(true) }
7
+ end
8
+
5
9
  module Borders
6
10
 
7
11
  describe Refresh do
@@ -2,6 +2,11 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_refresh_view_).must_equal(true) }
7
+ it { Vedeu.bound?(:_refresh_view_content_).must_equal(true) }
8
+ end
9
+
5
10
  module Buffers
6
11
 
7
12
  describe Refresh do
@@ -2,6 +2,17 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_cursor_down_).must_equal(true) }
7
+ it { Vedeu.bound?(:_cursor_left_).must_equal(true) }
8
+ it { Vedeu.bound?(:_cursor_origin_).must_equal(true) }
9
+ it { Vedeu.bound?(:_cursor_position_).must_equal(true) }
10
+ it { Vedeu.bound?(:_cursor_reposition_).must_equal(true) }
11
+ # it { Vedeu.bound?(:_cursor_reset_).must_equal(true) }
12
+ it { Vedeu.bound?(:_cursor_right_).must_equal(true) }
13
+ it { Vedeu.bound?(:_cursor_up_).must_equal(true) }
14
+ end
15
+
5
16
  module Cursors
6
17
 
7
18
  describe Cursor do
@@ -402,4 +413,14 @@ module Vedeu
402
413
 
403
414
  end # Cursors
404
415
 
416
+ describe 'Bindings' do
417
+ it { Vedeu.bound?(:_hide_cursor_).must_equal(true) }
418
+ # it { Vedeu.bound?(:_cursor_hide_).must_equal(true) }
419
+
420
+ it { Vedeu.bound?(:_show_cursor_).must_equal(true) }
421
+ # it { Vedeu.bound?(:_cursor_show_).must_equal(true) }
422
+
423
+ it { Vedeu.bound?(:_toggle_cursor_).must_equal(true) }
424
+ end
425
+
405
426
  end # Vedeu
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_refresh_cursor_).must_equal(true) }
7
+ end
8
+
5
9
  module Cursors
6
10
 
7
11
  describe Refresh do
@@ -2,6 +2,13 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_drb_restart_).must_equal(true) }
7
+ it { Vedeu.bound?(:_drb_start_).must_equal(true) }
8
+ it { Vedeu.bound?(:_drb_status_).must_equal(true) }
9
+ it { Vedeu.bound?(:_drb_stop_).must_equal(true) }
10
+ end
11
+
5
12
  module Distributed
6
13
 
7
14
  describe Server do
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_editor_).must_equal(true) }
7
+ end
8
+
5
9
  module Editor
6
10
 
7
11
  describe Editor do
@@ -2,6 +2,18 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_editor_execute_).must_equal(true) }
7
+ it { Vedeu.bound?(:_editor_delete_character_).must_equal(true) }
8
+ it { Vedeu.bound?(:_editor_delete_line_).must_equal(true) }
9
+ it { Vedeu.bound?(:_editor_down_).must_equal(true) }
10
+ it { Vedeu.bound?(:_editor_insert_character_).must_equal(true) }
11
+ it { Vedeu.bound?(:_editor_insert_line_).must_equal(true) }
12
+ it { Vedeu.bound?(:_editor_left_).must_equal(true) }
13
+ it { Vedeu.bound?(:_editor_right_).must_equal(true) }
14
+ it { Vedeu.bound?(:_editor_up_).must_equal(true) }
15
+ end
16
+
5
17
  module Editor
6
18
 
7
19
  describe Repository do
@@ -9,7 +9,6 @@ module Vedeu
9
9
  let(:described) { Vedeu::Events::Aliases }
10
10
 
11
11
  before { described.reset }
12
- after { Vedeu::Bindings.setup_aliases! }
13
12
 
14
13
  describe '.add' do
15
14
  let(:alias_name) { :alias_test }
@@ -38,9 +38,6 @@ module Vedeu
38
38
 
39
39
  describe '#initialize' do
40
40
  it { instance.must_be_instance_of(described) }
41
- it {
42
- instance.instance_variable_get('@attributes').must_equal(attributes)
43
- }
44
41
  it { instance.instance_variable_get('@centred').must_equal(centred) }
45
42
  it { instance.instance_variable_get('@client').must_equal(client) }
46
43
  it { instance.instance_variable_get('@height').must_equal(height) }
@@ -2,6 +2,19 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_maximise_).must_equal(true) }
7
+ it { Vedeu.bound?(:_unmaximise_).must_equal(true) }
8
+ # it { Vedeu.bound?(:_geometry_down_).must_equal(true) }
9
+ # it { Vedeu.bound?(:_geometry_left_).must_equal(true) }
10
+ # it { Vedeu.bound?(:_geometry_right_).must_equal(true) }
11
+ # it { Vedeu.bound?(:_geometry_up_).must_equal(true) }
12
+ it { Vedeu.bound?(:_view_down_).must_equal(true) }
13
+ it { Vedeu.bound?(:_view_left_).must_equal(true) }
14
+ it { Vedeu.bound?(:_view_right_).must_equal(true) }
15
+ it { Vedeu.bound?(:_view_up_).must_equal(true) }
16
+ end
17
+
5
18
  module Geometry
6
19
 
7
20
  describe Repository do
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_clear_group_).must_equal(true) }
7
+ end
8
+
5
9
  module Groups
6
10
 
7
11
  describe Clear do
@@ -2,6 +2,12 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_hide_group_).must_equal(true) }
7
+ it { Vedeu.bound?(:_show_group_).must_equal(true) }
8
+ it { Vedeu.bound?(:_toggle_group_).must_equal(true) }
9
+ end
10
+
5
11
  module Groups
6
12
 
7
13
  describe Group do
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_refresh_group_).must_equal(true) }
7
+ end
8
+
5
9
  module Groups
6
10
 
7
11
  describe Refresh do
@@ -2,11 +2,11 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
- module Keymaps
5
+ module Input
6
6
 
7
7
  describe DSL do
8
8
 
9
- let(:described) { Vedeu::Keymaps::DSL }
9
+ let(:described) { Vedeu::Input::DSL }
10
10
  let(:instance) { described.new(model) }
11
11
  let(:model) { Vedeu::Input::Keymap.new(name: '_test_') }
12
12
 
@@ -66,6 +66,6 @@ module Vedeu
66
66
 
67
67
  end # DSL
68
68
 
69
- end # Keymaps
69
+ end # Input
70
70
 
71
71
  end # Vedeu
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_keypress_).must_equal(true) }
7
+ end
8
+
5
9
  module Input
6
10
 
7
11
  describe Mapper do
@@ -95,4 +95,13 @@ module Vedeu
95
95
 
96
96
  end # Interfaces
97
97
 
98
+ describe 'Bindings' do
99
+ it { Vedeu.bound?(:_hide_interface_).must_equal(true) }
100
+ it { Vedeu.bound?(:_show_interface_).must_equal(true) }
101
+ it { Vedeu.bound?(:_toggle_interface_).must_equal(true) }
102
+ # it { Vedeu.bound?(:_hide_view_).must_equal(true) }
103
+ # it { Vedeu.bound?(:_show_view_).must_equal(true) }
104
+ # it { Vedeu.bound?(:_toggle_view_).must_equal(true) }
105
+ end
106
+
98
107
  end # Vedeu
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_log_).must_equal(true) }
7
+ end
8
+
5
9
  module Logging
6
10
 
7
11
  describe Log do
@@ -2,6 +2,19 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_menu_bottom_).must_equal(true) }
7
+ it { Vedeu.bound?(:_menu_current_).must_equal(true) }
8
+ it { Vedeu.bound?(:_menu_deselect_).must_equal(true) }
9
+ it { Vedeu.bound?(:_menu_items_).must_equal(true) }
10
+ it { Vedeu.bound?(:_menu_next_).must_equal(true) }
11
+ it { Vedeu.bound?(:_menu_prev_).must_equal(true) }
12
+ it { Vedeu.bound?(:_menu_selected_).must_equal(true) }
13
+ it { Vedeu.bound?(:_menu_select_).must_equal(true) }
14
+ it { Vedeu.bound?(:_menu_top_).must_equal(true) }
15
+ it { Vedeu.bound?(:_menu_view_).must_equal(true) }
16
+ end
17
+
5
18
  module Menus
6
19
 
7
20
  describe Repository do
@@ -2,6 +2,12 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_focus_by_name_).must_equal(true) }
7
+ it { Vedeu.bound?(:_focus_next_).must_equal(true) }
8
+ it { Vedeu.bound?(:_focus_prev_).must_equal(true) }
9
+ end
10
+
5
11
  module Models
6
12
 
7
13
  describe Focus do
@@ -2,6 +2,11 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_clear_view_).must_equal(true) }
7
+ it { Vedeu.bound?(:_clear_view_content_).must_equal(true) }
8
+ end
9
+
5
10
  module Clear
6
11
 
7
12
  describe Interface do
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_refresh_).must_equal(true) }
7
+ end
8
+
5
9
  module Output
6
10
 
7
11
  describe Refresh do
@@ -28,21 +28,6 @@ module Vedeu
28
28
  # it { skip }
29
29
  end
30
30
 
31
- describe '.by_name' do
32
- let(:_name) {}
33
-
34
- subject { described.by_name(_name) }
35
-
36
- context 'when the model has no repository set' do
37
- it { subject.must_be_instance_of(NilClass) }
38
- end
39
-
40
- context 'when the model has a repository set' do
41
- # @todo Add more tests.
42
- # it { skip }
43
- end
44
- end
45
-
46
31
  describe '.child' do
47
32
  let(:klass) {}
48
33
 
@@ -2,6 +2,11 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_exit_).must_equal(true) }
7
+ it { Vedeu.bound?(:_mode_switch_).must_equal(true) }
8
+ end
9
+
5
10
  module Runtime
6
11
 
7
12
  describe Application do
@@ -2,6 +2,10 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_initialize_).must_equal(true) }
7
+ end
8
+
5
9
  module Runtime
6
10
 
7
11
  describe Flags do
@@ -13,6 +13,11 @@ module Vedeu
13
13
 
14
14
  end # SomeController
15
15
 
16
+ describe 'Bindings' do
17
+ it { Vedeu.bound?(:_goto_).must_equal(true) }
18
+ # it { Vedeu.bound?(:_action_).must_equal(true) }
19
+ end
20
+
16
21
  module Runtime
17
22
 
18
23
  describe Router do
@@ -119,6 +124,27 @@ module Vedeu
119
124
  end
120
125
  end
121
126
 
127
+ # describe '.goto!' do
128
+ # let(:controller) { :some_controller }
129
+ # let(:action) { :show_basket }
130
+ # let(:args) {
131
+ # {
132
+ # customer_id: 3,
133
+ # product_id: 16,
134
+ # }
135
+ # }
136
+
137
+ # before { Vedeu::Runtime::Router.stubs(:goto) }
138
+
139
+ # subject { Vedeu.trigger(:_goto_, controller, action, **args) }
140
+
141
+ # it {
142
+ # Vedeu::Runtime::Router.expects(:goto)
143
+ # .with(:some_controller, :show_basket, args)
144
+ # subject
145
+ # }
146
+ # end
147
+
122
148
  describe '.goto' do
123
149
  let(:controller) { :some_controller }
124
150
  let(:action) { :some_action }
@@ -2,6 +2,12 @@ require 'test_helper'
2
2
 
3
3
  module Vedeu
4
4
 
5
+ describe 'Bindings' do
6
+ it { Vedeu.bound?(:_clear_).must_equal(true) }
7
+ it { Vedeu.bound?(:_drb_retrieve_output_).must_equal(true) }
8
+ it { Vedeu.bound?(:_drb_store_output_).must_equal(true) }
9
+ end
10
+
5
11
  module Terminal
6
12
 
7
13
  describe Buffer do
@@ -86,4 +92,6 @@ module Vedeu
86
92
 
87
93
  end # Terminal
88
94
 
95
+
96
+
89
97
  end # Vedeu