vedeu 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/docs/borders.md +1 -5
  3. data/docs/cursors.md +23 -92
  4. data/docs/events/application.md +1 -8
  5. data/docs/events/by_name/cleanup.md +7 -0
  6. data/docs/events/by_name/clear.md +2 -0
  7. data/docs/events/by_name/clear_group.md +6 -0
  8. data/docs/events/by_name/clear_view.md +5 -0
  9. data/docs/events/by_name/clear_view_content.md +5 -0
  10. data/docs/events/by_name/command.md +19 -0
  11. data/docs/events/by_name/cursor_bottom.md +7 -0
  12. data/docs/events/by_name/cursor_down.md +4 -0
  13. data/docs/events/by_name/cursor_left.md +6 -0
  14. data/docs/events/by_name/cursor_origin.md +6 -0
  15. data/docs/events/by_name/cursor_position.md +10 -0
  16. data/docs/events/by_name/cursor_reposition.md +4 -0
  17. data/docs/events/by_name/cursor_right.md +4 -0
  18. data/docs/events/by_name/cursor_top.md +7 -0
  19. data/docs/events/by_name/cursor_up.md +6 -0
  20. data/docs/events/by_name/drb_input.md +7 -0
  21. data/docs/events/by_name/drb_restart.md +5 -0
  22. data/docs/events/by_name/drb_retrieve_output.md +2 -0
  23. data/docs/events/by_name/drb_start.md +5 -0
  24. data/docs/events/by_name/drb_status.md +5 -0
  25. data/docs/events/by_name/drb_stop.md +5 -0
  26. data/docs/events/by_name/drb_store_output.md +2 -0
  27. data/docs/events/by_name/editor.md +9 -0
  28. data/docs/events/by_name/editor_delete_character.md +5 -0
  29. data/docs/events/by_name/editor_delete_line.md +5 -0
  30. data/docs/events/by_name/editor_down.md +5 -0
  31. data/docs/events/by_name/editor_execute.md +3 -0
  32. data/docs/events/by_name/editor_insert_character.md +7 -0
  33. data/docs/events/by_name/editor_insert_line.md +5 -0
  34. data/docs/events/by_name/editor_left.md +5 -0
  35. data/docs/events/by_name/editor_right.md +5 -0
  36. data/docs/events/by_name/editor_up.md +5 -0
  37. data/docs/events/by_name/exit.md +6 -0
  38. data/docs/events/by_name/focus_by_name.md +6 -0
  39. data/docs/events/by_name/focus_next.md +6 -0
  40. data/docs/events/by_name/focus_prev.md +6 -0
  41. data/docs/events/by_name/goto.md +8 -0
  42. data/docs/events/by_name/hide_cursor.md +10 -0
  43. data/docs/events/by_name/hide_group.md +5 -0
  44. data/docs/events/by_name/hide_interface.md +5 -0
  45. data/docs/events/by_name/initialize.md +6 -0
  46. data/docs/events/by_name/keypress.md +40 -0
  47. data/docs/events/by_name/log.md +7 -0
  48. data/docs/events/by_name/maximise.md +6 -0
  49. data/docs/events/by_name/menu_bottom.md +4 -0
  50. data/docs/events/by_name/menu_current.md +4 -0
  51. data/docs/events/by_name/menu_deselect.md +4 -0
  52. data/docs/events/by_name/menu_items.md +5 -0
  53. data/docs/events/by_name/menu_next.md +5 -0
  54. data/docs/events/by_name/menu_prev.md +5 -0
  55. data/docs/events/by_name/menu_select.md +4 -0
  56. data/docs/events/by_name/menu_selected.md +4 -0
  57. data/docs/events/by_name/menu_top.md +4 -0
  58. data/docs/events/by_name/menu_view.md +5 -0
  59. data/docs/events/by_name/mode_switch.md +7 -0
  60. data/docs/events/by_name/movement_refresh.md +19 -0
  61. data/docs/events/by_name/refresh.md +9 -0
  62. data/docs/events/by_name/refresh_border.md +5 -0
  63. data/docs/events/by_name/refresh_cursor.md +5 -0
  64. data/docs/events/by_name/refresh_group.md +4 -0
  65. data/docs/events/by_name/refresh_view.md +4 -0
  66. data/docs/events/by_name/refresh_view_content.md +4 -0
  67. data/docs/events/by_name/resize.md +5 -0
  68. data/docs/events/by_name/show_cursor.md +10 -0
  69. data/docs/events/by_name/show_group.md +5 -0
  70. data/docs/events/by_name/show_interface.md +5 -0
  71. data/docs/events/by_name/toggle_cursor.md +9 -0
  72. data/docs/events/by_name/toggle_group.md +5 -0
  73. data/docs/events/by_name/toggle_interface.md +5 -0
  74. data/docs/events/by_name/unmaximise.md +6 -0
  75. data/docs/events/document.md +9 -45
  76. data/docs/events/drb.md +7 -31
  77. data/docs/events/focus.md +3 -18
  78. data/docs/events/menu.md +10 -44
  79. data/docs/events/refresh.md +6 -25
  80. data/docs/events/system.md +8 -101
  81. data/docs/events/view.md +4 -36
  82. data/docs/events/visibility.md +10 -48
  83. data/lib/vedeu/borders/border.rb +117 -37
  84. data/lib/vedeu/borders/refresh.rb +29 -113
  85. data/lib/vedeu/borders/repository.rb +0 -5
  86. data/lib/vedeu/buffers/buffer.rb +13 -17
  87. data/lib/vedeu/buffers/refresh.rb +4 -4
  88. data/lib/vedeu/cursors/refresh.rb +2 -7
  89. data/lib/vedeu/groups/clear.rb +3 -1
  90. data/lib/vedeu/groups/refresh.rb +2 -2
  91. data/lib/vedeu/interfaces/clear.rb +2 -2
  92. data/lib/vedeu/output/refresh.rb +2 -2
  93. data/lib/vedeu/repositories/model.rb +2 -6
  94. data/lib/vedeu/repositories/repository.rb +17 -6
  95. data/lib/vedeu/runtime/flags.rb +2 -0
  96. data/lib/vedeu/version.rb +1 -1
  97. data/test/lib/vedeu/borders/border_test.rb +128 -12
  98. data/test/lib/vedeu/cursors/dsl_test.rb +13 -0
  99. metadata +72 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 12ee9a34dc28d9a2230a6e1acb69e62e8da7cd20
4
- data.tar.gz: 27b92a31c6f1585f4f84e6d1de7469569e5ddfa9
3
+ metadata.gz: 73d956c3dee89d057e89b5e730ca5ef5a974c229
4
+ data.tar.gz: 769594b1a84d5f2194fa71ba56faf86c5744ea71
5
5
  SHA512:
6
- metadata.gz: e24f06eb598a6776473d4f1a7364be6eca6e9c1660260093643a3a752ccd4765c66a1c9f429db439f5de99bafe2bdc64df3173bc38549e34d5df91029778f68b
7
- data.tar.gz: abb7551af78cb1c8339cd678a33e0e590a74b057cf32c9f256bc77980a6b1f2b05da31fc563b86a3e79775ab6a267eb4c3ae7817669797ee072146dc18b8b890
6
+ metadata.gz: 7660a8daf5f90ad644122576bdffd1ff984d4b13166d253feabb510bf6c799ec92607ecd0eaf1407234606d308901129aa75c6f93e28b749f94729602698f4c8
7
+ data.tar.gz: 322f163dda6a068a21f84f2ec53563dc69236e5f223ca3f4c73eca803c82919db630a188485233e2bb2abc18b4d822a08676057512c9c21cbceb860fa5eb0d52
data/docs/borders.md CHANGED
@@ -27,11 +27,7 @@ The interfaces of Vedeu can each have their own border.
27
27
  Note: 'name' is a Symbol unless mentioned otherwise, and can be
28
28
  substituted for `Vedeu.focus` to use the interface currently in focus.
29
29
 
30
- ### `:_refresh_border_`
31
- This event refreshes the border of the named view, unless the view
32
- does not have a border, or the border is not enabled.
33
-
34
- Vedeu.trigger(:_refresh_border_, name)
30
+ {include:file:docs/events/by_name/refresh_border.md}
35
31
 
36
32
  ### `:_set_border_title_`
37
33
  This event changes the title of the border of the named view to the
data/docs/cursors.md CHANGED
@@ -38,28 +38,26 @@ can be specified when defining the interface.
38
38
  Each example within each interface definition is equivalent.
39
39
 
40
40
  #### Showing the cursor
41
+ The following `cursor` statements are equivalent:
41
42
 
42
- Vedeu.interface :my_interface do
43
+ # Vedeu.interface :my_interface do
43
44
  cursor true
44
-
45
- # or...
46
-
47
45
  cursor!
46
+ show_cursor!
48
47
 
49
48
  # ...
50
- end
49
+ # end
51
50
 
52
51
  #### Hiding the cursor
52
+ The following `cursor` statements are equivalent:
53
53
 
54
- Vedeu.interface :my_interface do
54
+ # Vedeu.interface :my_interface do
55
55
  cursor false
56
-
57
- # or...
58
-
59
56
  no_cursor!
57
+ hide_cirsor!
60
58
 
61
59
  # ...
62
- end
60
+ # end
63
61
 
64
62
  ### View Cursors
65
63
  The view cursor is the same as the interface cursor with the same
@@ -85,30 +83,17 @@ view is rendered, overriding the initial or current state.
85
83
  end
86
84
 
87
85
 
88
- ## Cursor Positioning Events
89
-
90
- ### `:_cursor_origin_`
91
- This event moves the cursor to the interface origin; the top left
92
- corner of the named interface.
93
-
94
- Vedeu.trigger(:_cursor_origin_, name)
95
- Vedeu.trigger(:_cursor_reset_, name)
86
+ ## Cursor Events
96
87
 
97
- ### `:_cursor_position_`
98
- To ascertain the position of a cursor in a named interface, use the
99
- following event (substituting 'name' for the interface name):
88
+ {include:file:docs/events/by_name/refresh_cursor.md}
100
89
 
101
- Vedeu.trigger(:_cursor_position_, name)
102
-
103
- If you want to know where the cursor is without knowing the interface
104
- name, you can check which interface is in focus:
90
+ ## Cursor Positioning Events
105
91
 
106
- Vedeu.trigger(:_cursor_position_, Vedeu.focus)
92
+ {include:file:docs/events/by_name/cursor_origin.md}
107
93
 
108
- ### `:_cursor_reposition_`
109
- Moves the cursor to a relative position inside the interface.
94
+ {include:file:docs/events/by_name/cursor_position.md}
110
95
 
111
- Vedeu.trigger(:_cursor_reposition_, name, y, x)
96
+ {include:file:docs/events/by_name/cursor_reposition.md}
112
97
 
113
98
  ## Cursor Movement Events
114
99
 
@@ -116,45 +101,17 @@ Adjusts the position of the named cursor or view in the direction
116
101
  specified. If 'name' is unknown, using 'Vedeu.focus' will use the
117
102
  interface currently in focus.
118
103
 
119
- ### `:_cursor_left_`
120
- Moves the cursor one character left, unless the left-most position
121
- for the view or terminal is reached.
122
-
123
- Vedeu.trigger(:_cursor_left_, name)
124
- Vedeu.trigger(:_cursor_left_, Vedeu.focus)
104
+ {include:file:docs/events/by_name/cursor_left.md}
125
105
 
126
- ### `:_cursor_down_`
106
+ {include:file:docs/events/by_name/cursor_down.md}
127
107
 
128
- Vedeu.trigger(:_cursor_down_, name)
129
- Vedeu.trigger(:_cursor_down_, Vedeu.focus)
108
+ {include:file:docs/events/by_name/cursor_up.md}
130
109
 
131
- ### `:_cursor_up_`
132
- Moves the cursor one line up, unless the top-most position for the
133
- view or terminal is reached.
110
+ {include:file:docs/events/by_name/cursor_right.md}
134
111
 
135
- Vedeu.trigger(:_cursor_up_, name)
136
- Vedeu.trigger(:_cursor_up_, Vedeu.focus)
112
+ {include:file:docs/events/by_name/cursor_top.md}
137
113
 
138
- ### `:_cursor_right_`
139
-
140
- Vedeu.trigger(:_cursor_right_, name)
141
- Vedeu.trigger(:_cursor_right_, Vedeu.focus)
142
-
143
- ### `:_cursor_top_`
144
- Moves the cursor to the top-most position for the view or terminal.
145
- If the view contains content, then this event will effectively scroll
146
- to the first line of the content.
147
-
148
- Vedeu.trigger(:_cursor_top_, name)
149
- Vedeu.trigger(:_cursor_top_, Vedeu.focus)
150
-
151
- ### `:_cursor_bottom_`
152
- Moves the cursor to the bottom-most position for the view or terminal.
153
- If the view contains content, then this event will effectively scroll
154
- to the last line of the content.
155
-
156
- Vedeu.trigger(:_cursor_bottom_, name)
157
- Vedeu.trigger(:_cursor_bottom_, Vedeu.focus)
114
+ {include:file:docs/events/by_name/cursor_bottom.md}
158
115
 
159
116
  ## Cursor Visibility API & Events
160
117
 
@@ -163,34 +120,8 @@ can be called at any time and affect the cursor of the named
163
120
  interface, or when a name is not given, the interface currently in
164
121
  focus.
165
122
 
166
- ### Vedeu.hide_cursor / `:_cursor_hide_`
167
- Hide the cursor.
168
-
169
- Vedeu.trigger(:_hide_cursor_, name)
170
- Vedeu.trigger(:_hide_cursor_, Vedeu.focus)
171
- Vedeu.trigger(:_cursor_hide_, name)
172
- Vedeu.trigger(:_cursor_hide_, Vedeu.focus)
173
-
174
- Vedeu.hide_cursor(name)
175
- Vedeu.hide_cursor(Vedeu.focus)
176
-
177
- ### Vedeu.show_cursor / `:_show_cursor_`
178
- Show the cursor.
179
-
180
- Vedeu.trigger(:_show_cursor_, name)
181
- Vedeu.trigger(:_show_cursor_, Vedeu.focus)
182
- Vedeu.trigger(:_cursor_show_, name)
183
- Vedeu.trigger(:_cursor_show_, Vedeu.focus)
184
-
185
- Vedeu.show_cursor(name)
186
- Vedeu.show_cursor(Vedeu.focus)
187
-
188
- ### Vedeu.toggle_cursor / `:_toggle_cursor_`
189
- Toggle the visibility of the cursor. If hidden, then show. If shown,
190
- then hide.
123
+ {include:file:docs/events/by_name/hide_cursor.md}
191
124
 
192
- Vedeu.trigger(:_toggle_cursor_, name)
193
- Vedeu.trigger(:_toggle_cursor_, Vedeu.focus)
125
+ {include:file:docs/events/by_name/show_cursor.md}
194
126
 
195
- Vedeu.toggle_cursor(name)
196
- Vedeu.toggle_cursor(Vedeu.focus)
127
+ {include:file:docs/events/by_name/toggle_cursor.md}
@@ -2,11 +2,4 @@
2
2
 
3
3
  ## Application Events
4
4
 
5
- ### `:_goto_`
6
- Call a client application controller's action with parameters.
7
-
8
- Vedeu.trigger(:_goto_,
9
- :your_controller,
10
- :some_action,
11
- { id: 7 })
12
- Vedeu.goto(:your_controller, :some_action, { id: 7 })
5
+ {include:file:docs/events/by_name/goto.md}
@@ -0,0 +1,7 @@
1
+ ### `:_cleanup_`
2
+ Vedeu triggers this event when `:_exit_` is triggered. You can hook
3
+ into this to perform a special action before the application
4
+ terminates. Saving the user's work, session or preferences might be
5
+ popular here.
6
+
7
+ Vedeu.trigger(:_exit_)
@@ -0,0 +1,2 @@
1
+ ### `:_clear_`
2
+ See {Vedeu::Buffers::Terminal#clear}
@@ -0,0 +1,6 @@
1
+ ### `:_clear_group_`
2
+ Clears the spaces occupied by the interfaces belonging to the named
3
+ group.
4
+
5
+ Vedeu.trigger(:_clear_group_, name)
6
+ Vedeu.clear_by_group(name)
@@ -0,0 +1,5 @@
1
+ ### `:_clear_view_`
2
+ Clears the named view/interface area.
3
+
4
+ Vedeu.trigger(:_clear_view_, name)
5
+ Vedeu.clear_by_name(name)
@@ -0,0 +1,5 @@
1
+ ### `:_clear_view_content_`
2
+ Clears only the content of the named view/interface area.
3
+
4
+ Vedeu.trigger(:_clear_view_content_, name)
5
+ Vedeu.clear_content_by_name(name)
@@ -0,0 +1,19 @@
1
+ ### `:_command_`
2
+ This event is used by Vedeu internally, though you can bind to it if
3
+ you wish. It is preferred for you to bind to `:command` though.
4
+
5
+ Will cause the triggering of the `:command` event; which you should
6
+ define to 'do things'.
7
+
8
+ Vedeu.trigger(:_command_, command)
9
+
10
+ Vedeu.bind(:command) do
11
+ # ... your code here ...
12
+ end
13
+
14
+ Alternatively, you can access commands entered using the following
15
+ API methods: (See {Vedeu::Input::Store} for more details).
16
+
17
+ Vedeu.all_commands
18
+
19
+ Vedeu.last_command
@@ -0,0 +1,7 @@
1
+ ### `:_cursor_bottom_`
2
+ Moves the cursor to the bottom-most position for the view or terminal.
3
+ If the view contains content, then this event will effectively scroll
4
+ to the last line of the content.
5
+
6
+ Vedeu.trigger(:_cursor_bottom_, name)
7
+ Vedeu.trigger(:_cursor_bottom_, Vedeu.focus)
@@ -0,0 +1,4 @@
1
+ ### `:_cursor_down_`
2
+
3
+ Vedeu.trigger(:_cursor_down_, name)
4
+ Vedeu.trigger(:_cursor_down_, Vedeu.focus)
@@ -0,0 +1,6 @@
1
+ ### `:_cursor_left_`
2
+ Moves the cursor one character left, unless the left-most position
3
+ for the view or terminal is reached.
4
+
5
+ Vedeu.trigger(:_cursor_left_, name)
6
+ Vedeu.trigger(:_cursor_left_, Vedeu.focus)
@@ -0,0 +1,6 @@
1
+ ### `:_cursor_origin_`
2
+ This event moves the cursor to the interface origin; the top left
3
+ corner of the named interface.
4
+
5
+ Vedeu.trigger(:_cursor_origin_, name)
6
+ Vedeu.trigger(:_cursor_reset_, name)
@@ -0,0 +1,10 @@
1
+ ### `:_cursor_position_`
2
+ To ascertain the position of a cursor in a named interface, use the
3
+ following event (substituting 'name' for the interface name):
4
+
5
+ Vedeu.trigger(:_cursor_position_, name)
6
+
7
+ If you want to know where the cursor is without knowing the interface
8
+ name, you can check which interface is in focus:
9
+
10
+ Vedeu.trigger(:_cursor_position_, Vedeu.focus)
@@ -0,0 +1,4 @@
1
+ ### `:_cursor_reposition_`
2
+ Moves the cursor to a relative position inside the interface.
3
+
4
+ Vedeu.trigger(:_cursor_reposition_, name, y, x)
@@ -0,0 +1,4 @@
1
+ ### `:_cursor_right_`
2
+
3
+ Vedeu.trigger(:_cursor_right_, name)
4
+ Vedeu.trigger(:_cursor_right_, Vedeu.focus)
@@ -0,0 +1,7 @@
1
+ ### `:_cursor_top_`
2
+ Moves the cursor to the top-most position for the view or terminal.
3
+ If the view contains content, then this event will effectively scroll
4
+ to the first line of the content.
5
+
6
+ Vedeu.trigger(:_cursor_top_, name)
7
+ Vedeu.trigger(:_cursor_top_, Vedeu.focus)
@@ -0,0 +1,6 @@
1
+ ### `:_cursor_up_`
2
+ Moves the cursor one line up, unless the top-most position for the
3
+ view or terminal is reached.
4
+
5
+ Vedeu.trigger(:_cursor_up_, name)
6
+ Vedeu.trigger(:_cursor_up_, Vedeu.focus)
@@ -0,0 +1,7 @@
1
+ ### `:_drb_input_`
2
+ Triggering this event will send input to the running application as
3
+ long as it has the DRb server running.
4
+
5
+ Note: See {Vedeu::Distributed::Server#input} for parameter details.
6
+
7
+ Vedeu.trigger(:_drb_input_, data, type)
@@ -0,0 +1,5 @@
1
+ ### `:_drb_restart_`
2
+ Use the DRb server to request the client application to restart.
3
+
4
+ Vedeu.trigger(:_drb_restart_)
5
+ Vedeu.drb_restart
@@ -0,0 +1,2 @@
1
+ ### `:_drb_retrieve_output_`
2
+ See {Vedeu::Buffers::Terminal#output}
@@ -0,0 +1,5 @@
1
+ ### `:_drb_start_`
2
+ Use the DRb server to request the client application to start.
3
+
4
+ Vedeu.trigger(:_drb_start_)
5
+ Vedeu.drb_start
@@ -0,0 +1,5 @@
1
+ ### `:_drb_status_`
2
+ Use the DRb server to request the status of the client application.
3
+
4
+ Vedeu.trigger(:_drb_status_)
5
+ Vedeu.drb_status
@@ -0,0 +1,5 @@
1
+ ### `:_drb_stop_`
2
+ Use the DRb server to request the client application to stop.
3
+
4
+ Vedeu.trigger(:_drb_stop_)
5
+ Vedeu.drb_stop
@@ -0,0 +1,2 @@
1
+ ### `:_drb_store_output_`
2
+ See {Vedeu::Buffers::Terminal#write}
@@ -0,0 +1,9 @@
1
+ ### `:_editor_`
2
+ This event is called by {Vedeu::Input::Capture#read}. When
3
+ invoked, the key will be passed to the editor for currently
4
+ focussed view.
5
+
6
+ Note: 'key' is a String for alphanumeric keys and special keys are
7
+ represented by Symbols.
8
+
9
+ Vedeu.trigger(:_editor_, key)
@@ -0,0 +1,5 @@
1
+ ### `:_editor_delete_character_`
2
+ This event attempts to delete the character in the named
3
+ document at the current virtual cursor position.
4
+
5
+ Vedeu.trigger(:_editor_delete_character_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_editor_delete_line_`
2
+ This event attempts to delete the line in the named document
3
+ at the current virtual cursor position.
4
+
5
+ Vedeu.trigger(:_editor_delete_line_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_editor_down_`
2
+ This event attempts to move the virtual cursor down by one
3
+ line in the named document.
4
+
5
+ Vedeu.trigger(:_editor_down_, name)
@@ -0,0 +1,3 @@
1
+ ### `:_editor_execute_`
2
+
3
+ Vedeu.trigger(:_editor_execute_, name)
@@ -0,0 +1,7 @@
1
+ ### `:_editor_insert_character_`
2
+ This event attempts to insert the given character in the named
3
+ document at the current virtual cursor position.
4
+
5
+ Note: 'character' is a string.
6
+
7
+ Vedeu.trigger(:_editor_insert_character_, name, character)
@@ -0,0 +1,5 @@
1
+ ### `:_editor_insert_line_`
2
+ This event attempts to insert a new line in the named document
3
+ at the current virtual cursor position.
4
+
5
+ Vedeu.trigger(:_editor_insert_line_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_editor_left_`
2
+ This event attempts to move the virtual cursor left by one
3
+ character in the named document.
4
+
5
+ Vedeu.trigger(:_editor_left_, name)
@@ -0,0 +1,5 @@
1
+ ### `:_editor_right_`
2
+ This event attempts to move the virtual cursor right by one
3
+ character in the named document.
4
+
5
+ Vedeu.trigger(:_editor_right_, name)