vedeu 0.6.32 → 0.6.33

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -2
  3. data/README.md +2 -2
  4. data/Rakefile +2 -2
  5. data/docs/borders.md +62 -0
  6. data/docs/{cursor.md → cursors.md} +7 -7
  7. data/docs/events/application.md +1 -1
  8. data/docs/events/document.md +9 -9
  9. data/docs/events/drb.md +7 -7
  10. data/docs/events/focus.md +3 -3
  11. data/docs/events/menu.md +10 -10
  12. data/docs/events/movement.md +3 -3
  13. data/docs/events/refresh.md +5 -10
  14. data/docs/events/system.md +8 -8
  15. data/docs/events/view.md +3 -3
  16. data/docs/events/visibility.md +13 -13
  17. data/docs/geometry.md +1 -1
  18. data/docs/interfaces.md +1 -1
  19. data/lib/vedeu/borders/border.rb +6 -2
  20. data/lib/vedeu/borders/refresh.rb +13 -18
  21. data/lib/vedeu/borders/repository.rb +23 -0
  22. data/lib/vedeu/buffers/refresh.rb +9 -5
  23. data/lib/vedeu/cursors/cursor.rb +2 -0
  24. data/lib/vedeu/cursors/refresh.rb +9 -4
  25. data/lib/vedeu/cursors/repository.rb +1 -1
  26. data/lib/vedeu/editor/cropper.rb +2 -1
  27. data/lib/vedeu/error.rb +6 -1
  28. data/lib/vedeu/groups/refresh.rb +7 -1
  29. data/lib/vedeu/interfaces/null.rb +3 -9
  30. data/lib/vedeu/models/focus.rb +5 -1
  31. data/lib/vedeu/null/generic.rb +3 -9
  32. data/lib/vedeu/output/clear/interface.rb +9 -3
  33. data/lib/vedeu/repositories/repository.rb +2 -2
  34. data/lib/vedeu/terminal/buffer.rb +2 -0
  35. data/lib/vedeu/version.rb +1 -1
  36. data/test/lib/vedeu/borders/refresh_test.rb +10 -2
  37. data/test/lib/vedeu/cursors/repository_test.rb +16 -7
  38. data/test/lib/vedeu/groups/refresh_test.rb +29 -1
  39. data/test/lib/vedeu/interfaces/null_test.rb +7 -14
  40. data/test/lib/vedeu/models/focus_test.rb +1 -1
  41. data/test/lib/vedeu/null/generic_test.rb +12 -7
  42. data/test/lib/vedeu/output/renderers/all_test.rb +20 -13
  43. data/test/support/examples/material_colours_app.rb +90 -23
  44. metadata +4 -4
  45. data/docs/border.md +0 -23
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2fc9f2ae69352f9b6c21d8d8607082bb988cff48
4
- data.tar.gz: 9a0d1207af8e078b58cccadab420b3465e00b816
3
+ metadata.gz: b2d162793e93e4fa86ae8aa3de42eebb420dfe04
4
+ data.tar.gz: f85ce22f4ae5e77674fb833f8424236a89980ccc
5
5
  SHA512:
6
- metadata.gz: 2a17c83991be48b4ccbee939f304a72e3e4f2401c2793782b469403ae9386020bb2e36b0afdec9b5c42471045b9262a1c9e23a6ee50c3d6812506ee638480c3e
7
- data.tar.gz: c7149fbd4b90a7d5eb4e2fecabcafca828cb4805b76c86b369441f37db3b91b3e7077988c7cda7bcde08ef5f5f9ec4c9baf0afdb3c4968a8e257b0a490dda6aa
6
+ metadata.gz: 9d43739fa7157c31b80664ef5745d9ba27321b876aa35eae85ddd1dd45f77a89d0d27386bfc50e699979cb4c21783432afab585fe7312b01f08da0916af9f12e
7
+ data.tar.gz: b05c10e2f4903031809a462cd4257952fd925f5b8bc0a4dc84880f704b5e82b255510624cddde9828edf4d4c4eb729397d3cada44143ab03a0cb3a965d6ec752
data/.yardopts CHANGED
@@ -3,10 +3,10 @@
3
3
  --embed-mixins
4
4
  -
5
5
  docs/api.md
6
- docs/border.md
6
+ docs/borders.md
7
7
  docs/buffer.md
8
8
  docs/configuration.md
9
- docs/cursor.md
9
+ docs/cursors.md
10
10
  docs/dsl.md
11
11
  docs/events.md
12
12
  docs/geometry.md
data/README.md CHANGED
@@ -53,8 +53,8 @@ here is some documentation for the various aspects of Vedeu:
53
53
  - [Views](http://rubydoc.info/gems/vedeu/file/docs/view.md)
54
54
  - [Buffers](http://rubydoc.info/gems/vedeu/file/docs/buffer.md)
55
55
  - [Geometry](http://rubydoc.info/gems/vedeu/file/docs/geometry.md)
56
- - [Borders](http://rubydoc.info/gems/vedeu/file/docs/border.md)
57
- - [Cursors](http://rubydoc.info/gems/vedeu/file/docs/cursor.md)
56
+ - [Borders](http://rubydoc.info/gems/vedeu/file/docs/borders.md)
57
+ - [Cursors](http://rubydoc.info/gems/vedeu/file/docs/cursors.md)
58
58
  - [Keymaps](http://rubydoc.info/gems/vedeu/file/docs/keymaps.md)
59
59
  - [Events](http://rubydoc.info/gems/vedeu/file/docs/events.md)
60
60
  - [Configuration](http://rubydoc.info/gems/vedeu/file/docs/configuration.md)
data/Rakefile CHANGED
@@ -16,10 +16,10 @@ YARD::Rake::YardocTask.new(:yard) do |task|
16
16
  'lib/**/*.rb',
17
17
  '-',
18
18
  'docs/api.md',
19
- 'docs/border.md',
19
+ 'docs/borders.md',
20
20
  'docs/buffer.md',
21
21
  'docs/configuration.md',
22
- 'docs/cursor.md',
22
+ 'docs/cursors.md',
23
23
  'docs/dsl.md',
24
24
  'docs/events.md',
25
25
  'docs/geometry.md',
data/docs/borders.md ADDED
@@ -0,0 +1,62 @@
1
+ # @title Vedeu Borders
2
+ # Vedeu Borders
3
+
4
+ The interfaces of Vedeu can each have their own border.
5
+
6
+ - It has a name. This name associates it with an
7
+ {file:docs/interface.md Interface}.
8
+ - Each of its corners, the horizontal, and the vertical character can
9
+ be defined as different characters.
10
+ - It can have a foreground and a background and style, independent of
11
+ the interface to which it belongs.
12
+ - Each of the sides of the border can be shown or hidden
13
+ independently.
14
+ - The border itself can be enabled and disabled (shown/hidden) as
15
+ required.
16
+ - The border can have a title, which is displayed on the top side.
17
+ - It can also have a caption, which is displayed on the bottom side.
18
+ - The sides of the border will use:
19
+ - The first (top) line of the geometry.
20
+ - The last (bottom) line of the geometry.
21
+ - The first character (left) of the geometry.
22
+ - The last character (right) of the geometry.
23
+ - The border can be refreshed independently of the interface.
24
+
25
+ ## Border Events
26
+
27
+ Note: 'name' is a Symbol unless mentioned otherwise, and can be
28
+ substituted for `Vedeu.focus` to use the interface currently in focus.
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)
35
+
36
+ ### `:\_set_border_title\_`
37
+ This event changes the title of the border of the named view to the
38
+ value given.
39
+
40
+ Vedeu.trigger(:_set_border_title_, name, title)
41
+
42
+ - The title must be a string or nil.
43
+ - If the title is an empty string or nil, then the title will not be
44
+ shown, and an existing title will be removed.
45
+ - If the name is nil, then the view currently focussed will be used.
46
+ - When triggering this event, the border will automatically be
47
+ refreshed, unless the view does not have a border, or the border is
48
+ not enabled, or the top border is set not to be shown.
49
+
50
+ ### `:\_set_border_caption\_`
51
+ This event changes the caption of the border of the named view to the
52
+ value given.
53
+
54
+ Vedeu.trigger(:_set_border_caption_, name, caption)
55
+
56
+ - The caption must be a string or nil.
57
+ - If the caption is an empty string or nil, then the caption will not
58
+ be shown, and an existing caption will be removed.
59
+ - If the name is nil, then the view currently focussed will be used.
60
+ - When triggering this event, the border will automatically be
61
+ refreshed, unless the view does not have a border, or the border is
62
+ not enabled, or the bottom border is set not to be shown.
@@ -27,14 +27,14 @@ conveniently after the interface itself.
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
- ### :\_cursor_origin_
30
+ ### `:\_cursor_origin\_`
31
31
  This event moves the cursor to the interface origin; the top left
32
32
  corner of the named interface.
33
33
 
34
34
  Vedeu.trigger(:_cursor_origin_, name)
35
35
  Vedeu.trigger(:_cursor_reset_, name)
36
36
 
37
- ### :\_cursor_position_
37
+ ### `:\_cursor_position\_`
38
38
  To ascertain the position of a cursor in a named interface, use the
39
39
  following event (substituting 'name' for the interface name):
40
40
 
@@ -45,7 +45,7 @@ name, you can check which interface is in focus:
45
45
 
46
46
  Vedeu.trigger(:_cursor_position_, Vedeu.focus)
47
47
 
48
- ### :\_cursor_reposition_
48
+ ### `:\_cursor_reposition\_`
49
49
  Moves the cursor to a relative position inside the interface.
50
50
 
51
51
  Vedeu.trigger(:_cursor_reposition_, name, y, x)
@@ -56,22 +56,22 @@ Adjusts the position of the named cursor or view in the direction
56
56
  specified. If 'name' is unknown, using 'Vedeu.focus' will use the
57
57
  interface currently in focus.
58
58
 
59
- ### :\_cursor_left_
59
+ ### `:\_cursor_left\_`
60
60
 
61
61
  Vedeu.trigger(:_cursor_left_, name)
62
62
  Vedeu.trigger(:_cursor_left_, Vedeu.focus)
63
63
 
64
- ### :\_cursor_down_
64
+ ### `:\_cursor_down\_`
65
65
 
66
66
  Vedeu.trigger(:_cursor_down_, name)
67
67
  Vedeu.trigger(:_cursor_down_, Vedeu.focus)
68
68
 
69
- ### :\_cursor_up_
69
+ ### `:\_cursor_up\_`
70
70
 
71
71
  Vedeu.trigger(:_cursor_up_, name)
72
72
  Vedeu.trigger(:_cursor_up_, Vedeu.focus)
73
73
 
74
- ### :\_cursor_right_
74
+ ### `:\_cursor_right\_`
75
75
 
76
76
  Vedeu.trigger(:_cursor_right_, name)
77
77
  Vedeu.trigger(:_cursor_right_, Vedeu.focus)
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## Application Events
4
4
 
5
- ### :\_goto_
5
+ ### `:\_goto\_`
6
6
  Call a client application controller's action with parameters.
7
7
 
8
8
  Vedeu.trigger(:_goto_,
@@ -4,29 +4,29 @@
4
4
 
5
5
  Note: 'name' is a Symbol unless mentioned otherwise.
6
6
 
7
- ### :\_editor_execute_
7
+ ### `:\_editor_execute\_`
8
8
 
9
9
  Vedeu.trigger(:_editor_execute_, name)
10
10
 
11
- ### :\_editor_delete_character_
11
+ ### `:\_editor_delete_character\_`
12
12
  This event attempts to delete the character in the named
13
13
  document at the current virtual cursor position.
14
14
 
15
15
  Vedeu.trigger(:_editor_delete_character_, name)
16
16
 
17
- ### :\_editor_delete_line_
17
+ ### `:\_editor_delete_line\_`
18
18
  This event attempts to delete the line in the named document
19
19
  at the current virtual cursor position.
20
20
 
21
21
  Vedeu.trigger(:_editor_delete_line_, name)
22
22
 
23
- ### :\_editor_down_
23
+ ### `:\_editor_down\_`
24
24
  This event attempts to move the virtual cursor down by one
25
25
  line in the named document.
26
26
 
27
27
  Vedeu.trigger(:_editor_down_, name)
28
28
 
29
- ### :\_editor_insert_character_
29
+ ### `:\_editor_insert_character\_`
30
30
  This event attempts to insert the given character in the named
31
31
  document at the current virtual cursor position.
32
32
 
@@ -34,25 +34,25 @@ Note: 'character' is a string.
34
34
 
35
35
  Vedeu.trigger(:_editor_insert_character_, name, character)
36
36
 
37
- ### :\_editor_insert_line_
37
+ ### `:\_editor_insert_line\_`
38
38
  This event attempts to insert a new line in the named document
39
39
  at the current virtual cursor position.
40
40
 
41
41
  Vedeu.trigger(:_editor_insert_line_, name)
42
42
 
43
- ### :\_editor_left_
43
+ ### `:\_editor_left\_`
44
44
  This event attempts to move the virtual cursor left by one
45
45
  character in the named document.
46
46
 
47
47
  Vedeu.trigger(:_editor_left_, name)
48
48
 
49
- ### :\_editor_right_
49
+ ### `:\_editor_right\_`
50
50
  This event attempts to move the virtual cursor right by one
51
51
  character in the named document.
52
52
 
53
53
  Vedeu.trigger(:_editor_right_, name)
54
54
 
55
- ### :\_editor_up_
55
+ ### `:\_editor_up\_`
56
56
  This event attempts to move the virtual cursor up by one line
57
57
  in the named document.
58
58
 
data/docs/events/drb.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ## DRB Events
4
4
 
5
- ### :\_drb_input_
5
+ ### `:\_drb_input\_`
6
6
  Triggering this event will send input to the running application as
7
7
  long as it has the DRb server running.
8
8
 
@@ -10,11 +10,11 @@ Note: See {Vedeu::Distributed::Server#input} for parameter details.
10
10
 
11
11
  Vedeu.trigger(:_drb_input_, data, type)
12
12
 
13
- ### :\_drb_retrieve_output_
13
+ ### `:\_drb_retrieve_output\_`
14
14
 
15
15
  Vedeu.trigger(:_drb_retrieve_output_)
16
16
 
17
- ### :\_drb_store_output_
17
+ ### `:\_drb_store_output\_`
18
18
  Triggering this event with 'data' will push data into the running
19
19
  application's virtual buffer.
20
20
 
@@ -22,25 +22,25 @@ Note: See {Vedeu::Terminal::Buffer#write} for parameter details.
22
22
 
23
23
  Vedeu.trigger(:_drb_store_output_, data)
24
24
 
25
- ### :\_drb_restart_
25
+ ### `:\_drb_restart\_`
26
26
  Use the DRb server to request the client application to restart.
27
27
 
28
28
  Vedeu.trigger(:_drb_restart_)
29
29
  Vedeu.drb_restart
30
30
 
31
- ### :\_drb_start_
31
+ ### `:\_drb_start\_`
32
32
  Use the DRb server to request the client application to start.
33
33
 
34
34
  Vedeu.trigger(:_drb_start_)
35
35
  Vedeu.drb_start
36
36
 
37
- ### :\_drb_status_
37
+ ### `:\_drb_status\_`
38
38
  Use the DRb server to request the status of the client application.
39
39
 
40
40
  Vedeu.trigger(:_drb_status_)
41
41
  Vedeu.drb_status
42
42
 
43
- ### :\_drb_stop_
43
+ ### `:\_drb_stop\_`
44
44
  Use the DRb server to request the client application to stop.
45
45
 
46
46
  Vedeu.trigger(:_drb_stop_)
data/docs/events/focus.md CHANGED
@@ -4,21 +4,21 @@
4
4
 
5
5
  Note: 'name' is a Symbol unless mentioned otherwise.
6
6
 
7
- ### :\_focus_by_name_
7
+ ### `:\_focus_by_name\_`
8
8
  When triggered with an interface name will focus that interface and
9
9
  restore the cursor position and visibility.
10
10
 
11
11
  Vedeu.trigger(:_focus_by_name_, name) # or
12
12
  Vedeu.focus_by_name(name)
13
13
 
14
- ### :\_focus_next_
14
+ ### `:\_focus_next\_`
15
15
  When triggered will focus the next visible interface and restore the
16
16
  cursor position and visibility.
17
17
 
18
18
  Vedeu.trigger(:_focus_next_) # or
19
19
  Vedeu.focus_next
20
20
 
21
- ### :\_focus_prev_
21
+ ### `:\_focus_prev\_`
22
22
  When triggered will focus the previous visible interface and restore
23
23
  the cursor position and visibility.
24
24
 
data/docs/events/menu.md CHANGED
@@ -4,55 +4,55 @@
4
4
 
5
5
  Note: 'name' is a Symbol unless mentioned otherwise.
6
6
 
7
- ### :\_menu_bottom_
7
+ ### `:\_menu_bottom\_`
8
8
  Makes the last menu item the current menu item.
9
9
 
10
10
  Vedeu.trigger(:_menu_bottom_, name)
11
11
 
12
- ### :\_menu_current_
12
+ ### `:\_menu_current\_`
13
13
  Returns the current menu item.
14
14
 
15
15
  Vedeu.trigger(:_menu_current_, name)
16
16
 
17
- ### :\_menu_deselect_
17
+ ### `:\_menu_deselect\_`
18
18
  Deselects all menu items.
19
19
 
20
20
  Vedeu.trigger(:_menu_deselect_, name)
21
21
 
22
- ### :\_menu_items_
22
+ ### `:\_menu_items\_`
23
23
  Returns all the menu items with respective `current` or `selected`
24
24
  boolean indicators.
25
25
 
26
26
  Vedeu.trigger(:_menu_items_, name)
27
27
 
28
- ### :\_menu_next_
28
+ ### `:\_menu_next\_`
29
29
  Makes the next menu item the current menu item, until it reaches the
30
30
  last item.
31
31
 
32
32
  Vedeu.trigger(:_menu_next_, name)
33
33
 
34
- ### :\_menu_prev_
34
+ ### `:\_menu_prev\_`
35
35
  Makes the previous menu item the current menu item, until it reaches
36
36
  the first item.
37
37
 
38
38
  Vedeu.trigger(:_menu_prev_, name)
39
39
 
40
- ### :\_menu_selected_
40
+ ### `:\_menu_selected\_`
41
41
  Returns the selected menu item.
42
42
 
43
43
  Vedeu.trigger(:_menu_selected_, name)
44
44
 
45
- ### :\_menu_select_
45
+ ### `:\_menu_select\_`
46
46
  Makes the current menu item also the selected menu item.
47
47
 
48
48
  Vedeu.trigger(:_menu_select_, name)
49
49
 
50
- ### :\_menu_top_
50
+ ### `:\_menu_top\_`
51
51
  Makes the first menu item the current menu item.
52
52
 
53
53
  Vedeu.trigger(:_menu_top_, name)
54
54
 
55
- ### :\_menu_view_
55
+ ### `:\_menu_view\_`
56
56
  Returns a subset of the menu items; starting at the current item to
57
57
  the last item.
58
58
 
@@ -5,10 +5,10 @@
5
5
  Note: 'name' is a Symbol unless mentioned otherwise.
6
6
 
7
7
  For cursor related movement events, please refer to
8
- {file:docs/cursor.md} Cursors.
8
+ {file:docs/cursors.md} Cursors.
9
9
 
10
10
 
11
- ### :\_view_(up, down, left, right)_
11
+ ### `:\_view_(up, down, left, right)\_`
12
12
 
13
13
  Please note that the name of the view is required for these events.
14
14
 
@@ -17,4 +17,4 @@ Please note that the name of the view is required for these events.
17
17
  Vedeu.trigger(:_view_right_, name)
18
18
  Vedeu.trigger(:_view_up_, name)
19
19
 
20
- Each of the :\_view_* events has an alias, :\_geometry_* if you prefer.
20
+ Each of the `:\_view\_*` events has an alias, `:\_geometry\_*` if you prefer.
@@ -4,7 +4,7 @@
4
4
 
5
5
  Note: 'name' is a Symbol unless mentioned otherwise.
6
6
 
7
- ### :\_refresh_
7
+ ### `:\_refresh\_`
8
8
  Refreshes all registered interfaces.
9
9
 
10
10
  The interfaces will be refreshed in z-index order, meaning that
@@ -14,28 +14,23 @@ will be still refreshed in memory but not shown.
14
14
 
15
15
  Vedeu.trigger(:_refresh_)
16
16
 
17
- ### :\_refresh_border_
18
- Will cause the named border to refresh.
19
-
20
- Vedeu.trigger(:_refresh_border_, name)
21
-
22
- ### :\_refresh_cursor_
17
+ ### `:\_refresh_cursor\_`
23
18
  Will cause the named cursor to refresh, or the cursor of the interface
24
19
  which is currently in focus.
25
20
 
26
21
  Vedeu.trigger(:_refresh_cursor_, name)
27
22
 
28
- ### :\_refresh_group_
23
+ ### `:\_refresh_group\_`
29
24
  Will cause all interfaces in the named group to refresh.
30
25
 
31
26
  Vedeu.trigger(:_refresh_group_, name)
32
27
 
33
- ### :\_refresh_view_
28
+ ### `:\_refresh_view\_`
34
29
  Will cause the named view to refresh.
35
30
 
36
31
  Vedeu.trigger(:_refresh_view_, name)
37
32
 
38
- ### :\_refresh_view_content_
33
+ ### `:\_refresh_view_content\_`
39
34
  Will cause only the content of the named view to refresh.
40
35
 
41
36
  Vedeu.trigger(:_refresh_view_content_, name)