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
@@ -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_003.out',
|
18
|
+
write_file: true),
|
19
|
+
# Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_border_003.json'),
|
20
|
+
# Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_border_003.html'),
|
21
|
+
# Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_border_003.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_right false
|
31
|
+
end
|
32
|
+
|
33
|
+
Vedeu.render do
|
34
|
+
view(:test_interface) do
|
35
|
+
lines do
|
36
|
+
line 'no right'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.actual
|
42
|
+
File.read('/tmp/dsl_app_border_003.out')
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.expected
|
46
|
+
File.read(File.expand_path('../expected/dsl_app_border_003.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_004.out',
|
18
|
+
write_file: true),
|
19
|
+
# Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_border_004.json'),
|
20
|
+
# Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_border_004.html'),
|
21
|
+
# Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_border_004.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_bottom false
|
31
|
+
end
|
32
|
+
|
33
|
+
Vedeu.render do
|
34
|
+
view(:test_interface) do
|
35
|
+
lines do
|
36
|
+
line 'no bottom'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.actual
|
42
|
+
File.read('/tmp/dsl_app_border_004.out')
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.expected
|
46
|
+
File.read(File.expand_path('../expected/dsl_app_border_004.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_005.out',
|
18
|
+
write_file: true),
|
19
|
+
# Vedeu::Renderers::JSON.new(filename: '/tmp/dsl_app_border_005.json'),
|
20
|
+
# Vedeu::Renderers::HTML.new(filename: '/tmp/dsl_app_border_005.html'),
|
21
|
+
# Vedeu::Renderers::Text.new(filename: '/tmp/dsl_app_border_005.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_left false
|
31
|
+
end
|
32
|
+
|
33
|
+
Vedeu.render do
|
34
|
+
view(:test_interface) do
|
35
|
+
lines do
|
36
|
+
line 'no left'
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
def self.actual
|
42
|
+
File.read('/tmp/dsl_app_border_005.out')
|
43
|
+
end
|
44
|
+
|
45
|
+
def self.expected
|
46
|
+
File.read(File.expand_path('../expected/dsl_app_border_005.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 @@
|
|
1
|
+
[0m[2;2H[39m[49mb[2;3Ho[2;4Hr[2;5Hd[2;6He[2;7Hr[2;8H [2;9Ho[2;10Hf[2;11Hf[2;12H [2;13H [2;14H [2;15H [2;16H [2;17H [2;18H [2;19H [2;20H [2;21H [2;22H [2;23H [2;24H [2;25H [2;26H [2;27H [2;28H [2;29H [2;30H [2;31H [2;32H [0m[3;2H[39m[49m [3;3H [3;4H [3;5H [3;6H [3;7H [3;8H [3;9H [3;10H [3;11H [3;12H [3;13H [3;14H [3;15H [3;16H [3;17H [3;18H [3;19H [3;20H [3;21H [3;22H [3;23H [3;24H [3;25H [3;26H [3;27H [3;28H [3;29H [3;30H [3;31H [3;32H [0m[4;2H[39m[49m [4;3H [4;4H [4;5H [4;6H [4;7H [4;8H [4;9H [4;10H [4;11H [4;12H [4;13H [4;14H [4;15H [4;16H [4;17H [4;18H [4;19H [4;20H [4;21H [4;22H [4;23H [4;24H [4;25H [4;26H [4;27H [4;28H [4;29H [4;30H [4;31H [4;32H [0m[5;2H[39m[49m [5;3H [5;4H [5;5H [5;6H [5;7H [5;8H [5;9H [5;10H [5;11H [5;12H [5;13H [5;14H [5;15H [5;16H [5;17H [5;18H [5;19H [5;20H [5;21H [5;22H [5;23H [5;24H [5;25H [5;26H [5;27H [5;28H [5;29H [5;30H [5;31H [5;32H [0m[6;2H[39m[49m [6;3H [6;4H [6;5H [6;6H [6;7H [6;8H [6;9H [6;10H [6;11H [6;12H [6;13H [6;14H [6;15H [6;16H [6;17H [6;18H [6;19H [6;20H [6;21H [6;22H [6;23H [6;24H [6;25H [6;26H [6;27H [6;28H [6;29H [6;30H [6;31H [6;32H [0m
|
@@ -0,0 +1 @@
|
|
1
|
+
[0m[2;2H[39m[49m(0x(B[2;3Hn[2;4Ho[2;5H [2;6Ht[2;7Ho[2;8Hp[2;9H [2;10H [2;11H [2;12H [2;13H [2;14H [2;15H [2;16H [2;17H [2;18H [2;19H [2;20H [2;21H [2;22H [2;23H [2;24H [2;25H [2;26H [2;27H [2;28H [2;29H [2;30H [2;31H [2;32H(0x(B[0m[3;2H[39m[49m(0x(B[3;3H [3;4H [3;5H [3;6H [3;7H [3;8H [3;9H [3;10H [3;11H [3;12H [3;13H [3;14H [3;15H [3;16H [3;17H [3;18H [3;19H [3;20H [3;21H [3;22H [3;23H [3;24H [3;25H [3;26H [3;27H [3;28H [3;29H [3;30H [3;31H [3;32H(0x(B[0m[4;2H[39m[49m(0x(B[4;3H [4;4H [4;5H [4;6H [4;7H [4;8H [4;9H [4;10H [4;11H [4;12H [4;13H [4;14H [4;15H [4;16H [4;17H [4;18H [4;19H [4;20H [4;21H [4;22H [4;23H [4;24H [4;25H [4;26H [4;27H [4;28H [4;29H [4;30H [4;31H [4;32H(0x(B[0m[5;2H[39m[49m(0x(B[5;3H [5;4H [5;5H [5;6H [5;7H [5;8H [5;9H [5;10H [5;11H [5;12H [5;13H [5;14H [5;15H [5;16H [5;17H [5;18H [5;19H [5;20H [5;21H [5;22H [5;23H [5;24H [5;25H [5;26H [5;27H [5;28H [5;29H [5;30H [5;31H [5;32H(0x(B[0m[6;2H[39m[49m(0m(B[6;3H(0q(B[6;4H(0q(B[6;5H(0q(B[6;6H(0q(B[6;7H(0q(B[6;8H(0q(B[6;9H(0q(B[6;10H(0q(B[6;11H(0q(B[6;12H(0q(B[6;13H(0q(B[6;14H(0q(B[6;15H(0q(B[6;16H(0q(B[6;17H(0q(B[6;18H(0q(B[6;19H(0q(B[6;20H(0q(B[6;21H(0q(B[6;22H(0q(B[6;23H(0q(B[6;24H(0q(B[6;25H(0q(B[6;26H(0q(B[6;27H(0q(B[6;28H(0q(B[6;29H(0q(B[6;30H(0q(B[6;31H(0q(B[6;32H(0j(B[0m
|
@@ -0,0 +1 @@
|
|
1
|
+
[0m[2;2H[39m[49m(0l(B[2;3H(0q(B[2;4H(0q(B[2;5H(0q(B[2;6H(0q(B[2;7H(0q(B[2;8H(0q(B[2;9H(0q(B[2;10H(0q(B[2;11H(0q(B[2;12H(0q(B[2;13H(0q(B[2;14H(0q(B[2;15H(0q(B[2;16H(0q(B[2;17H(0q(B[2;18H(0q(B[2;19H(0q(B[2;20H(0q(B[2;21H(0q(B[2;22H(0q(B[2;23H(0q(B[2;24H(0q(B[2;25H(0q(B[2;26H(0q(B[2;27H(0q(B[2;28H(0q(B[2;29H(0q(B[2;30H(0q(B[2;31H(0q(B[2;32H(0q(B[0m[3;2H[39m[49m(0x(B[3;3Hn[3;4Ho[3;5H [3;6Hr[3;7Hi[3;8Hg[3;9Hh[3;10Ht[3;11H [3;12H [3;13H [3;14H [3;15H [3;16H [3;17H [3;18H [3;19H [3;20H [3;21H [3;22H [3;23H [3;24H [3;25H [3;26H [3;27H [3;28H [3;29H [3;30H [3;31H [3;32H [0m[4;2H[39m[49m(0x(B[4;3H [4;4H [4;5H [4;6H [4;7H [4;8H [4;9H [4;10H [4;11H [4;12H [4;13H [4;14H [4;15H [4;16H [4;17H [4;18H [4;19H [4;20H [4;21H [4;22H [4;23H [4;24H [4;25H [4;26H [4;27H [4;28H [4;29H [4;30H [4;31H [4;32H [0m[5;2H[39m[49m(0x(B[5;3H [5;4H [5;5H [5;6H [5;7H [5;8H [5;9H [5;10H [5;11H [5;12H [5;13H [5;14H [5;15H [5;16H [5;17H [5;18H [5;19H [5;20H [5;21H [5;22H [5;23H [5;24H [5;25H [5;26H [5;27H [5;28H [5;29H [5;30H [5;31H [5;32H [0m[6;2H[39m[49m(0m(B[6;3H(0q(B[6;4H(0q(B[6;5H(0q(B[6;6H(0q(B[6;7H(0q(B[6;8H(0q(B[6;9H(0q(B[6;10H(0q(B[6;11H(0q(B[6;12H(0q(B[6;13H(0q(B[6;14H(0q(B[6;15H(0q(B[6;16H(0q(B[6;17H(0q(B[6;18H(0q(B[6;19H(0q(B[6;20H(0q(B[6;21H(0q(B[6;22H(0q(B[6;23H(0q(B[6;24H(0q(B[6;25H(0q(B[6;26H(0q(B[6;27H(0q(B[6;28H(0q(B[6;29H(0q(B[6;30H(0q(B[6;31H(0q(B[6;32H(0q(B[0m
|
@@ -0,0 +1 @@
|
|
1
|
+
[0m[2;2H[39m[49m(0l(B[2;3H(0q(B[2;4H(0q(B[2;5H(0q(B[2;6H(0q(B[2;7H(0q(B[2;8H(0q(B[2;9H(0q(B[2;10H(0q(B[2;11H(0q(B[2;12H(0q(B[2;13H(0q(B[2;14H(0q(B[2;15H(0q(B[2;16H(0q(B[2;17H(0q(B[2;18H(0q(B[2;19H(0q(B[2;20H(0q(B[2;21H(0q(B[2;22H(0q(B[2;23H(0q(B[2;24H(0q(B[2;25H(0q(B[2;26H(0q(B[2;27H(0q(B[2;28H(0q(B[2;29H(0q(B[2;30H(0q(B[2;31H(0q(B[2;32H(0k(B[0m[3;2H[39m[49m(0x(B[3;3Hn[3;4Ho[3;5H [3;6Hb[3;7Ho[3;8Ht[3;9Ht[3;10Ho[3;11Hm[3;12H [3;13H [3;14H [3;15H [3;16H [3;17H [3;18H [3;19H [3;20H [3;21H [3;22H [3;23H [3;24H [3;25H [3;26H [3;27H [3;28H [3;29H [3;30H [3;31H [3;32H(0x(B[0m[4;2H[39m[49m(0x(B[4;3H [4;4H [4;5H [4;6H [4;7H [4;8H [4;9H [4;10H [4;11H [4;12H [4;13H [4;14H [4;15H [4;16H [4;17H [4;18H [4;19H [4;20H [4;21H [4;22H [4;23H [4;24H [4;25H [4;26H [4;27H [4;28H [4;29H [4;30H [4;31H [4;32H(0x(B[0m[5;2H[39m[49m(0x(B[5;3H [5;4H [5;5H [5;6H [5;7H [5;8H [5;9H [5;10H [5;11H [5;12H [5;13H [5;14H [5;15H [5;16H [5;17H [5;18H [5;19H [5;20H [5;21H [5;22H [5;23H [5;24H [5;25H [5;26H [5;27H [5;28H [5;29H [5;30H [5;31H [5;32H(0x(B[0m[6;2H[39m[49m(0x(B[6;3H [6;4H [6;5H [6;6H [6;7H [6;8H [6;9H [6;10H [6;11H [6;12H [6;13H [6;14H [6;15H [6;16H [6;17H [6;18H [6;19H [6;20H [6;21H [6;22H [6;23H [6;24H [6;25H [6;26H [6;27H [6;28H [6;29H [6;30H [6;31H [6;32H(0x(B[0m
|
@@ -0,0 +1 @@
|
|
1
|
+
[0m[2;2H[39m[49m(0q(B[2;3H(0q(B[2;4H(0q(B[2;5H(0q(B[2;6H(0q(B[2;7H(0q(B[2;8H(0q(B[2;9H(0q(B[2;10H(0q(B[2;11H(0q(B[2;12H(0q(B[2;13H(0q(B[2;14H(0q(B[2;15H(0q(B[2;16H(0q(B[2;17H(0q(B[2;18H(0q(B[2;19H(0q(B[2;20H(0q(B[2;21H(0q(B[2;22H(0q(B[2;23H(0q(B[2;24H(0q(B[2;25H(0q(B[2;26H(0q(B[2;27H(0q(B[2;28H(0q(B[2;29H(0q(B[2;30H(0q(B[2;31H(0q(B[2;32H(0k(B[0m[3;2H[39m[49mn[3;3Ho[3;4H [3;5Hl[3;6He[3;7Hf[3;8Ht[3;9H [3;10H [3;11H [3;12H [3;13H [3;14H [3;15H [3;16H [3;17H [3;18H [3;19H [3;20H [3;21H [3;22H [3;23H [3;24H [3;25H [3;26H [3;27H [3;28H [3;29H [3;30H [3;31H [3;32H(0x(B[0m[4;2H[39m[49m [4;3H [4;4H [4;5H [4;6H [4;7H [4;8H [4;9H [4;10H [4;11H [4;12H [4;13H [4;14H [4;15H [4;16H [4;17H [4;18H [4;19H [4;20H [4;21H [4;22H [4;23H [4;24H [4;25H [4;26H [4;27H [4;28H [4;29H [4;30H [4;31H [4;32H(0x(B[0m[5;2H[39m[49m [5;3H [5;4H [5;5H [5;6H [5;7H [5;8H [5;9H [5;10H [5;11H [5;12H [5;13H [5;14H [5;15H [5;16H [5;17H [5;18H [5;19H [5;20H [5;21H [5;22H [5;23H [5;24H [5;25H [5;26H [5;27H [5;28H [5;29H [5;30H [5;31H [5;32H(0x(B[0m[6;2H[39m[49m(0q(B[6;3H(0q(B[6;4H(0q(B[6;5H(0q(B[6;6H(0q(B[6;7H(0q(B[6;8H(0q(B[6;9H(0q(B[6;10H(0q(B[6;11H(0q(B[6;12H(0q(B[6;13H(0q(B[6;14H(0q(B[6;15H(0q(B[6;16H(0q(B[6;17H(0q(B[6;18H(0q(B[6;19H(0q(B[6;20H(0q(B[6;21H(0q(B[6;22H(0q(B[6;23H(0q(B[6;24H(0q(B[6;25H(0q(B[6;26H(0q(B[6;27H(0q(B[6;28H(0q(B[6;29H(0q(B[6;30H(0q(B[6;31H(0q(B[6;32H(0j(B[0m
|
data/integrations/test_runner.sh
CHANGED
data/lib/vedeu.rb
CHANGED
@@ -38,7 +38,8 @@ module Vedeu
|
|
38
38
|
|
39
39
|
rescue Gem::LoadError
|
40
40
|
raise Vedeu::Error::Fatal,
|
41
|
-
"Vedeu requires '#{gem_name}' for this functionality."
|
41
|
+
"Vedeu requires '#{gem_name}' for this functionality. " \
|
42
|
+
"Please add this to your project 'Gemfile' or '*.gemspec'."
|
42
43
|
end
|
43
44
|
|
44
45
|
end # Vedeu
|
@@ -18,11 +18,7 @@ module Vedeu
|
|
18
18
|
|
19
19
|
end # Borders
|
20
20
|
|
21
|
-
#
|
22
|
-
#
|
23
|
-
# @example
|
24
|
-
# Vedeu.borders
|
25
|
-
#
|
21
|
+
# {include:file:docs/dsl/by_method/borders.md}
|
26
22
|
# @!method borders
|
27
23
|
# @return [Vedeu::Borders::Repository]
|
28
24
|
def_delegators Vedeu::Borders::Repository,
|
data/lib/vedeu/cursors/cursor.rb
CHANGED
@@ -89,41 +89,28 @@ module Vedeu
|
|
89
89
|
|
90
90
|
# @return [String]
|
91
91
|
def inspect
|
92
|
-
"
|
93
|
-
"oy:#{oy}, visible:#{visible}>"
|
92
|
+
"name:'#{name}' x:#{x} y:#{y} ox:#{ox} oy:#{oy} visible:#{visible}"
|
94
93
|
end
|
95
94
|
|
96
|
-
#
|
97
|
-
#
|
98
|
-
# Vedeu.trigger(:_cursor_down_, name)
|
99
|
-
# Vedeu.trigger(:_cursor_down_, Vedeu.focus)
|
100
|
-
#
|
95
|
+
# {include:file:docs/events/by_name/cursor_down.md}
|
101
96
|
# @return [Vedeu::Cursors::Cursor]
|
102
|
-
def move_down
|
103
|
-
@oy += 1
|
97
|
+
def move_down(offset = 1)
|
98
|
+
@oy += offset || 1
|
104
99
|
@y = coordinate(oy, :y).y
|
105
100
|
|
106
101
|
self
|
107
102
|
end
|
108
103
|
|
109
|
-
#
|
110
|
-
#
|
111
|
-
# Vedeu.trigger(:_cursor_left_, name)
|
112
|
-
# Vedeu.trigger(:_cursor_left_, Vedeu.focus)
|
113
|
-
#
|
104
|
+
# {include:file:docs/events/by_name/cursor_left.md}
|
114
105
|
# @return [Vedeu::Cursors::Cursor]
|
115
|
-
def move_left
|
116
|
-
@ox -= 1
|
106
|
+
def move_left(offset = 1)
|
107
|
+
@ox -= offset || 1
|
117
108
|
@x = coordinate(ox, :x).x
|
118
109
|
|
119
110
|
self
|
120
111
|
end
|
121
112
|
|
122
|
-
#
|
123
|
-
#
|
124
|
-
# Vedeu.trigger(:_cursor_origin_, name)
|
125
|
-
# Vedeu.trigger(:_cursor_origin_, Vedeu.focus)
|
126
|
-
#
|
113
|
+
# {include:file:docs/events/by_name/cursor_origin.md}
|
127
114
|
# @return [Vedeu::Cursors::Cursor]
|
128
115
|
def move_origin
|
129
116
|
@x = bx
|
@@ -134,27 +121,19 @@ module Vedeu
|
|
134
121
|
store
|
135
122
|
end
|
136
123
|
|
137
|
-
#
|
138
|
-
#
|
139
|
-
# Vedeu.trigger(:_cursor_right_, name)
|
140
|
-
# Vedeu.trigger(:_cursor_right_, Vedeu.focus)
|
141
|
-
#
|
124
|
+
# {include:file:docs/events/by_name/cursor_right.md}
|
142
125
|
# @return [Vedeu::Cursors::Cursor]
|
143
|
-
def move_right
|
144
|
-
@ox += 1
|
126
|
+
def move_right(offset = 1)
|
127
|
+
@ox += offset || 1
|
145
128
|
@x = coordinate(ox, :x).x
|
146
129
|
|
147
130
|
self
|
148
131
|
end
|
149
132
|
|
150
|
-
#
|
151
|
-
#
|
152
|
-
# Vedeu.trigger(:_cursor_up_, name)
|
153
|
-
# Vedeu.trigger(:_cursor_up_, Vedeu.focus)
|
154
|
-
#
|
133
|
+
# {include:file:docs/events/by_name/cursor_up.md}
|
155
134
|
# @return [Vedeu::Cursors::Cursor]
|
156
|
-
def move_up
|
157
|
-
@oy -= 1
|
135
|
+
def move_up(offset = 1)
|
136
|
+
@oy -= offset || 1
|
158
137
|
@y = coordinate(oy, :y).y
|
159
138
|
|
160
139
|
self
|
@@ -185,17 +164,7 @@ module Vedeu
|
|
185
164
|
end
|
186
165
|
alias to_str to_s
|
187
166
|
|
188
|
-
#
|
189
|
-
# currently focussed interface.
|
190
|
-
#
|
191
|
-
# @example
|
192
|
-
# Vedeu.trigger(:_hide_cursor_, name)
|
193
|
-
# Vedeu.trigger(:_hide_cursor_, Vedeu.focus)
|
194
|
-
# Vedeu.trigger(:_hide_cursor_)
|
195
|
-
# Vedeu.hide_cursor(name)
|
196
|
-
# Vedeu.hide_cursor(Vedeu.focus)
|
197
|
-
# Vedeu.hide_cursor
|
198
|
-
#
|
167
|
+
# {include:file:docs/events/by_name/hide_cursor.md}
|
199
168
|
# @return [Vedeu::Cells::Cursor]
|
200
169
|
def hide
|
201
170
|
super
|
@@ -222,17 +191,7 @@ module Vedeu
|
|
222
191
|
@position = Vedeu::Geometries::Position.coerce([y, x])
|
223
192
|
end
|
224
193
|
|
225
|
-
#
|
226
|
-
# currently focussed interface.
|
227
|
-
#
|
228
|
-
# @example
|
229
|
-
# Vedeu.trigger(:_show_cursor_, name)
|
230
|
-
# Vedeu.trigger(:_show_cursor_, Vedeu.focus)
|
231
|
-
# Vedeu.trigger(:_show_cursor_)
|
232
|
-
# Vedeu.show_cursor(name)
|
233
|
-
# Vedeu.show_cursor(Vedeu.focus)
|
234
|
-
# Vedeu.show_cursor
|
235
|
-
#
|
194
|
+
# {include:file:docs/events/by_name/show_cursor.md}
|
236
195
|
# @return [Vedeu::Cells::Cursor]
|
237
196
|
def show
|
238
197
|
super
|
@@ -334,24 +293,24 @@ module Vedeu
|
|
334
293
|
# See {file:docs/cursors.md#vedeutoggle_cursor__}
|
335
294
|
Vedeu.bind(:_toggle_cursor_) { |name| Vedeu.toggle_cursor(name) }
|
336
295
|
|
337
|
-
# See {file:docs/
|
338
|
-
Vedeu.bind(:_cursor_left_) do |name|
|
339
|
-
Vedeu::Cursors::Move.move(name, :move_left)
|
296
|
+
# See {file:docs/events/by_name/cursor_left.md}
|
297
|
+
Vedeu.bind(:_cursor_left_) do |name, offset|
|
298
|
+
Vedeu::Cursors::Move.move(name, :move_left, offset)
|
340
299
|
end
|
341
300
|
|
342
|
-
# See {file:docs/
|
343
|
-
Vedeu.bind(:_cursor_down_) do |name|
|
344
|
-
Vedeu::Cursors::Move.move(name, :move_down)
|
301
|
+
# See {file:docs/events/by_name/cursor_down.md}
|
302
|
+
Vedeu.bind(:_cursor_down_) do |name, offset|
|
303
|
+
Vedeu::Cursors::Move.move(name, :move_down, offset)
|
345
304
|
end
|
346
305
|
|
347
|
-
# See {file:docs/
|
348
|
-
Vedeu.bind(:_cursor_up_) do |name|
|
349
|
-
Vedeu::Cursors::Move.move(name, :move_up)
|
306
|
+
# See {file:docs/events/by_name/cursor_up.md}
|
307
|
+
Vedeu.bind(:_cursor_up_) do |name, offset|
|
308
|
+
Vedeu::Cursors::Move.move(name, :move_up, offset)
|
350
309
|
end
|
351
310
|
|
352
|
-
# See {file:docs/
|
353
|
-
Vedeu.bind(:_cursor_right_) do |name|
|
354
|
-
Vedeu::Cursors::Move.move(name, :move_right)
|
311
|
+
# See {file:docs/events/by_name/cursor_right.md}
|
312
|
+
Vedeu.bind(:_cursor_right_) do |name, offset|
|
313
|
+
Vedeu::Cursors::Move.move(name, :move_right, offset)
|
355
314
|
end
|
356
315
|
|
357
316
|
# See {file:docs/cursors.md}
|
@@ -364,7 +323,7 @@ module Vedeu
|
|
364
323
|
|
365
324
|
# See {file:docs/cursors.md}
|
366
325
|
Vedeu.bind(:_cursor_position_) do |name|
|
367
|
-
Vedeu.cursors.by_name(name).
|
326
|
+
Vedeu.cursors.by_name(name).inspect
|
368
327
|
end
|
369
328
|
|
370
329
|
# See {file:docs/cursors.md}
|
data/lib/vedeu/cursors/move.rb
CHANGED
@@ -18,23 +18,25 @@ module Vedeu
|
|
18
18
|
|
19
19
|
# @param (see #initialize)
|
20
20
|
# @return (see #move)
|
21
|
-
def self.move(name, direction)
|
22
|
-
new(name, direction).move
|
21
|
+
def self.move(name, direction, offset)
|
22
|
+
new(name, direction, offset).move
|
23
23
|
end
|
24
24
|
|
25
25
|
# @param name [String|Symbol]
|
26
26
|
# @param direction [Symbol]
|
27
|
+
# @param offset [Fixnum]
|
27
28
|
# @return [Vedeu::Cursors::Move]
|
28
|
-
def initialize(name, direction)
|
29
|
+
def initialize(name, direction, offset)
|
29
30
|
@name = name
|
30
31
|
@direction = direction
|
32
|
+
@offset = offset
|
31
33
|
end
|
32
34
|
|
33
35
|
# @return [NilClass|Vedeu::Cursors::Cursor]
|
34
36
|
def move
|
35
37
|
return nil unless visible? && valid_direction?
|
36
38
|
|
37
|
-
cursor.public_send(direction)
|
39
|
+
cursor.public_send(direction, offset)
|
38
40
|
cursor.store { Vedeu.trigger(:_refresh_cursor_, name) }
|
39
41
|
cursor
|
40
42
|
end
|
@@ -49,6 +51,11 @@ module Vedeu
|
|
49
51
|
# @return [Symbol] The direction to move the cursor.
|
50
52
|
attr_reader :direction
|
51
53
|
|
54
|
+
# @!attribute [r] offset
|
55
|
+
# @return [Symbol] The number of characters to move the cursor
|
56
|
+
# in the given direction.
|
57
|
+
attr_reader :offset
|
58
|
+
|
52
59
|
private
|
53
60
|
|
54
61
|
# @return [Vedeu::Cursors::Cursor]
|