vedeu 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.travis.yml +1 -1
- data/README.md +2 -6
- data/config/rubocop_enabled.yml +0 -6
- data/docs/dsl/by_method/clock_time.md +4 -1
- data/lib/vedeu/application/application_controller.rb +2 -2
- data/lib/vedeu/application/controller.rb +3 -3
- data/lib/vedeu/borders/border.rb +6 -6
- data/lib/vedeu/borders/dsl.rb +26 -26
- data/lib/vedeu/borders/refresh.rb +2 -2
- data/lib/vedeu/borders/title.rb +4 -4
- data/lib/vedeu/buffers/refresh.rb +8 -7
- data/lib/vedeu/buffers/terminal.rb +1 -1
- data/lib/vedeu/buffers/view.rb +2 -2
- data/lib/vedeu/cells/clear.rb +1 -1
- data/lib/vedeu/cells/cursor.rb +6 -6
- data/lib/vedeu/cells/empty.rb +2 -2
- data/lib/vedeu/cells/escape.rb +6 -6
- data/lib/vedeu/coercers/alignment.rb +1 -1
- data/lib/vedeu/coercers/colour_attributes.rb +8 -16
- data/lib/vedeu/colours/background.rb +4 -8
- data/lib/vedeu/colours/colour.rb +4 -4
- data/lib/vedeu/colours/foreground.rb +4 -8
- data/lib/vedeu/colours/repository.rb +1 -1
- data/lib/vedeu/colours/translator.rb +6 -6
- data/lib/vedeu/common.rb +1 -1
- data/lib/vedeu/configuration/api.rb +15 -15
- data/lib/vedeu/configuration/configuration.rb +8 -8
- data/lib/vedeu/cursors/coordinate.rb +4 -4
- data/lib/vedeu/cursors/cursor.rb +2 -2
- data/lib/vedeu/distributed/client.rb +2 -2
- data/lib/vedeu/distributed/server.rb +8 -10
- data/lib/vedeu/distributed/subprocess.rb +1 -1
- data/lib/vedeu/distributed/uri.rb +1 -1
- data/lib/vedeu/dsl/cursors.rb +2 -2
- data/lib/vedeu/dsl/elements.rb +5 -5
- data/lib/vedeu/dsl/helpers/align.rb +1 -1
- data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
- data/lib/vedeu/dsl/presentation.rb +15 -15
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/dsl/views.rb +1 -1
- data/lib/vedeu/editor/cursor.rb +1 -1
- data/lib/vedeu/editor/line.rb +2 -2
- data/lib/vedeu/editor/lines.rb +2 -2
- data/lib/vedeu/esc/borders.rb +19 -19
- data/lib/vedeu/esc/colours.rb +1 -1
- data/lib/vedeu/events/aliases.rb +3 -15
- data/lib/vedeu/events/event.rb +14 -14
- data/lib/vedeu/events/repository.rb +1 -1
- data/lib/vedeu/geometries/area/area.rb +5 -5
- data/lib/vedeu/geometries/area/dimension.rb +1 -1
- data/lib/vedeu/geometries/dsl/dsl.rb +7 -7
- data/lib/vedeu/geometries/geometry.rb +2 -2
- data/lib/vedeu/geometries/position.rb +6 -6
- data/lib/vedeu/groups/clear.rb +2 -2
- data/lib/vedeu/groups/group.rb +2 -2
- data/lib/vedeu/input/dsl.rb +1 -1
- data/lib/vedeu/input/key.rb +3 -3
- data/lib/vedeu/input/mapper.rb +2 -2
- data/lib/vedeu/input/read.rb +2 -4
- data/lib/vedeu/input/store.rb +1 -17
- data/lib/vedeu/input/translator.rb +49 -45
- data/lib/vedeu/interfaces/clear.rb +3 -3
- data/lib/vedeu/interfaces/dsl.rb +4 -4
- data/lib/vedeu/interfaces/interface.rb +2 -2
- data/lib/vedeu/logging/clock_time.rb +3 -3
- data/lib/vedeu/logging/debug.rb +14 -6
- data/lib/vedeu/logging/log.rb +1 -1
- data/lib/vedeu/menus/dsl.rb +2 -2
- data/lib/vedeu/menus/menu.rb +9 -9
- data/lib/vedeu/models/focus.rb +11 -11
- data/lib/vedeu/models/page.rb +1 -1
- data/lib/vedeu/models/row.rb +1 -1
- data/lib/vedeu/models/toggleable.rb +7 -7
- data/lib/vedeu/null/generic.rb +29 -29
- data/lib/vedeu/output/compressor_cache.rb +1 -11
- data/lib/vedeu/output/viewport.rb +4 -12
- data/lib/vedeu/output/write.rb +3 -3
- data/lib/vedeu/plugins/plugin.rb +1 -1
- data/lib/vedeu/presentation/colour.rb +1 -1
- data/lib/vedeu/presentation/presentation.rb +1 -1
- data/lib/vedeu/presentation/style.rb +4 -4
- data/lib/vedeu/renderers/all.rb +1 -14
- data/lib/vedeu/renderers/options.rb +1 -1
- data/lib/vedeu/repositories/all.rb +1 -0
- data/lib/vedeu/repositories/assemblage.rb +1 -1
- data/lib/vedeu/repositories/collection.rb +4 -4
- data/lib/vedeu/repositories/registerable.rb +2 -2
- data/lib/vedeu/repositories/repositories.rb +1 -1
- data/lib/vedeu/repositories/repository.rb +3 -3
- data/lib/vedeu/repositories/storage.rb +38 -0
- data/lib/vedeu/repositories/store.rb +5 -22
- data/lib/vedeu/runtime/application.rb +1 -1
- data/lib/vedeu/runtime/flags.rb +3 -3
- data/lib/vedeu/runtime/router.rb +3 -18
- data/lib/vedeu/templating/helpers.rb +5 -3
- data/lib/vedeu/templating/view_template.rb +26 -18
- data/lib/vedeu/terminal/terminal.rb +5 -5
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/chars.rb +1 -1
- data/lib/vedeu/views/composition.rb +4 -4
- data/lib/vedeu/views/default_attributes.rb +2 -2
- data/lib/vedeu/views/line.rb +6 -6
- data/lib/vedeu/views/lines.rb +1 -1
- data/lib/vedeu/views/stream.rb +6 -6
- data/lib/vedeu/views/streams.rb +1 -1
- data/lib/vedeu/views/view.rb +4 -4
- data/test/lib/vedeu/borders/border_test.rb +1 -1
- data/test/lib/vedeu/borders/caption_test.rb +1 -1
- data/test/lib/vedeu/borders/dsl_test.rb +2 -3
- data/test/lib/vedeu/borders/refresh_test.rb +1 -1
- data/test/lib/vedeu/borders/title_test.rb +1 -1
- data/test/lib/vedeu/buffers/buffer_test.rb +7 -7
- data/test/lib/vedeu/buffers/refresh_test.rb +1 -1
- data/test/lib/vedeu/colours/background_test.rb +27 -0
- data/test/lib/vedeu/colours/foreground_test.rb +27 -0
- data/test/lib/vedeu/cursors/cursor_test.rb +3 -3
- data/test/lib/vedeu/cursors/move_test.rb +1 -1
- data/test/lib/vedeu/cursors/refresh_test.rb +1 -1
- data/test/lib/vedeu/cursors/reposition_test.rb +2 -2
- data/test/lib/vedeu/dsl/view_test.rb +6 -8
- data/test/lib/vedeu/editor/cropper_test.rb +1 -1
- data/test/lib/vedeu/editor/cursor_test.rb +1 -1
- data/test/lib/vedeu/editor/document_test.rb +1 -1
- data/test/lib/vedeu/editor/editor_test.rb +1 -1
- data/test/lib/vedeu/events/aliases_test.rb +0 -14
- data/test/lib/vedeu/geometries/area/area_test.rb +1 -1
- data/test/lib/vedeu/geometries/geometry_test.rb +1 -1
- data/test/lib/vedeu/geometries/move_test.rb +1 -1
- data/test/lib/vedeu/groups/clear_test.rb +1 -1
- data/test/lib/vedeu/groups/dsl_test.rb +1 -1
- data/test/lib/vedeu/groups/group_test.rb +1 -1
- data/test/lib/vedeu/groups/refresh_test.rb +1 -1
- data/test/lib/vedeu/input/capture_test.rb +2 -2
- data/test/lib/vedeu/input/store_test.rb +0 -34
- data/test/lib/vedeu/interfaces/clear_test.rb +1 -1
- data/test/lib/vedeu/interfaces/dsl_test.rb +4 -4
- data/test/lib/vedeu/interfaces/interface_test.rb +1 -1
- data/test/lib/vedeu/menus/dsl_test.rb +1 -1
- data/test/lib/vedeu/null/generic_test.rb +1 -1
- data/test/lib/vedeu/output/compressor_cache_test.rb +0 -33
- data/test/lib/vedeu/renderers/all_test.rb +0 -8
- data/test/lib/vedeu/repositories/repository_test.rb +2 -2
- data/test/lib/vedeu/repositories/storage_test.rb +74 -0
- data/test/lib/vedeu/repositories/store_test.rb +10 -28
- data/test/lib/vedeu/runtime/router_test.rb +0 -8
- data/test/lib/vedeu/views/default_attributes_test.rb +5 -5
- data/test/lib/vedeu/views/view_test.rb +5 -2
- data/test/test_helper.rb +1 -1
- data/vedeu.gemspec +1 -1
- metadata +7 -4
@@ -36,8 +36,8 @@ module Vedeu
|
|
36
36
|
|
37
37
|
d + d_dn
|
38
38
|
end
|
39
|
-
|
40
|
-
|
39
|
+
alias xn dn_position
|
40
|
+
alias yn dn_position
|
41
41
|
|
42
42
|
# Returns the coordinate for a given index.
|
43
43
|
#
|
@@ -63,8 +63,8 @@ module Vedeu
|
|
63
63
|
|
64
64
|
Vedeu::Point.coerce(value: pos, min: bd, max: bdn).value
|
65
65
|
end
|
66
|
-
|
67
|
-
|
66
|
+
alias x d_position
|
67
|
+
alias y d_position
|
68
68
|
|
69
69
|
protected
|
70
70
|
|
data/lib/vedeu/cursors/cursor.rb
CHANGED
@@ -85,7 +85,7 @@ module Vedeu
|
|
85
85
|
def eql?(other)
|
86
86
|
self.class == other.class && name == other.name
|
87
87
|
end
|
88
|
-
|
88
|
+
alias == eql?
|
89
89
|
|
90
90
|
# @return [String]
|
91
91
|
def inspect
|
@@ -183,7 +183,7 @@ module Vedeu
|
|
183
183
|
|
184
184
|
"#{position}#{yield}#{escape_sequence}"
|
185
185
|
end
|
186
|
-
|
186
|
+
alias to_str to_s
|
187
187
|
|
188
188
|
# Hide a named cursor, or without a name, the cursor of the
|
189
189
|
# currently focussed interface.
|
@@ -57,7 +57,7 @@ module Vedeu
|
|
57
57
|
rescue DRb::DRbConnError
|
58
58
|
drb_connection_error
|
59
59
|
end
|
60
|
-
|
60
|
+
alias read input
|
61
61
|
|
62
62
|
# Fetch output from the DRb server.
|
63
63
|
#
|
@@ -68,7 +68,7 @@ module Vedeu
|
|
68
68
|
rescue DRb::DRbConnError
|
69
69
|
drb_connection_error
|
70
70
|
end
|
71
|
-
|
71
|
+
alias write output
|
72
72
|
|
73
73
|
# Shutdown the DRb server and the client application.
|
74
74
|
#
|
@@ -34,7 +34,7 @@ module Vedeu
|
|
34
34
|
def restart
|
35
35
|
instance.restart
|
36
36
|
end
|
37
|
-
|
37
|
+
alias drb_restart restart
|
38
38
|
|
39
39
|
# @return [void]
|
40
40
|
# @see #shutdown
|
@@ -47,21 +47,21 @@ module Vedeu
|
|
47
47
|
def start
|
48
48
|
instance.start
|
49
49
|
end
|
50
|
-
|
50
|
+
alias drb_start start
|
51
51
|
|
52
52
|
# @return [Symbol]
|
53
53
|
# @see #status
|
54
54
|
def status
|
55
55
|
instance.status
|
56
56
|
end
|
57
|
-
|
57
|
+
alias drb_status status
|
58
58
|
|
59
59
|
# @return [void]
|
60
60
|
# @see #stop
|
61
61
|
def stop
|
62
62
|
instance.stop
|
63
63
|
end
|
64
|
-
|
64
|
+
alias drb_stop stop
|
65
65
|
|
66
66
|
end # Eigenclass
|
67
67
|
|
@@ -74,13 +74,13 @@ module Vedeu
|
|
74
74
|
def input(data, type = :keypress)
|
75
75
|
Vedeu.trigger(:_drb_input_, data, type)
|
76
76
|
end
|
77
|
-
|
77
|
+
alias read input
|
78
78
|
|
79
79
|
# @return [void]
|
80
80
|
def output
|
81
81
|
Vedeu.trigger(:_drb_retrieve_output_)
|
82
82
|
end
|
83
|
-
|
83
|
+
alias write output
|
84
84
|
|
85
85
|
# @return [Fixnum] The PID of the currently running application.
|
86
86
|
def pid
|
@@ -103,14 +103,12 @@ module Vedeu
|
|
103
103
|
|
104
104
|
stop
|
105
105
|
|
106
|
-
start
|
107
|
-
|
108
106
|
else
|
109
107
|
log('Not running')
|
110
108
|
|
111
|
-
start
|
112
|
-
|
113
109
|
end
|
110
|
+
|
111
|
+
start
|
114
112
|
end
|
115
113
|
|
116
114
|
# When called will stop the DRb server and attempt to terminate
|
data/lib/vedeu/dsl/cursors.rb
CHANGED
@@ -29,7 +29,7 @@ module Vedeu
|
|
29
29
|
def cursor!
|
30
30
|
cursor(true)
|
31
31
|
end
|
32
|
-
|
32
|
+
alias show_cursor! cursor!
|
33
33
|
|
34
34
|
# Set the cursor to invisible for the interface or view.
|
35
35
|
#
|
@@ -37,7 +37,7 @@ module Vedeu
|
|
37
37
|
def no_cursor!
|
38
38
|
cursor(false)
|
39
39
|
end
|
40
|
-
|
40
|
+
alias hide_cursor! no_cursor!
|
41
41
|
|
42
42
|
end # Cursors
|
43
43
|
|
data/lib/vedeu/dsl/elements.rb
CHANGED
@@ -90,7 +90,7 @@ module Vedeu
|
|
90
90
|
|
91
91
|
end
|
92
92
|
end
|
93
|
-
|
93
|
+
alias streams lines
|
94
94
|
|
95
95
|
# @todo This documentation needs editing. (GL: 2015-12-17)
|
96
96
|
#
|
@@ -272,16 +272,16 @@ module Vedeu
|
|
272
272
|
# @param (see #text)
|
273
273
|
# @return (see #text)
|
274
274
|
def centre(value = '', opts = {})
|
275
|
-
opts
|
275
|
+
opts[:align] = :centre
|
276
276
|
|
277
277
|
text(value, opts)
|
278
278
|
end
|
279
|
-
|
279
|
+
alias center centre
|
280
280
|
|
281
281
|
# @param (see #text)
|
282
282
|
# @return (see #text)
|
283
283
|
def left(value = '', opts = {})
|
284
|
-
opts
|
284
|
+
opts[:align] = :left
|
285
285
|
|
286
286
|
text(value, opts)
|
287
287
|
end
|
@@ -289,7 +289,7 @@ module Vedeu
|
|
289
289
|
# @param (see #text)
|
290
290
|
# @return (see #text)
|
291
291
|
def right(value = '', opts = {})
|
292
|
-
opts
|
292
|
+
opts[:align] = :right
|
293
293
|
|
294
294
|
text(value, opts)
|
295
295
|
end
|
@@ -43,21 +43,21 @@ module Vedeu
|
|
43
43
|
def background(value = '')
|
44
44
|
colour(background: Vedeu::Colours::Background.coerce(value))
|
45
45
|
end
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
46
|
+
alias bg background
|
47
|
+
alias bgcolor background
|
48
|
+
alias background= background
|
49
|
+
alias bg= background
|
50
|
+
alias bgcolor= background
|
51
51
|
|
52
52
|
# @see Vedeu::DSL::Presentation#background
|
53
53
|
def foreground(value = '')
|
54
54
|
colour(foreground: Vedeu::Colours::Foreground.coerce(value))
|
55
55
|
end
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
56
|
+
alias fg foreground
|
57
|
+
alias fgcolor foreground
|
58
|
+
alias foreground= foreground
|
59
|
+
alias fg= foreground
|
60
|
+
alias fgcolor= foreground
|
61
61
|
|
62
62
|
# Define either or both foreground and background colours for an
|
63
63
|
# interface, line or a stream. At least one attribute is
|
@@ -90,9 +90,9 @@ module Vedeu
|
|
90
90
|
# @return [Vedeu::Colours::Colour]
|
91
91
|
def colour(attrs = {})
|
92
92
|
model.colour = Vedeu::Colours::Colour
|
93
|
-
|
93
|
+
.coerce(colour_attributes.merge!(attrs))
|
94
94
|
end
|
95
|
-
|
95
|
+
alias colour= colour
|
96
96
|
|
97
97
|
# Define a style or styles for an interface, line or a stream.
|
98
98
|
#
|
@@ -118,9 +118,9 @@ module Vedeu
|
|
118
118
|
def style(value)
|
119
119
|
model.style = Vedeu::Presentation::Style.coerce(value)
|
120
120
|
end
|
121
|
-
|
122
|
-
|
123
|
-
|
121
|
+
alias style= style
|
122
|
+
alias styles style
|
123
|
+
alias styles= style
|
124
124
|
|
125
125
|
private
|
126
126
|
|
data/lib/vedeu/dsl/view.rb
CHANGED
data/lib/vedeu/dsl/views.rb
CHANGED
@@ -104,7 +104,7 @@ module Vedeu
|
|
104
104
|
|
105
105
|
composition(eval('self', block.binding), true, &block)
|
106
106
|
end
|
107
|
-
|
107
|
+
alias render renders
|
108
108
|
|
109
109
|
# {include:file:docs/dsl/by_method/views.md}
|
110
110
|
# @param block [Proc] The directives you wish to send to
|
data/lib/vedeu/editor/cursor.rb
CHANGED
data/lib/vedeu/editor/line.rb
CHANGED
data/lib/vedeu/editor/lines.rb
CHANGED
@@ -16,7 +16,7 @@ module Vedeu
|
|
16
16
|
# @!attribute [rw] collection
|
17
17
|
# @return [String]
|
18
18
|
attr_accessor :collection
|
19
|
-
|
19
|
+
alias lines collection
|
20
20
|
|
21
21
|
class << self
|
22
22
|
|
@@ -131,7 +131,7 @@ module Vedeu
|
|
131
131
|
def to_s
|
132
132
|
collection.map(&:to_s).join
|
133
133
|
end
|
134
|
-
|
134
|
+
alias to_str to_s
|
135
135
|
|
136
136
|
end # Lines
|
137
137
|
|
data/lib/vedeu/esc/borders.rb
CHANGED
@@ -38,70 +38,70 @@ module Vedeu
|
|
38
38
|
#
|
39
39
|
# @return [String]
|
40
40
|
def bottom_left
|
41
|
-
|
41
|
+
%(\x6D)
|
42
42
|
end
|
43
43
|
|
44
|
-
# ┘
|
44
|
+
# Produces '┘' (\u2518)
|
45
45
|
#
|
46
46
|
# @return [String]
|
47
47
|
def bottom_right
|
48
|
-
|
48
|
+
%(\x6A)
|
49
49
|
end
|
50
50
|
|
51
|
-
# ─
|
51
|
+
# Produces '─' (\u2500)
|
52
52
|
#
|
53
53
|
# @return [String]
|
54
54
|
def horizontal
|
55
|
-
|
55
|
+
%(\x71)
|
56
56
|
end
|
57
57
|
|
58
|
-
# ┴
|
58
|
+
# Produces '┴' (\u2534)
|
59
59
|
#
|
60
60
|
# @return [String]
|
61
61
|
def horizontal_bottom
|
62
|
-
|
62
|
+
%(\x76)
|
63
63
|
end
|
64
64
|
|
65
|
-
# ┬
|
65
|
+
# Produces '┬' (\u252C)
|
66
66
|
#
|
67
67
|
# @return [String]
|
68
68
|
def horizontal_top
|
69
|
-
|
69
|
+
%(\x77)
|
70
70
|
end
|
71
71
|
|
72
|
-
# ┌
|
72
|
+
# Produces '┌' (\u250C)
|
73
73
|
#
|
74
74
|
# @return [String]
|
75
75
|
def top_left
|
76
|
-
|
76
|
+
%(\x6C)
|
77
77
|
end
|
78
78
|
|
79
|
-
# ┐
|
79
|
+
# Produces '┐' (\u2510)
|
80
80
|
#
|
81
81
|
# @return [String]
|
82
82
|
def top_right
|
83
|
-
|
83
|
+
%(\x6B)
|
84
84
|
end
|
85
85
|
|
86
|
-
# │
|
86
|
+
# Produces '│' (\u2502)
|
87
87
|
#
|
88
88
|
# @return [String]
|
89
89
|
def vertical
|
90
|
-
|
90
|
+
%(\x78)
|
91
91
|
end
|
92
92
|
|
93
|
-
# ├
|
93
|
+
# Produces '├' (\u251C)
|
94
94
|
#
|
95
95
|
# @return [String]
|
96
96
|
def vertical_left
|
97
|
-
|
97
|
+
%(\x74)
|
98
98
|
end
|
99
99
|
|
100
|
-
# ┤
|
100
|
+
# Produces '┤' (\u2524)
|
101
101
|
#
|
102
102
|
# @return [String]
|
103
103
|
def vertical_right
|
104
|
-
|
104
|
+
%(\x75)
|
105
105
|
end
|
106
106
|
|
107
107
|
end # Borders
|
data/lib/vedeu/esc/colours.rb
CHANGED
data/lib/vedeu/events/aliases.rb
CHANGED
@@ -11,6 +11,7 @@ module Vedeu
|
|
11
11
|
|
12
12
|
include Vedeu::Common
|
13
13
|
extend self
|
14
|
+
extend Vedeu::Repositories::Storage
|
14
15
|
|
15
16
|
# {include:file:docs/dsl/by_method/bind_alias.md}
|
16
17
|
# @param alias_name [Symbol] The name of the alias. This can
|
@@ -22,7 +23,7 @@ module Vedeu
|
|
22
23
|
def bind_alias(alias_name, event_name)
|
23
24
|
storage[alias_name] << event_name
|
24
25
|
end
|
25
|
-
|
26
|
+
alias add bind_alias
|
26
27
|
|
27
28
|
# Return a boolean indicating whether the storage is empty.
|
28
29
|
#
|
@@ -57,20 +58,7 @@ module Vedeu
|
|
57
58
|
storage.delete(alias_name)
|
58
59
|
storage
|
59
60
|
end
|
60
|
-
|
61
|
-
|
62
|
-
# @return [Hash<Symbol => Array<Symbol>>]
|
63
|
-
def reset!
|
64
|
-
@storage = in_memory
|
65
|
-
end
|
66
|
-
alias_method :reset, :reset!
|
67
|
-
|
68
|
-
# Access to the storage for this repository.
|
69
|
-
#
|
70
|
-
# @return [Hash<Symbol => Array<Symbol>>]
|
71
|
-
def storage
|
72
|
-
@storage ||= in_memory
|
73
|
-
end
|
61
|
+
alias remove unbind_alias
|
74
62
|
|
75
63
|
# @param alias_name [Symbol]
|
76
64
|
# @param args [void]
|