vedeu 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/docs/api.md +0 -357
- data/docs/configuration.md +1 -1
- data/docs/dsl/by_method/add_command.md +5 -0
- data/docs/dsl/by_method/add_keypress.md +4 -0
- data/docs/dsl/by_method/all_commands.md +3 -0
- data/docs/dsl/by_method/all_keypresses.md +3 -0
- data/docs/dsl/by_method/background_colours.md +4 -0
- data/docs/dsl/by_method/bind.md +43 -0
- data/docs/dsl/by_method/bind_alias.md +4 -0
- data/docs/dsl/by_method/borders.md +6 -0
- data/docs/dsl/by_method/bound.md +3 -0
- data/docs/dsl/by_method/buffer_update.md +1 -0
- data/docs/dsl/by_method/buffer_write.md +1 -0
- data/docs/dsl/by_method/buffers.md +5 -0
- data/docs/dsl/by_method/clear_by_group.md +1 -0
- data/docs/dsl/by_method/clear_by_name.md +1 -0
- data/docs/dsl/by_method/clear_content_by_name.md +1 -0
- data/docs/dsl/by_method/clock_time.md +1 -0
- data/docs/dsl/by_method/cursor.md +1 -0
- data/docs/dsl/by_method/cursors.md +1 -0
- data/docs/dsl/by_method/direct_write.md +1 -0
- data/docs/dsl/by_method/documents.md +1 -0
- data/docs/dsl/by_method/drb_restart.md +1 -0
- data/docs/dsl/by_method/drb_start.md +1 -0
- data/docs/dsl/by_method/drb_status.md +1 -0
- data/docs/dsl/by_method/drb_stop.md +1 -0
- data/docs/dsl/by_method/events.md +1 -0
- data/docs/dsl/by_method/exit.md +1 -0
- data/docs/dsl/by_method/focus.md +1 -0
- data/docs/dsl/by_method/focus_by_name.md +1 -0
- data/docs/dsl/by_method/focus_next.md +1 -0
- data/docs/dsl/by_method/focus_previous.md +1 -0
- data/docs/dsl/by_method/focussed.md +1 -0
- data/docs/dsl/by_method/geometries.md +1 -0
- data/docs/dsl/by_method/geometry.md +1 -0
- data/docs/dsl/by_method/goto.md +5 -6
- data/docs/dsl/by_method/group.md +1 -0
- data/docs/dsl/by_method/groups.md +1 -0
- data/docs/dsl/by_method/hide_cursor.md +1 -0
- data/docs/dsl/by_method/hide_group.md +1 -0
- data/docs/dsl/by_method/hide_interface.md +1 -0
- data/docs/dsl/by_method/interface.md +1 -0
- data/docs/dsl/by_method/interfaces.md +1 -0
- data/docs/dsl/by_method/keymap.md +1 -0
- data/docs/dsl/by_method/keymap/interface.md +1 -0
- data/docs/dsl/by_method/keymap/key.md +1 -0
- data/docs/dsl/by_method/keymap/name.md +1 -0
- data/docs/dsl/by_method/keymaps.md +1 -0
- data/docs/dsl/by_method/last_command.md +4 -0
- data/docs/dsl/by_method/last_keypress.md +4 -0
- data/docs/dsl/by_method/log.md +1 -0
- data/docs/dsl/by_method/log_stderr.md +1 -0
- data/docs/dsl/by_method/log_stdout.md +1 -0
- data/docs/dsl/by_method/log_timestamp.md +1 -0
- data/docs/dsl/by_method/menu.md +1 -0
- data/docs/dsl/by_method/menus.md +1 -0
- data/docs/dsl/by_method/read.md +33 -0
- data/docs/dsl/by_method/ready.md +1 -0
- data/docs/dsl/by_method/render.md +1 -0
- data/docs/dsl/by_method/render_output.md +1 -0
- data/docs/dsl/by_method/renderer.md +1 -0
- data/docs/dsl/by_method/renderers.md +1 -0
- data/docs/dsl/by_method/renders.md +1 -0
- data/docs/dsl/by_method/show_cursor.md +1 -0
- data/docs/dsl/by_method/show_group.md +1 -0
- data/docs/dsl/by_method/show_interface.md +1 -0
- data/docs/dsl/by_method/toggle_cursor.md +1 -0
- data/docs/dsl/by_method/toggle_group.md +1 -0
- data/docs/dsl/by_method/toggle_interface.md +1 -0
- data/docs/dsl/by_method/trigger.md +1 -0
- data/docs/dsl/by_method/unbind.md +5 -0
- data/docs/dsl/by_method/unbind_alias.md +4 -0
- data/docs/dsl/by_method/views.md +1 -0
- data/docs/dsl/by_method/write.md +5 -0
- data/examples/views/lines_streams.rb +45 -0
- data/lib/vedeu/application/application_view.rb +1 -1
- data/lib/vedeu/borders/border.rb +2 -2
- data/lib/vedeu/cells/border.rb +1 -1
- data/lib/vedeu/cells/borders/bottom_horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/bottom_left.rb +1 -1
- data/lib/vedeu/cells/borders/bottom_right.rb +1 -1
- data/lib/vedeu/cells/borders/horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/left_vertical.rb +1 -1
- data/lib/vedeu/cells/borders/right_vertical.rb +1 -1
- data/lib/vedeu/cells/borders/top_horizontal.rb +1 -1
- data/lib/vedeu/cells/borders/top_left.rb +1 -1
- data/lib/vedeu/cells/borders/top_right.rb +1 -1
- data/lib/vedeu/cells/borders/vertical.rb +1 -1
- data/lib/vedeu/colours/background.rb +1 -1
- data/lib/vedeu/colours/foreground.rb +1 -1
- data/lib/vedeu/colours/translator.rb +4 -7
- data/lib/vedeu/colours/validator.rb +1 -1
- data/lib/vedeu/configuration/api.rb +1 -1
- data/lib/vedeu/configuration/configuration.rb +20 -11
- data/lib/vedeu/cursors/cursor.rb +2 -2
- data/lib/vedeu/distributed/server.rb +7 -7
- data/lib/vedeu/dsl/views.rb +1 -1
- data/lib/vedeu/esc/background.rb +1 -1
- data/lib/vedeu/esc/colours.rb +3 -0
- data/lib/vedeu/esc/esc.rb +11 -25
- data/lib/vedeu/esc/mouse.rb +14 -0
- data/lib/vedeu/events/aliases.rb +2 -13
- data/lib/vedeu/events/event.rb +2 -13
- data/lib/vedeu/input/read.rb +3 -3
- data/lib/vedeu/input/store.rb +6 -37
- data/lib/vedeu/interfaces/interface.rb +1 -1
- data/lib/vedeu/logging/debug.rb +1 -1
- data/lib/vedeu/logging/log.rb +6 -17
- data/lib/vedeu/logging/timer.rb +1 -1
- data/lib/vedeu/models/row.rb +1 -1
- data/lib/vedeu/output/write.rb +1 -3
- data/lib/vedeu/presentation/style.rb +1 -3
- data/lib/vedeu/renderers/all.rb +2 -2
- data/lib/vedeu/renderers/file.rb +1 -1
- data/lib/vedeu/renderers/options.rb +1 -1
- data/lib/vedeu/runtime/application.rb +10 -19
- data/lib/vedeu/runtime/bootstrap.rb +4 -4
- data/lib/vedeu/runtime/launcher.rb +3 -5
- data/lib/vedeu/terminal/mode.rb +1 -1
- data/lib/vedeu/terminal/terminal.rb +9 -10
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/char.rb +1 -1
- data/lib/vedeu/views/view.rb +1 -1
- data/test/lib/vedeu/colours/background_test.rb +1 -1
- data/test/lib/vedeu/configuration/api_test.rb +1 -1
- data/test/lib/vedeu/cursors/cursor_test.rb +2 -5
- data/test/lib/vedeu/distributed/server_test.rb +2 -2
- data/test/lib/vedeu/esc/mouse_test.rb +29 -1
- data/test/lib/vedeu/logging/timer_test.rb +2 -2
- data/test/lib/vedeu/renderers/html_test.rb +1 -1
- data/test/lib/vedeu/renderers/json_test.rb +1 -1
- data/test/lib/vedeu/renderers/options_test.rb +4 -4
- data/test/lib/vedeu/runtime/application_test.rb +4 -9
- data/test/lib/vedeu/runtime/bootstrap_test.rb +1 -1
- data/test/lib/vedeu/runtime/launcher_test.rb +1 -1
- data/test/lib/vedeu/terminal/mode_test.rb +5 -5
- data/test/lib/vedeu/terminal/terminal_test.rb +2 -2
- data/test/support/examples/material_colours_app.rb +2 -5
- data/test/test_helper.rb +1 -1
- metadata +5 -3
- data/examples/views/lines_streams_stream.rb +0 -48
data/docs/dsl/by_method/bind.md
CHANGED
@@ -0,0 +1,43 @@
|
|
1
|
+
Register an event by name with optional delay (throttling)
|
2
|
+
which when triggered will execute the code contained within
|
3
|
+
the passed block.
|
4
|
+
|
5
|
+
@param name [Symbol] The name of the event to be triggered
|
6
|
+
later.
|
7
|
+
@param options [Hash<Symbol => void>] The options to
|
8
|
+
register the event with.
|
9
|
+
@option options :delay [Fixnum|Float] Limits the execution
|
10
|
+
of the triggered event to only execute when first
|
11
|
+
triggered, with subsequent triggering being ignored until
|
12
|
+
the delay has expired.
|
13
|
+
@option options :debounce [Fixnum|Float] Limits the
|
14
|
+
execution of the triggered event to only execute once the
|
15
|
+
debounce has expired. Subsequent triggers before debounce
|
16
|
+
expiry are ignored.
|
17
|
+
@param block [Proc] The event to be executed when triggered.
|
18
|
+
This block could be a method call, or the triggering of
|
19
|
+
another event, or sequence of either/both.
|
20
|
+
|
21
|
+
Vedeu.bind :my_event do |some, args|
|
22
|
+
# ... some code here ...
|
23
|
+
Vedeu.trigger(:my_other_event)
|
24
|
+
end
|
25
|
+
|
26
|
+
T = Triggered, X = Executed, i = Ignored.
|
27
|
+
0.0.....0.2.....0.4.....0.6.....0.8.....1.0.....1.2.....1.4.....1.6.
|
28
|
+
.T...T...T...T...T...T...T...T...T...T...T...T...T...T...T...T...T..
|
29
|
+
.X...i...i...i...i...X...i...i...i...i...X...i...i...i...i...i...i..
|
30
|
+
|
31
|
+
Vedeu.bind(:my_delayed_event, { delay: 0.5 })
|
32
|
+
# ... some code here ...
|
33
|
+
end
|
34
|
+
|
35
|
+
T = Triggered, X = Executed, i = Ignored.
|
36
|
+
0.0.....0.2.....0.4.....0.6.....0.8.....1.0.....1.2.....1.4.....1.6.
|
37
|
+
.T...T...T...T...T...T...T...T...T...T...T...T...T...T...T...T...T..
|
38
|
+
.i...i...i...i...i...i...i...X...i...i...i...i...i...i...X...i...i..
|
39
|
+
|
40
|
+
Vedeu.bind(:my_debounced_event, { debounce: 0.7 })
|
41
|
+
# ... some code here ...
|
42
|
+
end
|
43
|
+
|
data/docs/dsl/by_method/bound.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/exit.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/focus.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/goto.md
CHANGED
@@ -1,6 +1,5 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
#
|
1
|
+
Instruct Vedeu to load the client application controller action with
|
2
|
+
parameters.
|
3
|
+
|
4
|
+
Vedeu.goto(controller, action, args)
|
5
|
+
|
data/docs/dsl/by_method/group.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/log.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/menu.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/menus.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/read.md
CHANGED
@@ -0,0 +1,33 @@
|
|
1
|
+
### Vedeu.read
|
2
|
+
|
3
|
+
This allows the direct reading from the terminal, unencumbered by the
|
4
|
+
framework.
|
5
|
+
|
6
|
+
Vedeu.read("some input here") # => programmatic cooked mode
|
7
|
+
# (default)
|
8
|
+
|
9
|
+
Vedeu.read("\e[24;2~", mode: :raw) # => programmatic raw mode
|
10
|
+
# (provides :shift_f12 in
|
11
|
+
# this example)
|
12
|
+
|
13
|
+
Vedeu.read(nil, mode: :raw) # => for a single keypress
|
14
|
+
|
15
|
+
Vedeu.read(nil, mode: :cooked) # => (default mode) for a 'line at
|
16
|
+
# a time' (pressing 'return'
|
17
|
+
# ends the line)
|
18
|
+
|
19
|
+
The way that these are used will depend on the mode your terminal is currently set to. Vedeu by default sets this to `:raw` (single character, hidden cursor). `Vedeu.read` by default expects the terminal to be in `:cooked` mode unless you provide the `mode: :raw` option.
|
20
|
+
|
21
|
+
- In `:cooked` mode (default), it will trigger a `:_command_` event
|
22
|
+
with the input provided, meaning you should bind to :command to
|
23
|
+
receive the input.
|
24
|
+
- In `:raw` mode, it will trigger a `:_keypress_` event with the input
|
25
|
+
provided, meaning you should bind to `:key` to receive the input.
|
26
|
+
|
27
|
+
You can also access the input given using the API methods:
|
28
|
+
|
29
|
+
Vedeu.all_commands
|
30
|
+
Vedeu.all_keypresses
|
31
|
+
Vedeu.last_command
|
32
|
+
Vedeu.last_keypress
|
33
|
+
|
data/docs/dsl/by_method/ready.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/views.md
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
@todo Add more documentation.
|
data/docs/dsl/by_method/write.md
CHANGED
@@ -28,6 +28,36 @@ class DSLApp
|
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
31
|
+
Vedeu.interface :help1_interface do
|
32
|
+
geometry do
|
33
|
+
x use(:test1_interface).x
|
34
|
+
y use(:test1_interface).south
|
35
|
+
xn use(:test1_interface).xn
|
36
|
+
yn use(:test1_interface).south(3)
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
Vedeu.interface :test2_interface do
|
41
|
+
border do
|
42
|
+
title 'Test 2'
|
43
|
+
end
|
44
|
+
geometry do
|
45
|
+
x use(:test1_interface).east(6)
|
46
|
+
y use(:test1_interface).y
|
47
|
+
width use(:test1_interface).width
|
48
|
+
height use(:test1_interface).height
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
Vedeu.interface :help2_interface do
|
53
|
+
geometry do
|
54
|
+
x use(:test2_interface).x
|
55
|
+
y use(:test2_interface).south
|
56
|
+
xn use(:test2_interface).xn
|
57
|
+
yn use(:test2_interface).south(3)
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
31
61
|
Vedeu.render do
|
32
62
|
view(:test1_interface) do
|
33
63
|
lines do
|
@@ -37,6 +67,21 @@ class DSLApp
|
|
37
67
|
end
|
38
68
|
end
|
39
69
|
end
|
70
|
+
|
71
|
+
view(:help1_interface) do
|
72
|
+
end
|
73
|
+
|
74
|
+
view(:test2_interface) do
|
75
|
+
lines do
|
76
|
+
streams do
|
77
|
+
stream 'v->ls->ss->stream 1', { foreground: '#00ff00' }
|
78
|
+
stream 'v->ls->ss->stream 2', { foreground: '#ff0000' }
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
83
|
+
view(:help2_interface) do
|
84
|
+
end
|
40
85
|
end
|
41
86
|
|
42
87
|
def self.start(argv = ARGV)
|
data/lib/vedeu/borders/border.rb
CHANGED
@@ -302,7 +302,7 @@ module Vedeu
|
|
302
302
|
client: nil,
|
303
303
|
colour: nil,
|
304
304
|
enabled: false,
|
305
|
-
horizontal: Vedeu
|
305
|
+
horizontal: Vedeu.esc.horizontal,
|
306
306
|
left_vertical: nil,
|
307
307
|
name: '',
|
308
308
|
parent: nil,
|
@@ -317,7 +317,7 @@ module Vedeu
|
|
317
317
|
top_horizontal: nil,
|
318
318
|
top_left: nil,
|
319
319
|
top_right: nil,
|
320
|
-
vertical: Vedeu
|
320
|
+
vertical: Vedeu.esc.vertical,
|
321
321
|
}
|
322
322
|
end
|
323
323
|
|
data/lib/vedeu/cells/border.rb
CHANGED