vedeu 0.8.1 → 0.8.2
Sign up to get free protection for your applications and to get access to all the features.
- 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/lib/vedeu/views/char.rb
CHANGED
data/lib/vedeu/views/view.rb
CHANGED
@@ -131,10 +131,7 @@ module Vedeu
|
|
131
131
|
|
132
132
|
describe '#hide' do
|
133
133
|
let(:visible) { true }
|
134
|
-
let(:escape) {
|
135
|
-
Vedeu::Cells::Escape.
|
136
|
-
new(value: Vedeu::EscapeSequences::Esc.hide_cursor)
|
137
|
-
}
|
134
|
+
let(:escape) { Vedeu::Cells::Escape.new(value: Vedeu.esc.hide_cursor) }
|
138
135
|
|
139
136
|
before do
|
140
137
|
Vedeu::Cells::Escape.stubs(:new).returns(escape)
|
@@ -274,7 +271,7 @@ module Vedeu
|
|
274
271
|
let(:visible) { false }
|
275
272
|
let(:escape) {
|
276
273
|
Vedeu::Cells::Escape.
|
277
|
-
new(value: Vedeu
|
274
|
+
new(value: Vedeu.esc.show_cursor)
|
278
275
|
}
|
279
276
|
|
280
277
|
before do
|
@@ -23,7 +23,7 @@ module Vedeu
|
|
23
23
|
|
24
24
|
before do
|
25
25
|
Vedeu.stubs(:log)
|
26
|
-
Vedeu
|
26
|
+
Vedeu.config.stubs(:drb?).returns(enabled)
|
27
27
|
DRb.stubs(:thread).returns(running)
|
28
28
|
end
|
29
29
|
|
@@ -53,7 +53,7 @@ module Vedeu
|
|
53
53
|
end
|
54
54
|
|
55
55
|
context 'when the server is enabled' do
|
56
|
-
before { Vedeu
|
56
|
+
before { Vedeu.config.stubs(:drb?).returns(true) }
|
57
57
|
|
58
58
|
context 'and the server is running' do
|
59
59
|
before { DRb.stubs(:thread).returns(true) }
|
@@ -10,11 +10,39 @@ module Vedeu
|
|
10
10
|
|
11
11
|
let(:described) { Vedeu::EscapeSequences::Mouse }
|
12
12
|
|
13
|
+
describe '.disable_mouse' do
|
14
|
+
subject { described.disable_mouse }
|
15
|
+
|
16
|
+
context 'when the mouse is enabled in the configuration' do
|
17
|
+
it { subject.must_equal("\e[?9l") }
|
18
|
+
end
|
19
|
+
|
20
|
+
context 'when the mouse is not enabled in the configuration' do
|
21
|
+
before { Vedeu.config.stubs(:mouse?).returns(false) }
|
22
|
+
|
23
|
+
it { subject.must_equal('') }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
describe '.enable_mouse' do
|
28
|
+
subject { described.enable_mouse }
|
29
|
+
|
30
|
+
context 'when the mouse is enabled in the configuration' do
|
31
|
+
it { subject.must_equal("\e[?9h") }
|
32
|
+
end
|
33
|
+
|
34
|
+
context 'when the mouse is not enabled in the configuration' do
|
35
|
+
before { Vedeu.config.stubs(:mouse?).returns(false) }
|
36
|
+
|
37
|
+
it { subject.must_equal('') }
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
13
41
|
describe '.mouse_x10_on' do
|
14
42
|
it { described.mouse_x10_on.must_equal("\e[?9h") }
|
15
43
|
end
|
16
44
|
|
17
|
-
describe '.
|
45
|
+
describe '.mouse_x10_off' do
|
18
46
|
it { described.mouse_x10_off.must_equal("\e[?9l") }
|
19
47
|
end
|
20
48
|
|
@@ -32,7 +32,7 @@ module Vedeu
|
|
32
32
|
subject { instance.measure { :thing_to_be_measured } }
|
33
33
|
|
34
34
|
context 'when debugging is enabled' do
|
35
|
-
before { Vedeu
|
35
|
+
before { Vedeu.config.stubs(:debug?).returns(true) }
|
36
36
|
|
37
37
|
it do
|
38
38
|
Vedeu.expects(:log).with(type: :timer,
|
@@ -42,7 +42,7 @@ module Vedeu
|
|
42
42
|
end
|
43
43
|
|
44
44
|
context 'when debugging is disabled' do
|
45
|
-
before { Vedeu
|
45
|
+
before { Vedeu.config.stubs(:debug?).returns(false) }
|
46
46
|
|
47
47
|
it { subject.must_equal(:thing_to_be_measured) }
|
48
48
|
end
|
@@ -37,7 +37,7 @@ module Vedeu
|
|
37
37
|
let(:buffer) { Vedeu::Buffers::Terminal }
|
38
38
|
|
39
39
|
before do
|
40
|
-
Vedeu
|
40
|
+
Vedeu.config.stubs(:compression?).returns(false)
|
41
41
|
::File.stubs(:write)
|
42
42
|
Vedeu.stubs(:height).returns(2)
|
43
43
|
Vedeu.stubs(:width).returns(4)
|
@@ -15,7 +15,7 @@ module Vedeu
|
|
15
15
|
let(:_name) { 'Vedeu::Renderers::JSON' }
|
16
16
|
|
17
17
|
before do
|
18
|
-
Vedeu
|
18
|
+
Vedeu.config.stubs(:compression?).returns(false)
|
19
19
|
::File.stubs(:write)
|
20
20
|
Vedeu.stubs(:height).returns(1)
|
21
21
|
Vedeu.stubs(:width).returns(1)
|
@@ -35,14 +35,14 @@ module Vedeu
|
|
35
35
|
context 'when the option is not set or is set to false' do
|
36
36
|
before { options.tap { |o| o.delete(:compression) } }
|
37
37
|
|
38
|
-
context 'when Vedeu
|
39
|
-
before { Vedeu
|
38
|
+
context 'when Vedeu.config.compression? is set to false' do
|
39
|
+
before { Vedeu.config.stubs(:compression?).returns(false) }
|
40
40
|
|
41
41
|
it { subject.must_equal(false) }
|
42
42
|
end
|
43
43
|
|
44
|
-
context 'when Vedeu
|
45
|
-
before { Vedeu
|
44
|
+
context 'when Vedeu.config.compression? is set to true' do
|
45
|
+
before { Vedeu.config.stubs(:compression?).returns(true) }
|
46
46
|
|
47
47
|
it { subject.must_equal(true) }
|
48
48
|
end
|
@@ -15,11 +15,10 @@ module Vedeu
|
|
15
15
|
describe Application do
|
16
16
|
|
17
17
|
let(:described) { Vedeu::Runtime::Application }
|
18
|
-
let(:instance) { described.new
|
19
|
-
let(:configuration) { Vedeu.configuration }
|
18
|
+
let(:instance) { described.new }
|
20
19
|
|
21
20
|
before do
|
22
|
-
|
21
|
+
Vedeu.config.stubs(:drb?).returns(false)
|
23
22
|
Vedeu::Terminal.stubs(:open).returns([''])
|
24
23
|
|
25
24
|
Vedeu.stubs(:trigger)
|
@@ -27,20 +26,16 @@ module Vedeu
|
|
27
26
|
|
28
27
|
describe '#initialize' do
|
29
28
|
it { instance.must_be_instance_of(described) }
|
30
|
-
it do
|
31
|
-
instance.instance_variable_get('@configuration').
|
32
|
-
must_equal(configuration)
|
33
|
-
end
|
34
29
|
end
|
35
30
|
|
36
31
|
describe '.restart' do
|
37
|
-
subject { described.restart
|
32
|
+
subject { described.restart }
|
38
33
|
|
39
34
|
it { subject.must_be_instance_of(Array) }
|
40
35
|
end
|
41
36
|
|
42
37
|
describe '.start' do
|
43
|
-
subject { described.start
|
38
|
+
subject { described.start }
|
44
39
|
|
45
40
|
it { subject.must_be_instance_of(Array) }
|
46
41
|
end
|
@@ -61,19 +61,19 @@ module Vedeu
|
|
61
61
|
it 'returns :fake if previously :raw' do
|
62
62
|
described.raw_mode!
|
63
63
|
subject
|
64
|
-
Vedeu
|
64
|
+
Vedeu.config.terminal_mode.must_equal(:fake)
|
65
65
|
end
|
66
66
|
|
67
67
|
it 'returns :cooked if previously :fake' do
|
68
68
|
described.fake_mode!
|
69
69
|
subject
|
70
|
-
Vedeu
|
70
|
+
Vedeu.config.terminal_mode.must_equal(:cooked)
|
71
71
|
end
|
72
72
|
|
73
73
|
it 'returns :raw if previously :cooked' do
|
74
74
|
described.cooked_mode!
|
75
75
|
subject
|
76
|
-
Vedeu
|
76
|
+
Vedeu.config.terminal_mode.must_equal(:raw)
|
77
77
|
end
|
78
78
|
end
|
79
79
|
|
@@ -82,7 +82,7 @@ module Vedeu
|
|
82
82
|
|
83
83
|
it do
|
84
84
|
subject
|
85
|
-
Vedeu
|
85
|
+
Vedeu.config.terminal_mode.must_equal(:cooked)
|
86
86
|
end
|
87
87
|
|
88
88
|
context 'when the mode given is not valid' do
|
@@ -92,7 +92,7 @@ module Vedeu
|
|
92
92
|
|
93
93
|
it do
|
94
94
|
subject
|
95
|
-
Vedeu
|
95
|
+
Vedeu.config.terminal_mode.must_equal(:raw)
|
96
96
|
end
|
97
97
|
end
|
98
98
|
end
|
@@ -26,7 +26,7 @@ module Vedeu
|
|
26
26
|
end
|
27
27
|
|
28
28
|
it 'opens a new terminal console in raw mode' do
|
29
|
-
Vedeu
|
29
|
+
Vedeu.config.stub(:terminal_mode, :raw) do
|
30
30
|
capture_io do
|
31
31
|
Vedeu::Terminal.open do
|
32
32
|
print 'Hello from raw mode!'
|
@@ -36,7 +36,7 @@ module Vedeu
|
|
36
36
|
end
|
37
37
|
|
38
38
|
it 'opens a new terminal console in cooked mode' do
|
39
|
-
Vedeu
|
39
|
+
Vedeu.config.stub(:terminal_mode, :cooked) do
|
40
40
|
capture_io do
|
41
41
|
Vedeu::Terminal.open do
|
42
42
|
print 'Hello from cooked mode!'
|
@@ -17,17 +17,14 @@ class VedeuMaterialColoursApp
|
|
17
17
|
# Be aware that running an application with debugging enabled will affect
|
18
18
|
# performance.
|
19
19
|
Vedeu.configure do
|
20
|
-
# background '#607d8b'
|
21
|
-
colour background: '#607d8b', foreground: '#ffff00'
|
22
20
|
debug!
|
23
|
-
# foreground '#ffff00'
|
24
21
|
# profile!
|
25
22
|
log '/tmp/vedeu_material_colours_app.log'
|
26
23
|
log_except [:cursor, :update, :render]
|
27
24
|
# height 11
|
28
25
|
# width 20
|
29
|
-
|
30
|
-
|
26
|
+
renderers(Vedeu::Renderers::Terminal.new,
|
27
|
+
Vedeu::Renderers::File.new(filename: '/tmp/material_colours.out'))
|
31
28
|
end
|
32
29
|
|
33
30
|
# Borders can be defined as standalone declarations.
|
data/test/test_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vedeu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Laking
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-12-
|
11
|
+
date: 2015-12-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -302,6 +302,9 @@ files:
|
|
302
302
|
- docs/dsl/by_method/interface.md
|
303
303
|
- docs/dsl/by_method/interfaces.md
|
304
304
|
- docs/dsl/by_method/keymap.md
|
305
|
+
- docs/dsl/by_method/keymap/interface.md
|
306
|
+
- docs/dsl/by_method/keymap/key.md
|
307
|
+
- docs/dsl/by_method/keymap/name.md
|
305
308
|
- docs/dsl/by_method/keymaps.md
|
306
309
|
- docs/dsl/by_method/keypress.md
|
307
310
|
- docs/dsl/by_method/last_command.md
|
@@ -479,7 +482,6 @@ files:
|
|
479
482
|
- examples/views/lines_line_streams_stream.rb
|
480
483
|
- examples/views/lines_line_streams_stream_stream.rb
|
481
484
|
- examples/views/lines_streams.rb
|
482
|
-
- examples/views/lines_streams_stream.rb
|
483
485
|
- examples/views/runner.sh
|
484
486
|
- lib/vedeu.rb
|
485
487
|
- lib/vedeu/all.rb
|
@@ -1,48 +0,0 @@
|
|
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
|
-
run_once!
|
16
|
-
standalone!
|
17
|
-
end
|
18
|
-
|
19
|
-
Vedeu.interface :test1_interface do
|
20
|
-
border do
|
21
|
-
title 'Test 1'
|
22
|
-
end
|
23
|
-
geometry do
|
24
|
-
x 4
|
25
|
-
y 3
|
26
|
-
xn 34
|
27
|
-
yn 8
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
Vedeu.render do
|
32
|
-
view(:test1_interface) do
|
33
|
-
lines do
|
34
|
-
streams do
|
35
|
-
stream 'v->ls->ss->stream 1', { foreground: '#00ff00' }
|
36
|
-
stream 'v->ls->ss->stream 2', { foreground: '#ff0000' }
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def self.start(argv = ARGV)
|
43
|
-
Vedeu::Launcher.execute!(argv)
|
44
|
-
end
|
45
|
-
|
46
|
-
end # DSLApp
|
47
|
-
|
48
|
-
DSLApp.start
|