vedeu 0.8.16 → 0.8.17
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/examples/dsl_alignment.rb +5 -2
- data/examples/dsl_horizontal_alignment.rb +5 -2
- data/examples/dsl_vertical_alignment.rb +5 -2
- data/integrations/test_runner.sh +2 -3
- data/lib/vedeu.rb +31 -1
- data/lib/vedeu/borders/all.rb +19 -0
- data/lib/vedeu/borders/border.rb +1 -2
- data/lib/vedeu/borders/caption.rb +2 -0
- data/lib/vedeu/borders/refresh.rb +4 -17
- data/lib/vedeu/borders/repository.rb +0 -14
- data/lib/vedeu/borders/title.rb +9 -3
- data/lib/vedeu/buffers/all.rb +25 -0
- data/lib/vedeu/buffers/buffer.rb +2 -2
- data/lib/vedeu/buffers/refresh.rb +1 -15
- data/lib/vedeu/buffers/terminal.rb +0 -15
- data/lib/vedeu/buffers/view.rb +2 -2
- data/lib/vedeu/cells/empty.rb +4 -5
- data/lib/vedeu/coercers/all.rb +0 -5
- data/lib/vedeu/cursors/all.rb +88 -0
- data/lib/vedeu/cursors/cursor.rb +7 -92
- data/lib/vedeu/cursors/move.rb +44 -14
- data/lib/vedeu/cursors/refresh.rb +5 -17
- data/lib/vedeu/cursors/reposition.rb +2 -2
- data/lib/vedeu/distributed/all.rb +16 -0
- data/lib/vedeu/distributed/server.rb +0 -16
- data/lib/vedeu/dsl/dsl.rb +2 -2
- data/lib/vedeu/dsl/helpers/align.rb +1 -1
- data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
- data/lib/vedeu/dsl/helpers/truncate.rb +1 -1
- data/lib/vedeu/dsl/helpers/wordwrap.rb +1 -1
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/dsl/views.rb +22 -6
- data/lib/vedeu/editor/all.rb +54 -0
- data/lib/vedeu/editor/cropper.rb +3 -5
- data/lib/vedeu/editor/cursor.rb +2 -4
- data/lib/vedeu/editor/document.rb +1 -1
- data/lib/vedeu/editor/editor.rb +2 -17
- data/lib/vedeu/editor/repository.rb +0 -45
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/geometries/all.rb +46 -1
- data/lib/vedeu/geometries/area/area.rb +2 -2
- data/lib/vedeu/geometries/dsl/grid.rb +16 -20
- data/lib/vedeu/geometries/geometry.rb +1 -1
- data/lib/vedeu/geometries/move.rb +2 -38
- data/lib/vedeu/geometries/repository.rb +0 -14
- data/lib/vedeu/groups/all.rb +23 -0
- data/lib/vedeu/groups/clear.rb +1 -10
- data/lib/vedeu/groups/group.rb +0 -12
- data/lib/vedeu/groups/refresh.rb +2 -11
- data/lib/vedeu/input/all.rb +35 -0
- data/lib/vedeu/input/capture.rb +2 -2
- data/lib/vedeu/input/mapper.rb +0 -35
- data/lib/vedeu/input/raw.rb +1 -1
- data/lib/vedeu/input/read.rb +1 -1
- data/lib/vedeu/interfaces/all.rb +24 -0
- data/lib/vedeu/interfaces/clear.rb +32 -46
- data/lib/vedeu/interfaces/interface.rb +0 -16
- data/lib/vedeu/menus/all.rb +44 -0
- data/lib/vedeu/menus/menu.rb +13 -8
- data/lib/vedeu/menus/repository.rb +0 -44
- data/lib/vedeu/models/all.rb +13 -0
- data/lib/vedeu/models/focus.rb +0 -13
- data/lib/vedeu/models/toggleable.rb +1 -1
- data/lib/vedeu/null/generic.rb +1 -1
- data/lib/vedeu/output/all.rb +7 -0
- data/lib/vedeu/output/compressor.rb +11 -6
- data/lib/vedeu/output/compressors/character.rb +2 -0
- data/lib/vedeu/output/refresh.rb +0 -7
- data/lib/vedeu/output/viewport.rb +2 -5
- data/lib/vedeu/plugins/plugin.rb +1 -1
- data/lib/vedeu/presentation/colour.rb +6 -1
- data/lib/vedeu/renderers/all.rb +1 -1
- data/lib/vedeu/repositories/repositories.rb +1 -1
- data/lib/vedeu/runtime/all.rb +28 -0
- data/lib/vedeu/runtime/application.rb +0 -18
- data/lib/vedeu/runtime/flags.rb +0 -7
- data/lib/vedeu/runtime/router.rb +0 -11
- data/lib/vedeu/runtime/traps.rb +2 -0
- data/lib/vedeu/templating/view_template.rb +2 -4
- data/lib/vedeu/terminal/all.rb +7 -0
- data/lib/vedeu/terminal/terminal.rb +0 -7
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/view.rb +3 -3
- data/test/lib/vedeu/cursors/cursor_test.rb +4 -4
- data/test/lib/vedeu/cursors/move_test.rb +2 -2
- data/test/lib/vedeu/presentation/colour_test.rb +26 -0
- data/test/support/colour_support.sh +3 -1
- data/test/support/examples/material_colours_app.rb +2 -28
- data/test/support/stats.sh +1 -1
- data/test/test_helper.rb +0 -1
- data/vedeu.gemspec +1 -1
- metadata +4 -6
- data/test/support/helpers/presentation_colour_test_class.rb +0 -31
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 428c6ce796c2302c1c1ffdc4fe0e24dbc93bd72d
|
4
|
+
data.tar.gz: f2be6bebebfc68dad88801c1d28100bcd615a7fe
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea73e52d7a7641e7d201508946bd444f8010c33d43b198ae2a8db66b634beb2f6604eaae721f1123a3fdb7a7580635c677419f6de963eb6c4d4eef366abf14af
|
7
|
+
data.tar.gz: 29571610db40d58fdb32d01ce87719da00ff8f28f5f67bb0776156d9a79a4affe5f3b48ed76b90a0fb7e87e44bfaa4c9ded1194508b6340e2cf8e8b14f5d510e
|
data/TODO.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
## 2016-02-25
|
2
|
+
|
3
|
+
- In Vedeu::XCoordinate and Vedeu::YCoordinate, rename #d_dn to
|
4
|
+
#bd_bdn
|
5
|
+
- Add new #d_dn to Vedeu::XCoordinate and Vedeu::YCoordinate.
|
6
|
+
- Rename all private instance variables used for memoization from
|
7
|
+
'@...' to '@_...'.
|
8
|
+
|
1
9
|
## 2016-01-16
|
2
10
|
|
3
11
|
- Add Vedeu::Index which converts a Vedeu::Point to an array index.
|
data/examples/dsl_alignment.rb
CHANGED
@@ -12,8 +12,11 @@ class AlignmentApp
|
|
12
12
|
Vedeu.configure do
|
13
13
|
debug!
|
14
14
|
log '/tmp/alignment.log'
|
15
|
-
renderers
|
16
|
-
|
15
|
+
renderers [
|
16
|
+
Vedeu::Renderers::Terminal.new,
|
17
|
+
# Vedeu::Renderers::Text.new(
|
18
|
+
# filename: '/tmp/alignment.out'),
|
19
|
+
]
|
17
20
|
run_once!
|
18
21
|
standalone!
|
19
22
|
end
|
@@ -51,8 +51,11 @@ class HorizontalAlignmentApp
|
|
51
51
|
Vedeu.configure do
|
52
52
|
debug!
|
53
53
|
log '/tmp/vedeu_horizontal.log'
|
54
|
-
renderers
|
55
|
-
|
54
|
+
renderers [
|
55
|
+
Vedeu::Renderers::Terminal.new,
|
56
|
+
# Vedeu::Renderers::Text.new(
|
57
|
+
# filename: '/tmp/vedeu_horizontal.out'),
|
58
|
+
]
|
56
59
|
end
|
57
60
|
|
58
61
|
Vedeu.interface :left_interface do
|
@@ -51,8 +51,11 @@ class VerticalAlignmentApp
|
|
51
51
|
Vedeu.configure do
|
52
52
|
debug!
|
53
53
|
log '/tmp/vedeu_vertical.log'
|
54
|
-
renderers
|
55
|
-
|
54
|
+
renderers [
|
55
|
+
Vedeu::Renderers::Terminal.new,
|
56
|
+
# Vedeu::Renderers::Text.new(
|
57
|
+
# filename: '/tmp/vedeu_vertical.out'),
|
58
|
+
]
|
56
59
|
end
|
57
60
|
|
58
61
|
Vedeu.interface :top_interface do
|
data/integrations/test_runner.sh
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
#!/bin/bash
|
2
2
|
|
3
|
+
set -euo pipefail
|
4
|
+
|
3
5
|
# Notes:
|
4
6
|
# At the moment, the terminal must be set to width 135 x height 34 for
|
5
7
|
# these tests to pass.
|
6
8
|
|
7
|
-
# die on error
|
8
|
-
set -e
|
9
|
-
|
10
9
|
# change to directory that contains this script
|
11
10
|
cd "$(dirname "$0")"
|
12
11
|
|
data/lib/vedeu.rb
CHANGED
@@ -70,6 +70,36 @@ end # Vedeu
|
|
70
70
|
# target model to act upon. May default to `Vedeu.focus`.
|
71
71
|
#
|
72
72
|
# @!macro [new] return_name
|
73
|
-
# @return [NilClass|Symbol|String]
|
73
|
+
# @return [NilClass|Symbol|String] The name of the model, the target
|
74
|
+
# model or the name of the associated model.
|
75
|
+
#
|
76
|
+
# @!macro [new] border_by_name
|
77
|
+
# Returns the named border from the borders repository.
|
78
|
+
# @return [Vedeu::Borders::Border]
|
79
|
+
#
|
80
|
+
# @!macro [new] buffer_by_name
|
81
|
+
# Returns the named buffer from the buffer repository.
|
82
|
+
# @return [Vedeu::Buffers::Buffer]
|
83
|
+
#
|
84
|
+
# @!macro [new] cursor_by_name
|
85
|
+
# Returns the named cursor from the cursors repository.
|
86
|
+
# @return [Vedeu::Cursors::Cursor]
|
87
|
+
#
|
88
|
+
# @!macro [new] document_by_name
|
89
|
+
# Returns the named document from the documents repository.
|
90
|
+
# @return [Vedeu::Editor::Document]
|
91
|
+
#
|
92
|
+
# @!macro [new] geometry_by_name
|
93
|
+
# Returns the named geometry from the geometries repository.
|
94
|
+
# @return [Vedeu::Geometries::Geometry]
|
95
|
+
|
96
|
+
# @!macro [new] group_by_name
|
97
|
+
# Returns the named group from the groups repository.
|
98
|
+
# @return [Vedeu::Groups::Group]
|
99
|
+
#
|
100
|
+
# @!macro [new] interface_by_name
|
101
|
+
# Returns the named interface/view from the interfaces repository.
|
102
|
+
# @return [Vedeu::Interfaces::Interface]
|
103
|
+
#
|
74
104
|
|
75
105
|
require 'vedeu/all'
|
data/lib/vedeu/borders/all.rb
CHANGED
@@ -33,6 +33,25 @@ module Vedeu
|
|
33
33
|
|
34
34
|
end # Borders
|
35
35
|
|
36
|
+
# :nocov:
|
37
|
+
|
38
|
+
# {include:file:docs/events/by_name/refresh_border.md}
|
39
|
+
Vedeu.bind(:_refresh_border_) do |name|
|
40
|
+
Vedeu::Borders::Refresh.by_name(name) if Vedeu.ready?
|
41
|
+
end
|
42
|
+
|
43
|
+
# See {file:docs/events/by_name/set_border_caption.md}
|
44
|
+
Vedeu.bind(:_set_border_caption_) do |name, caption|
|
45
|
+
Vedeu.borders.by_name(name).caption = caption
|
46
|
+
end
|
47
|
+
|
48
|
+
# See {file:docs/events/by_name/set_border_title.md}
|
49
|
+
Vedeu.bind(:_set_border_title_) do |name, title|
|
50
|
+
Vedeu.borders.by_name(name).title = title
|
51
|
+
end
|
52
|
+
|
53
|
+
# :nocov:
|
54
|
+
|
36
55
|
end # Vedeu
|
37
56
|
|
38
57
|
require 'vedeu/borders/title'
|
data/lib/vedeu/borders/border.rb
CHANGED
@@ -77,7 +77,7 @@ module Vedeu
|
|
77
77
|
protected
|
78
78
|
|
79
79
|
# @!attribute [r] name
|
80
|
-
# @
|
80
|
+
# @macro return_name
|
81
81
|
attr_reader :name
|
82
82
|
|
83
83
|
private
|
@@ -91,9 +91,7 @@ module Vedeu
|
|
91
91
|
}
|
92
92
|
end
|
93
93
|
|
94
|
-
#
|
95
|
-
#
|
96
|
-
# @return (see Vedeu::Borders::Repository#by_name)
|
94
|
+
# @macro border_by_name
|
97
95
|
def border
|
98
96
|
@border ||= Vedeu.borders.by_name(name)
|
99
97
|
end
|
@@ -122,9 +120,7 @@ module Vedeu
|
|
122
120
|
[(bottom_left if left?), captionbar, (bottom_right if right?)].compact
|
123
121
|
end
|
124
122
|
|
125
|
-
#
|
126
|
-
#
|
127
|
-
# @return (see Vedeu::Geometries::Repository#by_name)
|
123
|
+
# @macro geometry_by_name
|
128
124
|
def geometry
|
129
125
|
Vedeu.geometries.by_name(name)
|
130
126
|
end
|
@@ -136,7 +132,7 @@ module Vedeu
|
|
136
132
|
#
|
137
133
|
# @return (see Vedeu::Interfaces::Repository#by_name)
|
138
134
|
def interface
|
139
|
-
@
|
135
|
+
@_interface ||= Vedeu.interfaces.by_name(name)
|
140
136
|
end
|
141
137
|
alias parent interface
|
142
138
|
|
@@ -218,13 +214,4 @@ module Vedeu
|
|
218
214
|
|
219
215
|
end # Borders
|
220
216
|
|
221
|
-
# :nocov:
|
222
|
-
|
223
|
-
# {include:file:docs/events/by_name/refresh_border.md}
|
224
|
-
Vedeu.bind(:_refresh_border_) do |name|
|
225
|
-
Vedeu::Borders::Refresh.by_name(name) if Vedeu.ready?
|
226
|
-
end
|
227
|
-
|
228
|
-
# :nocov:
|
229
|
-
|
230
217
|
end # Vedeu
|
@@ -25,18 +25,4 @@ module Vedeu
|
|
25
25
|
def_delegators Vedeu::Borders::Repository,
|
26
26
|
:borders
|
27
27
|
|
28
|
-
# :nocov:
|
29
|
-
|
30
|
-
# See {file:docs/events/by_name/set_border_caption.md}
|
31
|
-
Vedeu.bind(:_set_border_caption_) do |name, caption|
|
32
|
-
Vedeu.borders.by_name(name).caption = caption
|
33
|
-
end
|
34
|
-
|
35
|
-
# See {file:docs/events/by_name/set_border_title.md}
|
36
|
-
Vedeu.bind(:_set_border_title_) do |name, title|
|
37
|
-
Vedeu.borders.by_name(name).title = title
|
38
|
-
end
|
39
|
-
|
40
|
-
# :nocov:
|
41
|
-
|
42
28
|
end # Vedeu
|
data/lib/vedeu/borders/title.rb
CHANGED
@@ -82,7 +82,7 @@ module Vedeu
|
|
82
82
|
attr_reader :horizontal
|
83
83
|
|
84
84
|
# @!attribute [r] name
|
85
|
-
# @
|
85
|
+
# @macro return_name
|
86
86
|
attr_reader :name
|
87
87
|
|
88
88
|
private
|
@@ -95,7 +95,7 @@ module Vedeu
|
|
95
95
|
value: char)
|
96
96
|
end
|
97
97
|
|
98
|
-
# @
|
98
|
+
# @macro border_by_name
|
99
99
|
def border
|
100
100
|
@_border ||= Vedeu.borders.by_name(name)
|
101
101
|
end
|
@@ -126,7 +126,7 @@ module Vedeu
|
|
126
126
|
start_index + (size - 1)
|
127
127
|
end
|
128
128
|
|
129
|
-
# @
|
129
|
+
# @macro geometry_by_name
|
130
130
|
def geometry
|
131
131
|
@_geometry ||= Vedeu.geometries.by_name(name)
|
132
132
|
end
|
@@ -154,6 +154,10 @@ module Vedeu
|
|
154
154
|
pad.size
|
155
155
|
end
|
156
156
|
|
157
|
+
# Provides the index on the horizontal border for where the
|
158
|
+
# title (or caption) should start. The title will appear
|
159
|
+
# top-left, whilst the caption will be justified bottom-right.
|
160
|
+
#
|
157
161
|
# @return [Fixnum]
|
158
162
|
def start_index
|
159
163
|
1
|
@@ -189,6 +193,8 @@ module Vedeu
|
|
189
193
|
geometry.bx + start_index
|
190
194
|
end
|
191
195
|
|
196
|
+
# Return the vertical position for the title (or caption).
|
197
|
+
#
|
192
198
|
# @return [Fixnum]
|
193
199
|
def y
|
194
200
|
geometry.y
|
data/lib/vedeu/buffers/all.rb
CHANGED
@@ -18,6 +18,31 @@ module Vedeu
|
|
18
18
|
|
19
19
|
end # Buffers
|
20
20
|
|
21
|
+
# :nocov:
|
22
|
+
|
23
|
+
# @see Vedeu::Buffers::Terminal#clear
|
24
|
+
Vedeu.bind(:_clear_) { Vedeu.clear }
|
25
|
+
|
26
|
+
# @see Vedeu::Buffers::Terminal#output
|
27
|
+
Vedeu.bind(:_drb_retrieve_output_) { Vedeu::Buffers::Terminal.output }
|
28
|
+
|
29
|
+
# @see Vedeu::Buffers::Terminal#write
|
30
|
+
Vedeu.bind(:_drb_store_output_) do |data|
|
31
|
+
Vedeu::Buffers::Terminal.write(data)
|
32
|
+
end
|
33
|
+
|
34
|
+
# See {file:docs/events/by_name/refresh_view.md}
|
35
|
+
Vedeu.bind(:_refresh_view_) do |name|
|
36
|
+
Vedeu::Buffers::Refresh.by_name(name) if Vedeu.ready?
|
37
|
+
end
|
38
|
+
|
39
|
+
# See {file:docs/events/by_name/refresh_view_content.md}
|
40
|
+
Vedeu.bind(:_refresh_view_content_) do |name|
|
41
|
+
Vedeu::Buffers::Refresh.refresh_content_by_name(name) if Vedeu.ready?
|
42
|
+
end
|
43
|
+
|
44
|
+
# :nocov:
|
45
|
+
|
21
46
|
end # Vedeu
|
22
47
|
|
23
48
|
require 'vedeu/buffers/empty'
|
data/lib/vedeu/buffers/buffer.rb
CHANGED
@@ -33,7 +33,7 @@ module Vedeu
|
|
33
33
|
attr_accessor :previous
|
34
34
|
|
35
35
|
# @!attribute [r] name
|
36
|
-
# @
|
36
|
+
# @macro return_name
|
37
37
|
attr_reader :name
|
38
38
|
|
39
39
|
# Return a new instance of Buffer. Generally a Buffer is
|
@@ -185,7 +185,7 @@ module Vedeu
|
|
185
185
|
}
|
186
186
|
end
|
187
187
|
|
188
|
-
# @
|
188
|
+
# @macro interface_by_name
|
189
189
|
def interface
|
190
190
|
Vedeu.interfaces.by_name(name)
|
191
191
|
end
|
@@ -50,7 +50,7 @@ module Vedeu
|
|
50
50
|
|
51
51
|
private
|
52
52
|
|
53
|
-
# @
|
53
|
+
# @macro buffer_by_name
|
54
54
|
def buffer
|
55
55
|
Vedeu.buffers.by_name(name)
|
56
56
|
end
|
@@ -81,18 +81,4 @@ module Vedeu
|
|
81
81
|
|
82
82
|
end # Buffers
|
83
83
|
|
84
|
-
# :nocov:
|
85
|
-
|
86
|
-
# See {file:docs/events/by_name/refresh_view.md}
|
87
|
-
Vedeu.bind(:_refresh_view_) do |name|
|
88
|
-
Vedeu::Buffers::Refresh.by_name(name) if Vedeu.ready?
|
89
|
-
end
|
90
|
-
|
91
|
-
# See {file:docs/events/by_name/refresh_view_content.md}
|
92
|
-
Vedeu.bind(:_refresh_view_content_) do |name|
|
93
|
-
Vedeu::Buffers::Refresh.refresh_content_by_name(name) if Vedeu.ready?
|
94
|
-
end
|
95
|
-
|
96
|
-
# :nocov:
|
97
|
-
|
98
84
|
end # Vedeu
|
@@ -100,19 +100,4 @@ module Vedeu
|
|
100
100
|
:clear,
|
101
101
|
:refresh
|
102
102
|
|
103
|
-
# :nocov:
|
104
|
-
|
105
|
-
# @see Vedeu::Buffers::Terminal#clear
|
106
|
-
Vedeu.bind(:_clear_) { Vedeu.clear }
|
107
|
-
|
108
|
-
# @see Vedeu::Buffers::Terminal#output
|
109
|
-
Vedeu.bind(:_drb_retrieve_output_) { Vedeu::Buffers::Terminal.output }
|
110
|
-
|
111
|
-
# @see Vedeu::Buffers::Terminal#write
|
112
|
-
Vedeu.bind(:_drb_store_output_) do |data|
|
113
|
-
Vedeu::Buffers::Terminal.write(data)
|
114
|
-
end
|
115
|
-
|
116
|
-
# :nocov:
|
117
|
-
|
118
103
|
end # Vedeu
|
data/lib/vedeu/buffers/view.rb
CHANGED
@@ -58,7 +58,7 @@ module Vedeu
|
|
58
58
|
protected
|
59
59
|
|
60
60
|
# @!attribute [r] name
|
61
|
-
# @
|
61
|
+
# @macro return_name
|
62
62
|
attr_reader :name
|
63
63
|
|
64
64
|
private
|
@@ -85,7 +85,7 @@ module Vedeu
|
|
85
85
|
}
|
86
86
|
end
|
87
87
|
|
88
|
-
# @
|
88
|
+
# @macro geometry_by_name
|
89
89
|
def geometry
|
90
90
|
@_geometry ||= Vedeu.geometries.by_name(name)
|
91
91
|
end
|
data/lib/vedeu/cells/empty.rb
CHANGED
@@ -18,8 +18,7 @@ module Vedeu
|
|
18
18
|
include Vedeu::Repositories::Defaults
|
19
19
|
|
20
20
|
# @!attribute [r] name
|
21
|
-
# @
|
22
|
-
# cell belongs to.
|
21
|
+
# @macro return_name
|
23
22
|
attr_reader :name
|
24
23
|
|
25
24
|
# @!attribute [r] value
|
@@ -99,17 +98,17 @@ module Vedeu
|
|
99
98
|
}
|
100
99
|
end
|
101
100
|
|
102
|
-
# @
|
101
|
+
# @macro border_by_name
|
103
102
|
def border
|
104
103
|
Vedeu.borders.by_name(name)
|
105
104
|
end
|
106
105
|
|
107
|
-
# @
|
106
|
+
# @macro geometry_by_name
|
108
107
|
def geometry
|
109
108
|
Vedeu.geometries.by_name(name)
|
110
109
|
end
|
111
110
|
|
112
|
-
# @
|
111
|
+
# @macro interface_by_name
|
113
112
|
def interface
|
114
113
|
Vedeu.interfaces.by_name(name)
|
115
114
|
end
|