vedeu 0.6.10 → 0.6.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/all.rb +17 -103
- data/lib/vedeu/api/all.rb +15 -0
- data/lib/vedeu/api/internal.rb +4 -0
- data/lib/vedeu/application/all.rb +6 -0
- data/lib/vedeu/bindings/all.rb +32 -0
- data/lib/vedeu/bindings/bindings.rb +0 -14
- data/lib/vedeu/bindings/refresh.rb +8 -2
- data/lib/vedeu/bindings/system.rb +1 -0
- data/lib/vedeu/borders/border.rb +1 -1
- data/lib/vedeu/borders/repository.rb +1 -1
- data/lib/vedeu/buffers/buffer.rb +2 -4
- data/lib/vedeu/buffers/repository.rb +1 -1
- data/lib/vedeu/colours/background.rb +1 -1
- data/lib/vedeu/colours/backgrounds.rb +1 -1
- data/lib/vedeu/colours/foreground.rb +1 -1
- data/lib/vedeu/colours/foregrounds.rb +1 -1
- data/lib/vedeu/colours/translator.rb +4 -3
- data/lib/vedeu/configuration/api.rb +2 -1
- data/lib/vedeu/configuration/cli.rb +1 -1
- data/lib/vedeu/cursors/cursor.rb +26 -26
- data/lib/vedeu/cursors/repository.rb +1 -1
- data/lib/vedeu/distributed/all.rb +16 -0
- data/lib/vedeu/distributed/test_application.rb +3 -3
- data/lib/vedeu/dsl/all.rb +22 -0
- data/lib/vedeu/dsl/composition.rb +43 -40
- data/lib/vedeu/dsl/dsl.rb +6 -3
- data/lib/vedeu/dsl/group.rb +23 -16
- data/lib/vedeu/dsl/interface.rb +48 -38
- data/lib/vedeu/dsl/keymap.rb +6 -7
- data/lib/vedeu/dsl/line.rb +6 -3
- data/lib/vedeu/dsl/stream.rb +2 -1
- data/lib/vedeu/editor/cursor.rb +1 -3
- data/lib/vedeu/editor/document.rb +4 -5
- data/lib/vedeu/editor/documents.rb +1 -1
- data/lib/vedeu/editor/line.rb +2 -3
- data/lib/vedeu/editor/lines.rb +2 -3
- data/lib/vedeu/esc/all.rb +14 -0
- data/lib/vedeu/esc/colours.rb +8 -4
- data/lib/vedeu/esc/esc.rb +89 -84
- data/lib/vedeu/events/aliases.rb +1 -2
- data/lib/vedeu/events/collection.rb +1 -1
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/events/repository.rb +1 -1
- data/lib/vedeu/events/trigger.rb +11 -9
- data/lib/vedeu/geometry/dimension.rb +1 -3
- data/lib/vedeu/geometry/generic_coordinate.rb +1 -3
- data/lib/vedeu/geometry/geometry.rb +1 -1
- data/lib/vedeu/geometry/repository.rb +3 -3
- data/lib/vedeu/input/all.rb +3 -0
- data/lib/vedeu/input/keymap.rb +10 -11
- data/lib/vedeu/input/keymaps.rb +1 -1
- data/lib/vedeu/input/keys.rb +1 -1
- data/lib/vedeu/input/mapper.rb +14 -12
- data/lib/vedeu/logging/all.rb +3 -0
- data/lib/vedeu/logging/log.rb +4 -2
- data/lib/vedeu/menus/menu.rb +2 -4
- data/lib/vedeu/menus/repository.rb +1 -1
- data/lib/vedeu/models/all.rb +15 -0
- data/lib/vedeu/models/cell.rb +1 -1
- data/lib/vedeu/models/escape.rb +1 -1
- data/lib/vedeu/models/group.rb +4 -3
- data/lib/vedeu/models/groups.rb +1 -1
- data/lib/vedeu/models/interface.rb +1 -1
- data/lib/vedeu/models/interfaces.rb +1 -1
- data/lib/vedeu/models/views/char.rb +1 -1
- data/lib/vedeu/models/views/collections/chars.rb +1 -1
- data/lib/vedeu/models/views/collections/lines.rb +1 -1
- data/lib/vedeu/models/views/collections/streams.rb +1 -1
- data/lib/vedeu/models/views/collections/view_collection.rb +1 -1
- data/lib/vedeu/models/views/composition.rb +1 -1
- data/lib/vedeu/models/views/line.rb +8 -6
- data/lib/vedeu/models/views/stream.rb +1 -1
- data/lib/vedeu/models/views/view.rb +1 -1
- data/lib/vedeu/null/all.rb +12 -0
- data/lib/vedeu/output/clear/named_group.rb +2 -1
- data/lib/vedeu/output/clear/named_interface.rb +5 -4
- data/lib/vedeu/output/compressor.rb +1 -0
- data/lib/vedeu/output/output.rb +3 -0
- data/lib/vedeu/output/presentation/colour.rb +10 -10
- data/lib/vedeu/output/presentation/presentation.rb +9 -9
- data/lib/vedeu/output/presentation/style.rb +2 -2
- data/lib/vedeu/output/refresh/refresh.rb +35 -0
- data/lib/vedeu/output/refresh/refresh_group.rb +66 -0
- data/lib/vedeu/output/renderers/all.rb +17 -0
- data/lib/vedeu/output/renderers/escape_sequence.rb +4 -2
- data/lib/vedeu/output/renderers/file.rb +7 -6
- data/lib/vedeu/output/renderers/html.rb +9 -7
- data/lib/vedeu/output/renderers/null.rb +1 -1
- data/lib/vedeu/output/renderers/renderer_options.rb +24 -20
- data/lib/vedeu/output/renderers/terminal.rb +1 -1
- data/lib/vedeu/output/renderers/text.rb +1 -1
- data/lib/vedeu/output/wordwrap.rb +7 -4
- data/lib/vedeu/plugins/all.rb +2 -0
- data/lib/vedeu/repositories/all.rb +16 -0
- data/lib/vedeu/repositories/collection.rb +93 -89
- data/lib/vedeu/repositories/model.rb +113 -102
- data/lib/vedeu/repositories/registerable.rb +60 -56
- data/lib/vedeu/repositories/repository.rb +161 -156
- data/lib/vedeu/repositories/store.rb +70 -66
- data/lib/vedeu/runtime/all.rb +15 -0
- data/lib/vedeu/runtime/launcher.rb +19 -16
- data/lib/vedeu/templating/all.rb +6 -0
- data/lib/vedeu/terminal/all.rb +14 -0
- data/lib/vedeu/terminal/buffer.rb +8 -7
- data/lib/vedeu/terminal/mode.rb +11 -10
- data/lib/vedeu/terminal/terminal.rb +50 -45
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/cursors/cursor_test.rb +4 -2
- data/test/lib/vedeu/editor/cursor_test.rb +0 -3
- data/test/lib/vedeu/esc/esc_test.rb +58 -54
- data/test/lib/vedeu/events/collection_test.rb +1 -1
- data/test/lib/vedeu/input/keys_test.rb +1 -1
- data/test/lib/vedeu/input/mapper_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/chars_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/lines_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/streams_test.rb +1 -1
- data/test/lib/vedeu/models/views/collections/view_collection_test.rb +1 -1
- data/test/lib/vedeu/output/refresh/refresh_group_test.rb +43 -0
- data/test/lib/vedeu/output/refresh/refresh_test.rb +50 -0
- data/test/lib/vedeu/output/renderers/renderer_options_test.rb +8 -4
- data/test/lib/vedeu/output/renderers_test.rb +2 -1
- data/test/lib/vedeu/repositories/collection_test.rb +105 -101
- data/test/lib/vedeu/repositories/model_test.rb +56 -52
- data/test/lib/vedeu/repositories/registerable_test.rb +36 -32
- data/test/lib/vedeu/repositories/repository_test.rb +178 -174
- data/test/lib/vedeu/repositories/store_test.rb +109 -105
- data/test/support/examples/material_colours_app.rb +0 -1
- data/test/support/helpers/model_test_class.rb +50 -46
- data/test/test_helper.rb +2 -2
- metadata +21 -9
- data/lib/vedeu/refresh/refresh.rb +0 -31
- data/lib/vedeu/refresh/refresh_group.rb +0 -59
- data/out_ +0 -50
- data/test/lib/vedeu/refresh/refresh_group_test.rb +0 -39
- data/test/lib/vedeu/refresh/refresh_test.rb +0 -46
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fd5d4c600e6a615165182a1f701d54b8f073b33a
|
4
|
+
data.tar.gz: 30af16d08fc9b2d86a2a4aa998b205cb15f32bd1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f3b9d230aa8dea217cb114e762be87c5cac80008dc7530522efe51c419358415e5e839139005d8bb2bd898531c1688a03f1e0a8762294e12fd56ae4232349151
|
7
|
+
data.tar.gz: f5f59df013fe45ee4d7aa4241768cea05acd733b45e2a999a235a8916f95beae94bd8137fdd70fbe297a4eae931d01fa14b9510bcf4cfb3622a07f69f2d3ea78
|
data/lib/vedeu/all.rb
CHANGED
@@ -1,139 +1,53 @@
|
|
1
1
|
require 'vedeu/version'
|
2
2
|
require 'vedeu/options'
|
3
3
|
|
4
|
-
require 'vedeu/runtime/launcher'
|
5
|
-
require 'vedeu/runtime/bootstrap'
|
6
4
|
require 'vedeu/error'
|
7
|
-
|
8
|
-
require 'vedeu/logging/all'
|
9
|
-
|
10
|
-
require 'vedeu/runtime/traps'
|
11
5
|
require 'vedeu/common'
|
12
|
-
require 'vedeu/
|
6
|
+
require 'vedeu/logging/all'
|
7
|
+
require 'vedeu/runtime/all'
|
13
8
|
|
14
9
|
require 'vedeu/configuration/cli'
|
15
10
|
require 'vedeu/configuration/api'
|
16
11
|
require 'vedeu/configuration/configuration'
|
17
12
|
|
18
|
-
require 'vedeu/terminal/
|
19
|
-
require 'vedeu/
|
20
|
-
require 'vedeu/terminal/buffer'
|
21
|
-
|
22
|
-
require 'vedeu/runtime/main_loop'
|
23
|
-
require 'vedeu/runtime/flags'
|
24
|
-
require 'vedeu/runtime/application'
|
13
|
+
require 'vedeu/terminal/all'
|
14
|
+
require 'vedeu/repositories/all'
|
25
15
|
|
26
|
-
require 'vedeu/repositories/collection'
|
27
16
|
require 'vedeu/input/keys'
|
28
|
-
require 'vedeu/repositories/repositories'
|
29
|
-
|
30
|
-
require 'vedeu/repositories/model'
|
31
|
-
require 'vedeu/repositories/store'
|
32
|
-
require 'vedeu/repositories/registerable'
|
33
|
-
require 'vedeu/repositories/repository'
|
34
|
-
|
35
|
-
require 'vedeu/null/null'
|
36
|
-
require 'vedeu/null/generic'
|
37
|
-
require 'vedeu/null/interface'
|
38
|
-
require 'vedeu/null/view'
|
39
|
-
|
40
|
-
require 'vedeu/refresh/refresh'
|
41
|
-
require 'vedeu/refresh/refresh_group'
|
42
17
|
|
43
18
|
require 'vedeu/models/toggleable'
|
44
19
|
|
45
|
-
require 'vedeu/esc/
|
46
|
-
require 'vedeu/
|
47
|
-
require 'vedeu/esc/colours'
|
48
|
-
require 'vedeu/esc/esc'
|
49
|
-
|
20
|
+
require 'vedeu/esc/all'
|
21
|
+
require 'vedeu/null/all'
|
50
22
|
require 'vedeu/models/views/all'
|
51
|
-
|
52
|
-
require 'vedeu/
|
53
|
-
require 'vedeu/
|
54
|
-
require 'vedeu/models/focus'
|
55
|
-
require 'vedeu/models/group'
|
56
|
-
require 'vedeu/models/groups'
|
57
|
-
require 'vedeu/models/row'
|
58
|
-
require 'vedeu/models/page'
|
59
|
-
|
60
|
-
require 'vedeu/templating/all'
|
61
|
-
require 'vedeu/templating/encoder'
|
62
|
-
require 'vedeu/templating/decoder'
|
63
|
-
require 'vedeu/templating/helpers'
|
64
|
-
require 'vedeu/templating/template'
|
65
|
-
require 'vedeu/templating/view_template'
|
66
|
-
|
67
|
-
require 'vedeu/application/controller'
|
68
|
-
require 'vedeu/application/helper'
|
69
|
-
require 'vedeu/application/view'
|
70
|
-
require 'vedeu/application/application_controller'
|
71
|
-
require 'vedeu/application/application_helper'
|
72
|
-
require 'vedeu/application/application_view'
|
73
|
-
|
74
|
-
require 'vedeu/distributed/uri'
|
75
|
-
require 'vedeu/distributed/server'
|
76
|
-
require 'vedeu/distributed/client'
|
77
|
-
require 'vedeu/distributed/subprocess'
|
78
|
-
require 'vedeu/distributed/test_application'
|
79
|
-
|
80
|
-
require 'vedeu/dsl/dsl'
|
81
|
-
require 'vedeu/dsl/shared'
|
82
|
-
require 'vedeu/dsl/use'
|
83
|
-
require 'vedeu/dsl/presentation'
|
84
|
-
require 'vedeu/dsl/composition'
|
85
|
-
require 'vedeu/dsl/group'
|
86
|
-
require 'vedeu/dsl/keymap'
|
87
|
-
require 'vedeu/dsl/text'
|
88
|
-
require 'vedeu/dsl/interface'
|
89
|
-
require 'vedeu/dsl/line'
|
90
|
-
require 'vedeu/dsl/stream'
|
91
|
-
require 'vedeu/dsl/view'
|
92
|
-
|
23
|
+
require 'vedeu/models/all'
|
24
|
+
require 'vedeu/application/all'
|
25
|
+
require 'vedeu/dsl/all'
|
93
26
|
require 'vedeu/borders/all'
|
94
27
|
require 'vedeu/buffers/all'
|
95
28
|
require 'vedeu/colours/all'
|
96
29
|
require 'vedeu/cursors/all'
|
30
|
+
require 'vedeu/distributed/all'
|
97
31
|
require 'vedeu/editor/all'
|
98
32
|
require 'vedeu/events/all'
|
99
33
|
require 'vedeu/geometry/all'
|
100
34
|
require 'vedeu/input/all'
|
101
35
|
require 'vedeu/menus/all'
|
36
|
+
require 'vedeu/templating/all'
|
102
37
|
|
103
38
|
require 'vedeu/output/presentation/presentation'
|
104
|
-
|
105
39
|
require 'vedeu/output/direct'
|
106
40
|
require 'vedeu/output/clear/named_group'
|
107
41
|
require 'vedeu/output/clear/named_interface'
|
108
|
-
|
109
42
|
require 'vedeu/output/compressor'
|
110
43
|
require 'vedeu/output/text'
|
111
44
|
require 'vedeu/output/output'
|
112
45
|
require 'vedeu/output/viewport'
|
113
46
|
require 'vedeu/output/wordwrap'
|
114
|
-
require 'vedeu/output/
|
115
|
-
require 'vedeu/output/
|
116
|
-
require 'vedeu/output/renderers/
|
117
|
-
require 'vedeu/output/renderers/html'
|
118
|
-
require 'vedeu/output/renderers/json'
|
119
|
-
require 'vedeu/output/renderers/null'
|
120
|
-
require 'vedeu/output/renderers/terminal'
|
121
|
-
require 'vedeu/output/renderers/text'
|
122
|
-
require 'vedeu/output/renderers'
|
123
|
-
|
124
|
-
require 'vedeu/api/external'
|
125
|
-
require 'vedeu/api/internal'
|
126
|
-
|
127
|
-
require 'vedeu/bindings/application'
|
128
|
-
require 'vedeu/bindings/document'
|
129
|
-
require 'vedeu/bindings/drb'
|
130
|
-
require 'vedeu/bindings/menus'
|
131
|
-
require 'vedeu/bindings/movement'
|
132
|
-
require 'vedeu/bindings/focus'
|
133
|
-
require 'vedeu/bindings/refresh'
|
134
|
-
require 'vedeu/bindings/system'
|
135
|
-
require 'vedeu/bindings/visibility'
|
136
|
-
require 'vedeu/bindings/bindings'
|
47
|
+
require 'vedeu/output/refresh/refresh'
|
48
|
+
require 'vedeu/output/refresh/refresh_group'
|
49
|
+
require 'vedeu/output/renderers/all'
|
137
50
|
|
138
|
-
require 'vedeu/
|
139
|
-
require 'vedeu/
|
51
|
+
require 'vedeu/api/all'
|
52
|
+
require 'vedeu/bindings/all'
|
53
|
+
require 'vedeu/plugins/all'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
# The API namespace provides the internal and external API methods
|
4
|
+
# for Vedeu. These methods are convenient ways to perform many
|
5
|
+
# actions and control the behaviour of Vedeu without needing to
|
6
|
+
# know the specific implementations.
|
7
|
+
#
|
8
|
+
module API
|
9
|
+
|
10
|
+
end # API
|
11
|
+
|
12
|
+
end # Vedeu
|
13
|
+
|
14
|
+
require 'vedeu/api/external'
|
15
|
+
require 'vedeu/api/internal'
|
data/lib/vedeu/api/internal.rb
CHANGED
@@ -0,0 +1,32 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
# Binds various events for running and manipulating Vedeu. When
|
4
|
+
# called provide a variety of core functions and behaviours.
|
5
|
+
# They are soft-namespaced using underscores.
|
6
|
+
#
|
7
|
+
# @note
|
8
|
+
# The methods these modules use are private, and should not be
|
9
|
+
# called directly, however the produced events are all public and
|
10
|
+
# are highly recommended to be used.
|
11
|
+
#
|
12
|
+
# Unbinding any of these events is likely to cause problems, so I
|
13
|
+
# would advise leaving them alone. A safe rule: when the name
|
14
|
+
# starts and ends with an underscore, it's probably used by Vedeu
|
15
|
+
# internally.
|
16
|
+
#
|
17
|
+
module Bindings
|
18
|
+
|
19
|
+
end # Bindings
|
20
|
+
|
21
|
+
end # Vedeu
|
22
|
+
|
23
|
+
require 'vedeu/bindings/application'
|
24
|
+
require 'vedeu/bindings/document'
|
25
|
+
require 'vedeu/bindings/drb'
|
26
|
+
require 'vedeu/bindings/menus'
|
27
|
+
require 'vedeu/bindings/movement'
|
28
|
+
require 'vedeu/bindings/focus'
|
29
|
+
require 'vedeu/bindings/refresh'
|
30
|
+
require 'vedeu/bindings/system'
|
31
|
+
require 'vedeu/bindings/visibility'
|
32
|
+
require 'vedeu/bindings/bindings'
|
@@ -1,19 +1,5 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
# Binds various events for running and manipulating Vedeu. When
|
4
|
-
# called provide a variety of core functions and behaviours.
|
5
|
-
# They are soft-namespaced using underscores.
|
6
|
-
#
|
7
|
-
# @note
|
8
|
-
# The methods these modules use are private, and should not be
|
9
|
-
# called directly, however the produced events are all public and
|
10
|
-
# are highly recommended to be used.
|
11
|
-
#
|
12
|
-
# Unbinding any of these events is likely to cause problems, so I
|
13
|
-
# would advise leaving them alone. A safe rule: when the name
|
14
|
-
# starts and ends with an underscore, it's probably used by Vedeu
|
15
|
-
# internally.
|
16
|
-
#
|
17
3
|
module Bindings
|
18
4
|
|
19
5
|
extend self
|
@@ -21,7 +21,13 @@ module Vedeu
|
|
21
21
|
# See {file:docs/events/refresh.md#\_refresh_}
|
22
22
|
def refresh!
|
23
23
|
Vedeu.bind(:_refresh_) do |name|
|
24
|
-
|
24
|
+
if name
|
25
|
+
Vedeu::Buffers::Refresh.by_name(name)
|
26
|
+
|
27
|
+
else
|
28
|
+
Vedeu::Output::Refresh.all
|
29
|
+
|
30
|
+
end
|
25
31
|
end
|
26
32
|
end
|
27
33
|
|
@@ -35,7 +41,7 @@ module Vedeu
|
|
35
41
|
# See {file:docs/events/refresh.md#\_refresh_group_}
|
36
42
|
def refresh_group!
|
37
43
|
Vedeu.bind(:_refresh_group_) do |name|
|
38
|
-
Vedeu::RefreshGroup.by_name(name)
|
44
|
+
Vedeu::Output::RefreshGroup.by_name(name)
|
39
45
|
end
|
40
46
|
end
|
41
47
|
|
data/lib/vedeu/borders/border.rb
CHANGED
@@ -5,7 +5,7 @@ module Vedeu
|
|
5
5
|
# Allows the storing of interface/view borders independent of the
|
6
6
|
# interface instance.
|
7
7
|
#
|
8
|
-
class Repository < Vedeu::Repository
|
8
|
+
class Repository < Vedeu::Repositories::Repository
|
9
9
|
|
10
10
|
singleton_class.send(:alias_method, :borders, :repository)
|
11
11
|
|
data/lib/vedeu/buffers/buffer.rb
CHANGED
@@ -7,7 +7,7 @@ module Vedeu
|
|
7
7
|
#
|
8
8
|
class Buffer
|
9
9
|
|
10
|
-
include Vedeu::Model
|
10
|
+
include Vedeu::Repositories::Model
|
11
11
|
|
12
12
|
# The next buffer to be displayed; contains the content which
|
13
13
|
# will be shown on next refresh.
|
@@ -45,9 +45,7 @@ module Vedeu
|
|
45
45
|
# @option attributes repository [Vedeu::Buffers::Repository]
|
46
46
|
# @return [Vedeu::Buffers::Buffer]
|
47
47
|
def initialize(attributes = {})
|
48
|
-
|
49
|
-
|
50
|
-
@attributes.each do |key, value|
|
48
|
+
defaults.merge!(attributes).each do |key, value|
|
51
49
|
instance_variable_set("@#{key}", value)
|
52
50
|
end
|
53
51
|
end
|
@@ -96,7 +96,7 @@ module Vedeu
|
|
96
96
|
alias_method :to_s, :escape_sequence
|
97
97
|
alias_method :to_str, :escape_sequence
|
98
98
|
|
99
|
-
# @param
|
99
|
+
# @param _options [Hash] Ignored.
|
100
100
|
# @return [String]
|
101
101
|
def to_html(_options = {})
|
102
102
|
return colour if rgb?
|
@@ -142,7 +142,8 @@ module Vedeu
|
|
142
142
|
# Returns an escape sequence for a named background colour.
|
143
143
|
#
|
144
144
|
# @note
|
145
|
-
# Valid names can be found at
|
145
|
+
# Valid names can be found at
|
146
|
+
# {Vedeu::EscapeSequences::Esc#codes}
|
146
147
|
#
|
147
148
|
# @return [String]
|
148
149
|
def named
|
@@ -154,7 +155,7 @@ module Vedeu
|
|
154
155
|
#
|
155
156
|
# @return [Boolean]
|
156
157
|
def valid_name?
|
157
|
-
Vedeu::Esc.codes.keys.include?(colour)
|
158
|
+
Vedeu::EscapeSequences::Esc.codes.keys.include?(colour)
|
158
159
|
end
|
159
160
|
|
160
161
|
# Returns a boolean indicating whether the colour provided is a
|
@@ -35,7 +35,8 @@ module Vedeu
|
|
35
35
|
#
|
36
36
|
# @return [Hash<Symbol => Boolean, Fixnum, String>]
|
37
37
|
def configuration
|
38
|
-
Vedeu::Config
|
38
|
+
Vedeu::Config
|
39
|
+
.log(Vedeu::EscapeSequences::Esc.green { '[api]' }, options)
|
39
40
|
end
|
40
41
|
|
41
42
|
# Sets boolean to allow user input. The default behaviour of
|
data/lib/vedeu/cursors/cursor.rb
CHANGED
@@ -7,7 +7,7 @@ module Vedeu
|
|
7
7
|
#
|
8
8
|
class Cursor
|
9
9
|
|
10
|
-
include Vedeu::Model
|
10
|
+
include Vedeu::Repositories::Model
|
11
11
|
include Vedeu::Toggleable
|
12
12
|
extend Forwardable
|
13
13
|
|
@@ -52,7 +52,8 @@ module Vedeu
|
|
52
52
|
# this cursor belongs to.
|
53
53
|
# @option attributes ox [Fixnum] The offset x coordinate.
|
54
54
|
# @option attributes oy [Fixnum] The offset y coordinate.
|
55
|
-
# @option attributes repository
|
55
|
+
# @option attributes repository
|
56
|
+
# [Vedeu::Repositories::Repository]
|
56
57
|
# @option attributes visible [Boolean] The visibility of the
|
57
58
|
# cursor.
|
58
59
|
# @option attributes x [Fixnum] The terminal x coordinate for
|
@@ -75,10 +76,7 @@ module Vedeu
|
|
75
76
|
def move_down
|
76
77
|
@oy += 1
|
77
78
|
|
78
|
-
@attributes =
|
79
|
-
y: coordinate.y_position,
|
80
|
-
ox: ox,
|
81
|
-
oy: oy)
|
79
|
+
@attributes = new_attributes(coordinate.y_position, x, oy, ox)
|
82
80
|
|
83
81
|
Vedeu::Cursors::Cursor.new(@attributes).store
|
84
82
|
end
|
@@ -89,10 +87,7 @@ module Vedeu
|
|
89
87
|
def move_left
|
90
88
|
@ox -= 1
|
91
89
|
|
92
|
-
@attributes =
|
93
|
-
y: y,
|
94
|
-
ox: ox,
|
95
|
-
oy: oy)
|
90
|
+
@attributes = new_attributes(y, coordinate.x_position, oy, ox)
|
96
91
|
|
97
92
|
Vedeu::Cursors::Cursor.new(@attributes).store
|
98
93
|
end
|
@@ -112,10 +107,7 @@ module Vedeu
|
|
112
107
|
def move_right
|
113
108
|
@ox += 1
|
114
109
|
|
115
|
-
@attributes =
|
116
|
-
y: y,
|
117
|
-
ox: ox,
|
118
|
-
oy: oy)
|
110
|
+
@attributes = new_attributes(y, coordinate.x_position, oy, ox)
|
119
111
|
|
120
112
|
Vedeu::Cursors::Cursor.new(@attributes).store
|
121
113
|
end
|
@@ -126,10 +118,7 @@ module Vedeu
|
|
126
118
|
def move_up
|
127
119
|
@oy -= 1
|
128
120
|
|
129
|
-
@attributes =
|
130
|
-
y: coordinate.y_position,
|
131
|
-
ox: ox,
|
132
|
-
oy: oy)
|
121
|
+
@attributes = new_attributes(coordinate.y_position, x, oy, ox)
|
133
122
|
|
134
123
|
Vedeu::Cursors::Cursor.new(@attributes).store
|
135
124
|
end
|
@@ -143,14 +132,14 @@ module Vedeu
|
|
143
132
|
|
144
133
|
# Arbitrarily move the cursor to a given position.
|
145
134
|
#
|
146
|
-
# @param
|
147
|
-
# @param
|
135
|
+
# @param new_oy [Fixnum] The row/line position.
|
136
|
+
# @param new_ox [Fixnum] The column/character position.
|
148
137
|
# @return [Vedeu::Cursors::Cursor]
|
149
|
-
def reposition(
|
150
|
-
@attributes =
|
151
|
-
|
152
|
-
|
153
|
-
|
138
|
+
def reposition(new_oy, new_ox)
|
139
|
+
@attributes = new_attributes(coordinate.y_position,
|
140
|
+
coordinate.x_position,
|
141
|
+
new_oy,
|
142
|
+
new_ox)
|
154
143
|
|
155
144
|
Vedeu::Cursors::Cursor.new(@attributes).store
|
156
145
|
end
|
@@ -280,12 +269,23 @@ module Vedeu
|
|
280
269
|
}
|
281
270
|
end
|
282
271
|
|
272
|
+
# @return [Hash]
|
273
|
+
def new_attributes(new_y = y, new_x = x, new_oy = oy, new_ox = ox)
|
274
|
+
attributes.merge!(x: new_x, y: new_y, ox: new_ox, oy: new_oy)
|
275
|
+
end
|
276
|
+
|
283
277
|
# Returns the escape sequence for setting the visibility of the
|
284
278
|
# cursor.
|
285
279
|
#
|
286
280
|
# @return [String]
|
287
281
|
def visibility
|
288
|
-
value = visible?
|
282
|
+
value = if visible?
|
283
|
+
Vedeu::EscapeSequences::Esc.show_cursor
|
284
|
+
|
285
|
+
else
|
286
|
+
Vedeu::EscapeSequences::Esc.hide_cursor
|
287
|
+
|
288
|
+
end
|
289
289
|
|
290
290
|
Vedeu::Models::Escape.new(position: position, value: value)
|
291
291
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
# Provides a mechanism to control a running client application via
|
4
|
+
# DRb.
|
5
|
+
#
|
6
|
+
module Distributed
|
7
|
+
|
8
|
+
end # Distributed
|
9
|
+
|
10
|
+
end # Vedeu
|
11
|
+
|
12
|
+
require 'vedeu/distributed/uri'
|
13
|
+
require 'vedeu/distributed/server'
|
14
|
+
require 'vedeu/distributed/client'
|
15
|
+
require 'vedeu/distributed/subprocess'
|
16
|
+
require 'vedeu/distributed/test_application'
|
@@ -66,9 +66,9 @@ module Vedeu
|
|
66
66
|
# @option attributes views [String]
|
67
67
|
# @return [Vedeu::TestApplication]
|
68
68
|
def initialize(attributes = {})
|
69
|
-
|
70
|
-
|
71
|
-
|
69
|
+
defaults.merge!(attributes).each do |key, value|
|
70
|
+
instance_variable_set("@#{key}", value)
|
71
|
+
end
|
72
72
|
end
|
73
73
|
|
74
74
|
# @param block [Proc]
|
@@ -0,0 +1,22 @@
|
|
1
|
+
module Vedeu
|
2
|
+
|
3
|
+
# Provides a mechanism to help configure and use Vedeu.
|
4
|
+
#
|
5
|
+
module DSL
|
6
|
+
|
7
|
+
end # DSL
|
8
|
+
|
9
|
+
end # Vedeu
|
10
|
+
|
11
|
+
require 'vedeu/dsl/dsl'
|
12
|
+
require 'vedeu/dsl/shared'
|
13
|
+
require 'vedeu/dsl/use'
|
14
|
+
require 'vedeu/dsl/presentation'
|
15
|
+
require 'vedeu/dsl/composition'
|
16
|
+
require 'vedeu/dsl/group'
|
17
|
+
require 'vedeu/dsl/keymap'
|
18
|
+
require 'vedeu/dsl/text'
|
19
|
+
require 'vedeu/dsl/interface'
|
20
|
+
require 'vedeu/dsl/line'
|
21
|
+
require 'vedeu/dsl/stream'
|
22
|
+
require 'vedeu/dsl/view'
|