vedeu 0.8.7 → 0.8.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/TODO.md +8 -0
- data/docs/dsl/by_method/buffer_update.md +3 -1
- data/docs/dsl/by_method/buffer_write.md +3 -1
- data/docs/dsl/by_method/cursor.md +3 -1
- data/docs/dsl/by_method/cursors.md +3 -1
- data/docs/dsl/by_method/direct_write.md +3 -1
- data/docs/dsl/by_method/log_stderr.md +4 -1
- data/docs/dsl/by_method/log_stdout.md +4 -1
- data/docs/dsl/by_method/log_timestamp.md +7 -1
- data/docs/dsl/by_method/render_output.md +3 -1
- data/docs/events/by_name/{geometry_down.md → aliases/geometry_down.md} +0 -0
- data/docs/events/by_name/{geometry_left.md → aliases/geometry_left.md} +0 -0
- data/docs/events/by_name/{geometry_right.md → aliases/geometry_right.md} +0 -0
- data/docs/events/by_name/{geometry_up.md → aliases/geometry_up.md} +0 -0
- data/docs/events/by_name/cursor_down.md +5 -0
- data/docs/events/by_name/cursor_left.md +3 -0
- data/docs/events/by_name/cursor_origin.md +3 -0
- data/docs/events/by_name/cursor_right.md +5 -0
- data/docs/events/by_name/cursor_top.md +3 -0
- data/docs/events/by_name/cursor_up.md +3 -0
- data/docs/events/by_name/hide_cursor.md +6 -1
- data/docs/events/by_name/maximise.md +2 -3
- data/docs/events/by_name/show_cursor.md +6 -1
- data/docs/events/by_name/unmaximise.md +5 -3
- data/docs/events/by_name/view_down.md +8 -0
- data/docs/events/by_name/view_left.md +8 -0
- data/docs/events/by_name/view_right.md +8 -0
- data/docs/events/by_name/view_up.md +8 -0
- data/docs/events/document.md +2 -1
- data/docs/events/focus.md +2 -1
- data/docs/events/menu.md +2 -1
- data/docs/events/movement.md +2 -1
- data/docs/events/refresh.md +2 -1
- data/docs/events/view.md +2 -1
- data/docs/events/visibility.md +2 -1
- data/examples/dsl_horizontal_alignment.rb +1 -1
- data/examples/dsl_vertical_alignment.rb +1 -1
- data/integrations/dsl_app_border_001.rb +63 -0
- data/integrations/dsl_app_border_002.rb +63 -0
- data/integrations/dsl_app_border_003.rb +63 -0
- data/integrations/dsl_app_border_004.rb +63 -0
- data/integrations/dsl_app_border_005.rb +63 -0
- data/integrations/expected/dsl_app_border_001.out +1 -0
- data/integrations/expected/dsl_app_border_002.out +1 -0
- data/integrations/expected/dsl_app_border_003.out +1 -0
- data/integrations/expected/dsl_app_border_004.out +1 -0
- data/integrations/expected/dsl_app_border_005.out +1 -0
- data/integrations/test_runner.sh +7 -0
- data/lib/vedeu.rb +2 -1
- data/lib/vedeu/borders/repository.rb +1 -5
- data/lib/vedeu/cursors/cursor.rb +29 -70
- data/lib/vedeu/cursors/move.rb +11 -4
- data/lib/vedeu/cursors/reposition.rb +2 -2
- data/lib/vedeu/cursors/repository.rb +7 -12
- data/lib/vedeu/dsl/elements.rb +0 -1
- data/lib/vedeu/error.rb +17 -5
- data/lib/vedeu/geometries/dsl/dsl.rb +2 -28
- data/lib/vedeu/geometries/dsl/grid.rb +2 -0
- data/lib/vedeu/geometries/geometry.rb +2 -22
- data/lib/vedeu/geometries/move.rb +45 -10
- data/lib/vedeu/geometries/repository.rb +0 -20
- data/lib/vedeu/input/capture.rb +2 -1
- data/lib/vedeu/logging/log.rb +25 -25
- data/lib/vedeu/renderers/file.rb +0 -5
- data/lib/vedeu/renderers/json.rb +1 -1
- data/lib/vedeu/renderers/options.rb +3 -1
- data/lib/vedeu/renderers/text.rb +0 -7
- data/lib/vedeu/runtime/bootstrap.rb +1 -1
- data/lib/vedeu/runtime/launcher.rb +8 -5
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/application/application_controller_test.rb +2 -4
- data/test/lib/vedeu/cursors/cursor_test.rb +9 -12
- data/test/lib/vedeu/cursors/move_test.rb +7 -3
- data/test/lib/vedeu/geometries/move_test.rb +22 -9
- data/test/lib/vedeu/interfaces/interface_test.rb +71 -73
- data/test/lib/vedeu/logging/log_test.rb +1 -1
- data/test/lib/vedeu/runtime/launcher_test.rb +5 -4
- data/test/support/examples/material_colours_app.rb +59 -8
- data/test/test_helper.rb +1 -0
- metadata +16 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8abebd20481d927ef3b7de1f4a21c566109fcb5a
|
4
|
+
data.tar.gz: 3db48c0f3218d6d534cf731f256084e6a98efb91
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6555ade9af405d42797525c9ce496d4e6f105babf54d6edbfe5cf2fcbc618b71823b9709544fca60c8c2a853918d4d259dc372ca56bf037061d351add0f5016
|
7
|
+
data.tar.gz: 057a89420029e115a3a87bcdc56872d0e01b0149e08c4d29899870632a0e989377b09b295bf7be4f94f4e8ed8800c1fec1a59292cb635696bca7d2604edee9c5
|
data/TODO.md
CHANGED
@@ -2,3 +2,11 @@
|
|
2
2
|
|
3
3
|
- Add Vedeu::Index which converts a Vedeu::Point to an array index.
|
4
4
|
i.e. Never less than 0, always 1 less than the Vedeu::Point value.
|
5
|
+
|
6
|
+
## 2016-01-11
|
7
|
+
|
8
|
+
- Investigate the differences between memoizing in
|
9
|
+
Vedeu::Geometries::Geometry#area and not memoizing. Memoizing saves
|
10
|
+
~80ms on running test suite and considerably impacts app
|
11
|
+
responsiveness, however changes to the geometry (such as movement or
|
12
|
+
maximising) are not reflected.
|
@@ -1 +1,7 @@
|
|
1
|
-
|
1
|
+
Returns a formatted timestamp indicating the number of seconds the
|
2
|
+
client application has been running.
|
3
|
+
|
4
|
+
The first time this method is called, it will return `[ 0.0000] `.
|
5
|
+
Subsequent calls will be relative to this first time entry.
|
6
|
+
|
7
|
+
Vedeu.log_timestamp # => [137.7842]
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,4 +1,9 @@
|
|
1
1
|
### `:_cursor_down_`
|
2
|
+
Moves the cursor one line down, unless the bottom-most position for
|
3
|
+
the view or terminal is reached.
|
2
4
|
|
3
5
|
Vedeu.trigger(:_cursor_down_, name)
|
4
6
|
Vedeu.trigger(:_cursor_down_, Vedeu.focus)
|
7
|
+
|
8
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
9
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
@@ -3,4 +3,7 @@ This event moves the cursor to the interface origin; the top left
|
|
3
3
|
corner of the named interface.
|
4
4
|
|
5
5
|
Vedeu.trigger(:_cursor_origin_, name)
|
6
|
+
Vedeu.trigger(:_cursor_origin_, Vedeu.focus)
|
7
|
+
|
6
8
|
Vedeu.trigger(:_cursor_reset_, name)
|
9
|
+
Vedeu.trigger(:_cursor_reset_, Vedeu.focus)
|
@@ -1,4 +1,9 @@
|
|
1
1
|
### `:_cursor_right_`
|
2
|
+
Moves the cursor one character to the right, unless the right-most
|
3
|
+
position for the view or terminal is reached.
|
2
4
|
|
3
5
|
Vedeu.trigger(:_cursor_right_, name)
|
4
6
|
Vedeu.trigger(:_cursor_right_, Vedeu.focus)
|
7
|
+
|
8
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
9
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
@@ -1,10 +1,15 @@
|
|
1
1
|
### Vedeu.hide_cursor / `:_hide_cursor_`
|
2
|
-
Hide the cursor
|
2
|
+
Hide a named cursor, or without a name, the cursor of the currently
|
3
|
+
focussed interface.
|
3
4
|
|
4
5
|
Vedeu.trigger(:_hide_cursor_, name)
|
5
6
|
Vedeu.trigger(:_hide_cursor_, Vedeu.focus)
|
7
|
+
Vedeu.trigger(:_hide_cursor_)
|
8
|
+
|
6
9
|
Vedeu.trigger(:_cursor_hide_, name)
|
7
10
|
Vedeu.trigger(:_cursor_hide_, Vedeu.focus)
|
11
|
+
Vedeu.trigger(:_cursor_hide_)
|
8
12
|
|
9
13
|
Vedeu.hide_cursor(name)
|
10
14
|
Vedeu.hide_cursor(Vedeu.focus)
|
15
|
+
Vedeu.hide_cursor
|
@@ -1,10 +1,15 @@
|
|
1
1
|
### Vedeu.show_cursor / `:_show_cursor_`
|
2
|
-
Show the cursor
|
2
|
+
Show a named cursor, or without a name, the cursor of the currently
|
3
|
+
focussed interface.
|
3
4
|
|
4
5
|
Vedeu.trigger(:_show_cursor_, name)
|
5
6
|
Vedeu.trigger(:_show_cursor_, Vedeu.focus)
|
7
|
+
Vedeu.trigger(:_show_cursor_)
|
8
|
+
|
6
9
|
Vedeu.trigger(:_cursor_show_, name)
|
7
10
|
Vedeu.trigger(:_cursor_show_, Vedeu.focus)
|
11
|
+
Vedeu.trigger(:_cursor_show_)
|
8
12
|
|
9
13
|
Vedeu.show_cursor(name)
|
10
14
|
Vedeu.show_cursor(Vedeu.focus)
|
15
|
+
Vedeu.show_cursor
|
@@ -1,6 +1,8 @@
|
|
1
1
|
### `:_unmaximise_`
|
2
|
-
|
2
|
+
Will unmaximise the named interface geometry. Previously, when a
|
3
|
+
geometry was maximised, then triggering the unmaximise event will
|
4
|
+
return it to its usual defined size (terminal size permitting: when
|
5
|
+
the terminal has been resized, then the new geometry size should
|
6
|
+
adapt).
|
3
7
|
|
4
8
|
Vedeu.trigger(:_unmaximise_, name)
|
5
|
-
|
6
|
-
See {Vedeu::Geometries::Geometry#unmaximise}
|
@@ -1,4 +1,12 @@
|
|
1
1
|
### `:_view_down_`
|
2
|
+
Moves the view one row/line down, unless the bottom/last row/line for
|
3
|
+
the terminal is reached.
|
2
4
|
|
3
5
|
Vedeu.trigger(:_view_down_, name)
|
4
6
|
Vedeu.trigger(:_view_down_, Vedeu.focus)
|
7
|
+
|
8
|
+
Vedeu.trigger(:_geometry_down_, name)
|
9
|
+
Vedeu.trigger(:_geometry_down_, Vedeu.focus)
|
10
|
+
|
11
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
12
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
@@ -1,4 +1,12 @@
|
|
1
1
|
### `:_view_left_`
|
2
|
+
Moves the view one column/character left, unless the left-most
|
3
|
+
column/character for the terminal is reached.
|
2
4
|
|
3
5
|
Vedeu.trigger(:_view_left_, name)
|
4
6
|
Vedeu.trigger(:_view_left_, Vedeu.focus)
|
7
|
+
|
8
|
+
Vedeu.trigger(:_geometry_left_, name)
|
9
|
+
Vedeu.trigger(:_geometry_left_, Vedeu.focus)
|
10
|
+
|
11
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
12
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
@@ -1,4 +1,12 @@
|
|
1
1
|
### `:_view_right_`
|
2
|
+
Moves the view one row/line right, unless the right-most row/line for
|
3
|
+
the terminal is reached.
|
2
4
|
|
3
5
|
Vedeu.trigger(:_view_right_, name)
|
4
6
|
Vedeu.trigger(:_view_right_, Vedeu.focus)
|
7
|
+
|
8
|
+
Vedeu.trigger(:_geometry_right_, name)
|
9
|
+
Vedeu.trigger(:_geometry_right_, Vedeu.focus)
|
10
|
+
|
11
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
12
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
@@ -1,4 +1,12 @@
|
|
1
1
|
### `:_view_up_`
|
2
|
+
Moves the view one row/line up, unless the top/first row/line for
|
3
|
+
the terminal is reached.
|
2
4
|
|
3
5
|
Vedeu.trigger(:_view_up_, name)
|
4
6
|
Vedeu.trigger(:_view_up_, Vedeu.focus)
|
7
|
+
|
8
|
+
Vedeu.trigger(:_geometry_up_, name)
|
9
|
+
Vedeu.trigger(:_geometry_up_, Vedeu.focus)
|
10
|
+
|
11
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
12
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
data/docs/events/document.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## Document Events
|
4
4
|
|
5
|
-
Note:
|
5
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
6
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
6
7
|
|
7
8
|
{include:file:docs/events/by_name/editor_execute.md}
|
8
9
|
|
data/docs/events/focus.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## Focus Events
|
4
4
|
|
5
|
-
Note:
|
5
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
6
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
6
7
|
|
7
8
|
{include:file:docs/events/by_name/focus_by_name.md}
|
8
9
|
|
data/docs/events/menu.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## Menu Events
|
4
4
|
|
5
|
-
Note:
|
5
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
6
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
6
7
|
|
7
8
|
{include:file:docs/events/by_name/menu_bottom.md}
|
8
9
|
|
data/docs/events/movement.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## Movement Events
|
4
4
|
|
5
|
-
Note:
|
5
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
6
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
6
7
|
|
7
8
|
For cursor related movement events, please refer to
|
8
9
|
{file:docs/cursors.md} Cursors.
|
data/docs/events/refresh.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## Refresh Events
|
4
4
|
|
5
|
-
Note:
|
5
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
6
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
6
7
|
|
7
8
|
{include:file:docs/events/by_name/refresh.md}
|
8
9
|
|
data/docs/events/view.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## View Events
|
4
4
|
|
5
|
-
Note:
|
5
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
6
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
6
7
|
|
7
8
|
{include:file:docs/events/by_name/maximise.md}
|
8
9
|
|
data/docs/events/visibility.md
CHANGED
@@ -2,7 +2,8 @@
|
|
2
2
|
|
3
3
|
## Visibility Events
|
4
4
|
|
5
|
-
Note:
|
5
|
+
Note: `name` is a Symbol unless mentioned otherwise, and can be
|
6
|
+
substituted for `Vedeu.focus` to use the interface currently in focus.
|
6
7
|
|
7
8
|
{include:file:docs/events/by_name/clear.md}
|
8
9
|
|
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
require 'bundler/setup'
|
6
|
+
require 'vedeu'
|
7
|
+
|
8
|
+
class DSLApp
|
9
|
+
|
10
|
+
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
11
|
+
|
12
|
+
Vedeu.configure do
|
13
|
+
debug!
|
14
|
+
log '/tmp/vedeu_views_dsl.log'
|
15
|
+
renderers [
|
16
|
+
Vedeu::Renderers::Terminal.new(
|
17
|
+
filename: '/tmp/dsl_app_border_001.out',
|
18
|
+
write_file: true),
|
19
|
+
# Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_border_001.json'),
|
20
|
+
# Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_border_001.html'),
|
21
|
+
# Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_border_001.txt'),
|
22
|
+
]
|
23
|
+
run_once!
|
24
|
+
standalone!
|
25
|
+
end
|
26
|
+
|
27
|
+
load './support/test_interface.rb'
|
28
|
+
|
29
|
+
Vedeu.border :test_interface do
|
30
|
+
disable!
|
31
|
+
end
|
32
|
+
|
33
|
+
Vedeu.render do
|
34
|
+
view(:test_interface) do
|
35
|
+
lines do
|
36
|
+
line 'border off'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.actual
|
42
|
+
File.read('/tmp/dsl_app_border_001.out')
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.expected
|
46
|
+
File.read(File.expand_path('../expected/dsl_app_border_001.out', __FILE__))
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.start(argv = ARGV)
|
50
|
+
Vedeu::Launcher.execute!(argv)
|
51
|
+
end
|
52
|
+
|
53
|
+
end # DSLApp
|
54
|
+
|
55
|
+
DSLApp.start
|
56
|
+
|
57
|
+
if DSLApp.expected == DSLApp.actual
|
58
|
+
puts "#{__FILE__} \e[32mPassed.\e[39m"
|
59
|
+
exit 0;
|
60
|
+
else
|
61
|
+
puts "#{__FILE__} \e[31mFailed.\e[39m"
|
62
|
+
exit 1;
|
63
|
+
end
|
@@ -0,0 +1,63 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
# frozen_string_literal: true
|
4
|
+
|
5
|
+
require 'bundler/setup'
|
6
|
+
require 'vedeu'
|
7
|
+
|
8
|
+
class DSLApp
|
9
|
+
|
10
|
+
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
11
|
+
|
12
|
+
Vedeu.configure do
|
13
|
+
debug!
|
14
|
+
log '/tmp/vedeu_views_dsl.log'
|
15
|
+
renderers [
|
16
|
+
Vedeu::Renderers::Terminal.new(
|
17
|
+
filename: '/tmp/dsl_app_border_002.out',
|
18
|
+
write_file: true),
|
19
|
+
# Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_border_002.json'),
|
20
|
+
# Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_border_002.html'),
|
21
|
+
# Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_border_002.txt'),
|
22
|
+
]
|
23
|
+
run_once!
|
24
|
+
standalone!
|
25
|
+
end
|
26
|
+
|
27
|
+
load './support/test_interface.rb'
|
28
|
+
|
29
|
+
Vedeu.border :test_interface do
|
30
|
+
show_top false
|
31
|
+
end
|
32
|
+
|
33
|
+
Vedeu.render do
|
34
|
+
view(:test_interface) do
|
35
|
+
lines do
|
36
|
+
line 'no top'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.actual
|
42
|
+
File.read('/tmp/dsl_app_border_002.out')
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.expected
|
46
|
+
File.read(File.expand_path('../expected/dsl_app_border_002.out', __FILE__))
|
47
|
+
end
|
48
|
+
|
49
|
+
def self.start(argv = ARGV)
|
50
|
+
Vedeu::Launcher.execute!(argv)
|
51
|
+
end
|
52
|
+
|
53
|
+
end # DSLApp
|
54
|
+
|
55
|
+
DSLApp.start
|
56
|
+
|
57
|
+
if DSLApp.expected == DSLApp.actual
|
58
|
+
puts "#{__FILE__} \e[32mPassed.\e[39m"
|
59
|
+
exit 0;
|
60
|
+
else
|
61
|
+
puts "#{__FILE__} \e[31mFailed.\e[39m"
|
62
|
+
exit 1;
|
63
|
+
end
|