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
@@ -1,118 +0,0 @@
1
- module Vedeu
2
-
3
- module Bindings
4
-
5
- # System events relating to the visibility of cursors or
6
- # interfaces.
7
- #
8
- module Visibility
9
-
10
- extend self
11
-
12
- # Setup events relating to visibility. This method is called by
13
- # Vedeu.
14
- #
15
- # @return [TrueClass]
16
- def setup!
17
- clear!
18
- clear_group!
19
- clear_view!
20
- clear_view_content!
21
- hide_cursor!
22
- hide_group!
23
- hide_interface!
24
- show_cursor!
25
- show_group!
26
- show_interface!
27
- toggle_cursor!
28
- toggle_group!
29
- toggle_interface!
30
- end
31
-
32
- # @return [TrueClass]
33
- def setup_aliases!
34
- Vedeu.bind_alias(:_cursor_hide_, :_hide_cursor_)
35
- Vedeu.bind_alias(:_cursor_show_, :_show_cursor_)
36
- Vedeu.bind_alias(:_hide_view_, :_hide_interface_)
37
- Vedeu.bind_alias(:_show_view_, :_show_interface_)
38
- Vedeu.bind_alias(:_toggle_view_, :_toggle_interface_)
39
- end
40
-
41
- private
42
-
43
- # :nocov:
44
-
45
- # See {file:docs/events/visibility.md#\_clear_}
46
- def clear!
47
- Vedeu.bind(:_clear_) { Vedeu.clear }
48
- end
49
-
50
- # See {file:docs/events/visibility.md#\_clear_group_}
51
- def clear_group!
52
- Vedeu.bind(:_clear_group_) { |name| Vedeu.clear_by_group(name) }
53
- end
54
-
55
- # See {file:docs/events/visibility.md#\_clear_view_}
56
- def clear_view!
57
- Vedeu.bind(:_clear_view_) { |name| Vedeu.clear_by_name(name) }
58
- end
59
-
60
- # See {file:docs/events/visibility.md#\_clear_view_content_}
61
- def clear_view_content!
62
- Vedeu.bind(:_clear_view_content_) do |name|
63
- Vedeu.clear_content_by_name(name)
64
- end
65
- end
66
-
67
- # See {file:docs/events/visibility.md#\_hide_cursor_}
68
- def hide_cursor!
69
- Vedeu.bind(:_hide_cursor_) { |name| Vedeu.hide_cursor(name) }
70
- end
71
-
72
- # See {file:docs/events/visibility.md#\_hide_group_}
73
- def hide_group!
74
- Vedeu.bind(:_hide_group_) { |name| Vedeu.hide_group(name) }
75
- end
76
-
77
- # See {file:docs/events/visibility.md#\_hide_interface_}
78
- def hide_interface!
79
- Vedeu.bind(:_hide_interface_) { |name| Vedeu.hide_interface(name) }
80
- end
81
-
82
- # See {file:docs/events/visibility.md#\_show_cursor_}
83
- def show_cursor!
84
- Vedeu.bind(:_show_cursor_) { |name| Vedeu.show_cursor(name) }
85
- end
86
-
87
- # See {file:docs/events/visibility.md#\_show_group_}
88
- def show_group!
89
- Vedeu.bind(:_show_group_) { |name| Vedeu.show_group(name) }
90
- end
91
-
92
- # See {file:docs/events/visibility.md#\_show_interface_}
93
- def show_interface!
94
- Vedeu.bind(:_show_interface_) { |name| Vedeu.show_interface(name) }
95
- end
96
-
97
- # See {file:docs/events/visibility.md#\_toggle_cursor_}
98
- def toggle_cursor!
99
- Vedeu.bind(:_toggle_cursor_) { |name| Vedeu.toggle_cursor(name) }
100
- end
101
-
102
- # See {file:docs/events/visibility.md#\_toggle_group_}
103
- def toggle_group!
104
- Vedeu.bind(:_toggle_group_) { |name| Vedeu.toggle_group(name) }
105
- end
106
-
107
- # See {file:docs/events/visibility.md#\_toggle_interface_}
108
- def toggle_interface!
109
- Vedeu.bind(:_toggle_interface_) { |name| Vedeu.toggle_interface(name) }
110
- end
111
-
112
- # :nocov:
113
-
114
- end # Visibility
115
-
116
- end # Bindings
117
-
118
- end # Vedeu
@@ -1,39 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe Application do
8
-
9
- context 'the application specific events are defined' do
10
- it { Vedeu.bound?(:_goto_).must_equal(true) }
11
- it { Vedeu.bound?(:_action_).must_equal(true) }
12
- end
13
-
14
- describe '.goto!' do
15
- let(:controller) { :some_controller }
16
- let(:action) { :show_basket }
17
- let(:args) {
18
- {
19
- customer_id: 3,
20
- product_id: 16,
21
- }
22
- }
23
-
24
- before { Vedeu::Runtime::Router.stubs(:goto) }
25
-
26
- subject { Vedeu.trigger(:_goto_, controller, action, **args) }
27
-
28
- it {
29
- Vedeu::Runtime::Router.expects(:goto)
30
- .with(:some_controller, :show_basket, args)
31
- subject
32
- }
33
- end
34
-
35
- end # Application
36
-
37
- end # Bindings
38
-
39
- end # Vedeu
@@ -1,109 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- describe Bindings do
6
-
7
- let(:described) { Vedeu::Bindings }
8
-
9
- describe '.setup!' do
10
- before do
11
- Vedeu::Events::Repository.stubs(:reset!)
12
-
13
- Vedeu::Bindings::Application.stubs(:setup!)
14
- Vedeu::Bindings::Document.stubs(:setup!)
15
- Vedeu::Bindings::DRB.stubs(:setup!)
16
- Vedeu::Bindings::Focus.stubs(:setup!)
17
- Vedeu::Bindings::Menus.stubs(:setup!)
18
- Vedeu::Bindings::Movement.stubs(:setup!)
19
- Vedeu::Bindings::Refresh.stubs(:setup!)
20
- Vedeu::Bindings::System.stubs(:setup!)
21
- Vedeu::Bindings::View.stubs(:setup!)
22
- Vedeu::Bindings::Visibility.stubs(:setup!)
23
- end
24
-
25
- subject { described.setup! }
26
-
27
- it {
28
- Vedeu::Bindings::Application.expects(:setup!)
29
- subject
30
- }
31
-
32
- it {
33
- Vedeu::Bindings::Document.expects(:setup!)
34
- subject
35
- }
36
-
37
- it {
38
- Vedeu::Bindings::DRB.expects(:setup!)
39
- subject
40
- }
41
-
42
- it {
43
- Vedeu::Bindings::Focus.expects(:setup!)
44
- subject
45
- }
46
-
47
- it {
48
- Vedeu::Bindings::Menus.expects(:setup!)
49
- subject
50
- }
51
-
52
- it {
53
- Vedeu::Bindings::Movement.expects(:setup!)
54
- subject
55
- }
56
-
57
- it {
58
- Vedeu::Bindings::Refresh.expects(:setup!)
59
- subject
60
- }
61
-
62
- it {
63
- Vedeu::Bindings::System.expects(:setup!)
64
- subject
65
- }
66
-
67
- it {
68
- Vedeu::Bindings::View.expects(:setup!)
69
- subject
70
- }
71
-
72
- it {
73
- Vedeu::Bindings::Visibility.expects(:setup!)
74
- subject
75
- }
76
-
77
- it { subject.must_equal(true) }
78
- end
79
-
80
- describe '.setup_aliases!' do
81
- before do
82
- Vedeu::Bindings::Application.stubs(:setup_aliases!)
83
- Vedeu::Bindings::Movement.stubs(:setup_aliases!)
84
- Vedeu::Bindings::Visibility.stubs(:setup_aliases!)
85
- end
86
-
87
- subject { described.setup_aliases! }
88
-
89
- it {
90
- Vedeu::Bindings::Application.expects(:setup_aliases!)
91
- subject
92
- }
93
-
94
- it {
95
- Vedeu::Bindings::Movement.expects(:setup_aliases!)
96
- subject
97
- }
98
-
99
- it {
100
- Vedeu::Bindings::Visibility.expects(:setup_aliases!)
101
- subject
102
- }
103
-
104
- it { subject.must_equal(true) }
105
- end
106
-
107
- end # Bindings
108
-
109
- end # Vedeu
@@ -1,24 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe Cursors do
8
-
9
- context 'the movement events are defined' do
10
- it { Vedeu.bound?(:_cursor_down_).must_equal(true) }
11
- it { Vedeu.bound?(:_cursor_left_).must_equal(true) }
12
- it { Vedeu.bound?(:_cursor_origin_).must_equal(true) }
13
- it { Vedeu.bound?(:_cursor_position_).must_equal(true) }
14
- it { Vedeu.bound?(:_cursor_reposition_).must_equal(true) }
15
- it { Vedeu.bound?(:_cursor_reset_).must_equal(true) }
16
- it { Vedeu.bound?(:_cursor_right_).must_equal(true) }
17
- it { Vedeu.bound?(:_cursor_up_).must_equal(true) }
18
- end
19
-
20
- end # Cursors
21
-
22
- end # Bindings
23
-
24
- end # Vedeu
@@ -1,25 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe Document do
8
-
9
- context 'the system events needed by Vedeu to run are defined' do
10
- it { Vedeu.bound?(:_editor_execute_).must_equal(true) }
11
- it { Vedeu.bound?(:_editor_delete_character_).must_equal(true) }
12
- it { Vedeu.bound?(:_editor_delete_line_).must_equal(true) }
13
- it { Vedeu.bound?(:_editor_down_).must_equal(true) }
14
- it { Vedeu.bound?(:_editor_insert_character_).must_equal(true) }
15
- it { Vedeu.bound?(:_editor_insert_line_).must_equal(true) }
16
- it { Vedeu.bound?(:_editor_left_).must_equal(true) }
17
- it { Vedeu.bound?(:_editor_right_).must_equal(true) }
18
- it { Vedeu.bound?(:_editor_up_).must_equal(true) }
19
- end
20
-
21
- end # Document
22
-
23
- end # Bindings
24
-
25
- end # Vedeu
@@ -1,27 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe DRB do
8
-
9
- before do
10
- Vedeu.stubs(:log)
11
- end
12
-
13
- context 'the drb specific events are defined' do
14
- it { Vedeu.bound?(:_drb_input_).must_equal(true) }
15
- it { Vedeu.bound?(:_drb_retrieve_output_).must_equal(true) }
16
- it { Vedeu.bound?(:_drb_store_output_).must_equal(true) }
17
- it { Vedeu.bound?(:_drb_restart_).must_equal(true) }
18
- it { Vedeu.bound?(:_drb_start_).must_equal(true) }
19
- it { Vedeu.bound?(:_drb_status_).must_equal(true) }
20
- it { Vedeu.bound?(:_drb_stop_).must_equal(true) }
21
- end
22
-
23
- end # DRB
24
-
25
- end # Bindings
26
-
27
- end # Vedeu
@@ -1,19 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe Focus do
8
-
9
- context 'the system events needed by Vedeu to run are defined' do
10
- it { Vedeu.bound?(:_focus_by_name_).must_equal(true) }
11
- it { Vedeu.bound?(:_focus_next_).must_equal(true) }
12
- it { Vedeu.bound?(:_focus_prev_).must_equal(true) }
13
- end
14
-
15
- end # Focus
16
-
17
- end # Bindings
18
-
19
- end # Vedeu
@@ -1,26 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe Menus do
8
-
9
- context 'the menu specific events are defined' do
10
- it { Vedeu.bound?(:_menu_bottom_).must_equal(true) }
11
- it { Vedeu.bound?(:_menu_current_).must_equal(true) }
12
- it { Vedeu.bound?(:_menu_deselect_).must_equal(true) }
13
- it { Vedeu.bound?(:_menu_items_).must_equal(true) }
14
- it { Vedeu.bound?(:_menu_next_).must_equal(true) }
15
- it { Vedeu.bound?(:_menu_prev_).must_equal(true) }
16
- it { Vedeu.bound?(:_menu_selected_).must_equal(true) }
17
- it { Vedeu.bound?(:_menu_select_).must_equal(true) }
18
- it { Vedeu.bound?(:_menu_top_).must_equal(true) }
19
- it { Vedeu.bound?(:_menu_view_).must_equal(true) }
20
- end
21
-
22
- end # Menus
23
-
24
- end # Bindings
25
-
26
- end # Vedeu
@@ -1,24 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe Movement do
8
-
9
- context 'the movement events are defined' do
10
- it { Vedeu.bound?(:_geometry_down_).must_equal(true) }
11
- it { Vedeu.bound?(:_geometry_left_).must_equal(true) }
12
- it { Vedeu.bound?(:_geometry_right_).must_equal(true) }
13
- it { Vedeu.bound?(:_geometry_up_).must_equal(true) }
14
- it { Vedeu.bound?(:_view_down_).must_equal(true) }
15
- it { Vedeu.bound?(:_view_left_).must_equal(true) }
16
- it { Vedeu.bound?(:_view_right_).must_equal(true) }
17
- it { Vedeu.bound?(:_view_up_).must_equal(true) }
18
- end
19
-
20
- end # Movement
21
-
22
- end # Bindings
23
-
24
- end # Vedeu
@@ -1,22 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe Refresh do
8
-
9
- context 'the system events needed by Vedeu to run are defined' do
10
- it { Vedeu.bound?(:_refresh_).must_equal(true) }
11
- it { Vedeu.bound?(:_refresh_border_).must_equal(true) }
12
- it { Vedeu.bound?(:_refresh_cursor_).must_equal(true) }
13
- it { Vedeu.bound?(:_refresh_group_).must_equal(true) }
14
- it { Vedeu.bound?(:_refresh_view_).must_equal(true) }
15
- it { Vedeu.bound?(:_refresh_view_content_).must_equal(true) }
16
- end
17
-
18
- end # Refresh
19
-
20
- end # Bindings
21
-
22
- end # Vedeu
@@ -1,24 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Bindings
6
-
7
- describe System do
8
-
9
- context 'the system events needed by Vedeu to run are defined' do
10
- it { Vedeu.bound?(:_cleanup_).must_equal(true) }
11
- it { Vedeu.bound?(:_command_).must_equal(true) }
12
- it { Vedeu.bound?(:_editor_).must_equal(true) }
13
- it { Vedeu.bound?(:_exit_).must_equal(true) }
14
- it { Vedeu.bound?(:_initialize_).must_equal(true) }
15
- it { Vedeu.bound?(:_keypress_).must_equal(true) }
16
- it { Vedeu.bound?(:_log_).must_equal(true) }
17
- it { Vedeu.bound?(:_mode_switch_).must_equal(true) }
18
- end
19
-
20
- end # System
21
-
22
- end # Bindings
23
-
24
- end # Vedeu