vedeu 0.6.28 → 0.6.29
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/README.md +1 -0
- data/docs/dsl.md +4 -4
- data/docs/keymaps.md +25 -0
- data/lib/vedeu/all.rb +1 -1
- data/lib/vedeu/borders/border.rb +1 -1
- data/lib/vedeu/borders/refresh.rb +1 -1
- data/lib/vedeu/common.rb +1 -1
- data/lib/vedeu/dsl/all.rb +0 -2
- data/lib/vedeu/dsl/presentation.rb +1 -1
- data/lib/vedeu/dsl/shared.rb +1 -1
- data/lib/vedeu/dsl/text.rb +1 -1
- data/lib/vedeu/dsl/view.rb +11 -13
- data/lib/vedeu/editor/cropper.rb +1 -1
- data/lib/vedeu/editor/document.rb +6 -8
- data/lib/vedeu/geometry/geometry.rb +6 -0
- data/lib/vedeu/geometry/position.rb +2 -0
- data/lib/vedeu/groups/group.rb +1 -1
- data/lib/vedeu/input/all.rb +1 -0
- data/lib/vedeu/{dsl/keymap.rb → input/dsl.rb} +6 -6
- data/lib/vedeu/interfaces/all.rb +12 -0
- data/lib/vedeu/{dsl/interface.rb → interfaces/dsl.rb} +10 -10
- data/lib/vedeu/{models → interfaces}/interface.rb +6 -6
- data/lib/vedeu/{null/interface.rb → interfaces/null.rb} +6 -6
- data/lib/vedeu/{models/interfaces.rb → interfaces/repository.rb} +10 -10
- data/lib/vedeu/logging/log.rb +18 -12
- data/lib/vedeu/models/focus.rb +1 -1
- data/lib/vedeu/models/toggleable.rb +1 -1
- data/lib/vedeu/models/views/all.rb +0 -2
- data/lib/vedeu/models/views/composition.rb +12 -7
- data/lib/vedeu/models/views/line.rb +1 -0
- data/lib/vedeu/models/views/stream.rb +1 -0
- data/lib/vedeu/null/all.rb +0 -1
- data/lib/vedeu/output/clear/interface.rb +1 -1
- data/lib/vedeu/output/output.rb +28 -10
- data/lib/vedeu/output/refresh/refresh.rb +1 -1
- data/lib/vedeu/output/renderers/all.rb +11 -2
- data/lib/vedeu/output/text.rb +9 -2
- data/lib/vedeu/repositories/model.rb +9 -7
- data/lib/vedeu/repositories/repositories.rb +7 -7
- data/lib/vedeu/runtime/main_loop.rb +2 -0
- data/lib/vedeu/templating/view_template.rb +1 -1
- data/lib/vedeu/terminal/buffer.rb +2 -0
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/borders/refresh_test.rb +1 -1
- data/test/lib/vedeu/dsl/presentation_test.rb +2 -2
- data/test/lib/vedeu/dsl/text_test.rb +2 -1
- data/test/lib/vedeu/editor/cropper_test.rb +1 -1
- data/test/lib/vedeu/editor/document_test.rb +1 -1
- data/test/lib/vedeu/geometry/geometry_test.rb +3 -0
- data/test/lib/vedeu/groups/group_test.rb +3 -3
- data/test/lib/vedeu/{dsl/keymap_test.rb → input/dsl_test.rb} +5 -5
- data/test/lib/vedeu/{dsl/interface_test.rb → interfaces/dsl_test.rb} +7 -7
- data/test/lib/vedeu/{models → interfaces}/interface_test.rb +3 -3
- data/test/lib/vedeu/{null/interface_test.rb → interfaces/null_test.rb} +5 -5
- data/test/lib/vedeu/{models/interfaces_test.rb → interfaces/repository_test.rb} +5 -5
- data/test/lib/vedeu/logging/log_test.rb +2 -2
- data/test/lib/vedeu/models/views/view_test.rb +1 -1
- data/test/lib/vedeu/output/clear/interface_test.rb +1 -1
- data/test/lib/vedeu/output/output_test.rb +5 -10
- data/test/lib/vedeu/output/presentation/presentation_test.rb +1 -1
- data/test/lib/vedeu/output/refresh/refresh_test.rb +1 -1
- data/test/lib/vedeu/output/renderers/all_test.rb +2 -0
- data/test/lib/vedeu/output/viewport_test.rb +1 -1
- data/test/lib/vedeu/terminal/buffer_test.rb +1 -1
- data/test/test_helper.rb +1 -0
- metadata +19 -20
- data/lib/vedeu/output/direct.rb +0 -64
- data/test/lib/vedeu/output/direct_test.rb +0 -76
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: acc3caf904e10f4af35074e6b869c3ad65f96af2
|
4
|
+
data.tar.gz: fe00ef8a86cc1e6e4615361e9d57e30ed2f316fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0c354b58c059144923e853c58d3a3b5d5ac31b194f51362cb876c9182fa2fde1003781963b1b3fc69e17e36e830af7f4c6ad6f053b67003289345eed811c9d3
|
7
|
+
data.tar.gz: 2c618148a9cf0f395c110ba0b4e9d1aa845966f1c9d2d1d771860bb27f808b24502e66550aac3c6fdf9e677bb3ed653a5d3d50c0b0259e73564d3192e5164a4f
|
data/.yardopts
CHANGED
data/README.md
CHANGED
@@ -55,6 +55,7 @@ here is some documentation for the various aspects of Vedeu:
|
|
55
55
|
- [Geometry](http://rubydoc.info/gems/vedeu/file/docs/geometry.md)
|
56
56
|
- [Borders](http://rubydoc.info/gems/vedeu/file/docs/border.md)
|
57
57
|
- [Cursors](http://rubydoc.info/gems/vedeu/file/docs/cursor.md)
|
58
|
+
- [Keymaps](http://rubydoc.info/gems/vedeu/file/docs/keymaps.md)
|
58
59
|
- [Events](http://rubydoc.info/gems/vedeu/file/docs/events.md)
|
59
60
|
- [Configuration](http://rubydoc.info/gems/vedeu/file/docs/configuration.md)
|
60
61
|
- [Getting Started](http://rubydoc.info/gems/vedeu/file/docs/getting_started.md)
|
data/docs/dsl.md
CHANGED
@@ -129,9 +129,9 @@ end
|
|
129
129
|
|
130
130
|
## Keymaps
|
131
131
|
|
132
|
-
{include:Vedeu::DSL
|
133
|
-
{include:Vedeu::DSL
|
134
|
-
{include:Vedeu::DSL
|
132
|
+
{include:Vedeu::Keymaps::DSL}
|
133
|
+
{include:Vedeu::Keymaps::DSL.keymap}
|
134
|
+
{include:Vedeu::Keymaps::DSL#name}
|
135
135
|
|
136
136
|
## Menus
|
137
137
|
|
@@ -143,7 +143,7 @@ end
|
|
143
143
|
## Views
|
144
144
|
|
145
145
|
{include:Vedeu::DSL::View}
|
146
|
-
{include:Vedeu::DSL
|
146
|
+
{include:Vedeu::Interfaces::DSL.interface}
|
147
147
|
|
148
148
|
### Immediate rendering
|
149
149
|
|
data/docs/keymaps.md
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# @title Vedeu Keymaps
|
2
|
+
# Vedeu Keymaps
|
3
|
+
|
4
|
+
Keymaps define the keypresses applicable to an interface or view. A
|
5
|
+
keymap sharing the same name as an interface will only operate if that
|
6
|
+
interface is currently in focus.
|
7
|
+
|
8
|
+
Alongside this functioanlity, there is a global keymap '_global_'
|
9
|
+
which will respond to keypresses regardless of which interface is in
|
10
|
+
focus. The global keymap is useful for mapping the key to exit the
|
11
|
+
application for example.
|
12
|
+
|
13
|
+
- It has a name. This name associates it with an
|
14
|
+
{file:docs/interface.md Interface}.
|
15
|
+
- A key registered with a keymap can call a method or trigger an
|
16
|
+
event, or either, in multitude.
|
17
|
+
- Keymaps only affect the interface/view with the same name.
|
18
|
+
- The same key can be registered with mulitple keymaps and perform
|
19
|
+
different actions dependent on which interface is currently in
|
20
|
+
focus.
|
21
|
+
- Some keys on the keymap are stored as strings, whilst others are
|
22
|
+
symbols; representations of the keys pressed.
|
23
|
+
|
24
|
+
You can find out which keys Vedeu recognises here:
|
25
|
+
{Vedeu::Input::Translator}.
|
data/lib/vedeu/all.rb
CHANGED
@@ -15,7 +15,6 @@ require 'vedeu/repositories/all'
|
|
15
15
|
|
16
16
|
require 'vedeu/models/toggleable'
|
17
17
|
|
18
|
-
require 'vedeu/output/direct'
|
19
18
|
require 'vedeu/output/clear/all'
|
20
19
|
require 'vedeu/output/compressor'
|
21
20
|
require 'vedeu/output/text'
|
@@ -42,6 +41,7 @@ require 'vedeu/events/all'
|
|
42
41
|
require 'vedeu/geometry/all'
|
43
42
|
require 'vedeu/groups/all'
|
44
43
|
require 'vedeu/input/all'
|
44
|
+
require 'vedeu/interfaces/all'
|
45
45
|
require 'vedeu/menus/all'
|
46
46
|
require 'vedeu/templating/all'
|
47
47
|
|
data/lib/vedeu/borders/border.rb
CHANGED
data/lib/vedeu/common.rb
CHANGED
@@ -16,7 +16,7 @@ module Vedeu
|
|
16
16
|
# Removes the module part from the expression in the string.
|
17
17
|
#
|
18
18
|
# @example
|
19
|
-
# demodulize('Vedeu::
|
19
|
+
# demodulize('Vedeu::SomeModule::SomeClass') # => "SomeClass"
|
20
20
|
#
|
21
21
|
# @param klass [Class|String]
|
22
22
|
# @return [String]
|
data/lib/vedeu/dsl/all.rb
CHANGED
@@ -13,9 +13,7 @@ require 'vedeu/dsl/shared'
|
|
13
13
|
require 'vedeu/dsl/use'
|
14
14
|
require 'vedeu/dsl/presentation'
|
15
15
|
require 'vedeu/dsl/composition'
|
16
|
-
require 'vedeu/dsl/keymap'
|
17
16
|
require 'vedeu/dsl/text'
|
18
|
-
require 'vedeu/dsl/interface'
|
19
17
|
require 'vedeu/dsl/line'
|
20
18
|
require 'vedeu/dsl/stream'
|
21
19
|
require 'vedeu/dsl/view'
|
data/lib/vedeu/dsl/shared.rb
CHANGED
data/lib/vedeu/dsl/text.rb
CHANGED
@@ -64,7 +64,7 @@ module Vedeu
|
|
64
64
|
# string is shorter than the specified width.
|
65
65
|
# @return [String]
|
66
66
|
def text(value = '', options = {})
|
67
|
-
options.merge!(anchor: __callee__, model: model)
|
67
|
+
options.merge!(anchor: __callee__, model: model, client: client)
|
68
68
|
|
69
69
|
Vedeu::Output::Text.add(value, options)
|
70
70
|
end
|
data/lib/vedeu/dsl/view.rb
CHANGED
@@ -10,7 +10,7 @@ module Vedeu
|
|
10
10
|
# Both of these approaches require that you have defined an
|
11
11
|
# interface (or 'visible area') first. You can find out how to
|
12
12
|
# define an interface with Vedeu below or in
|
13
|
-
# {Vedeu::DSL
|
13
|
+
# {Vedeu::Interfaces::DSL}. The examples in 'Immediate Render' and
|
14
14
|
# 'Deferred View' use these interface definitions: (Note: should
|
15
15
|
# you use these examples, ensure your terminal is at least 70
|
16
16
|
# characters in width and 5 lines in height.)
|
@@ -136,7 +136,9 @@ module Vedeu
|
|
136
136
|
def renders(&block)
|
137
137
|
fail Vedeu::Error::RequiresBlock unless block_given?
|
138
138
|
|
139
|
-
|
139
|
+
client = eval('self', block.binding)
|
140
|
+
|
141
|
+
store(:store_immediate, client, &block)
|
140
142
|
end
|
141
143
|
alias_method :render, :renders
|
142
144
|
|
@@ -181,19 +183,13 @@ module Vedeu
|
|
181
183
|
def views(&block)
|
182
184
|
fail Vedeu::Error::RequiresBlock unless block_given?
|
183
185
|
|
184
|
-
|
186
|
+
client = eval('self', block.binding)
|
187
|
+
|
188
|
+
store(:store_deferred, client, &block)
|
185
189
|
end
|
186
190
|
|
187
191
|
private
|
188
192
|
|
189
|
-
# Returns the client object which called the DSL method.
|
190
|
-
#
|
191
|
-
# @param block [Proc]
|
192
|
-
# @return [Object]
|
193
|
-
def client(&block)
|
194
|
-
eval('self', block.binding)
|
195
|
-
end
|
196
|
-
|
197
193
|
# Creates a new Vedeu::Views::Composition which may contain
|
198
194
|
# one or more views (Vedeu::Views::View objects).
|
199
195
|
#
|
@@ -210,10 +206,12 @@ module Vedeu
|
|
210
206
|
# @param method [Symbol] An instruction; `:store_immediate` or
|
211
207
|
# `:store_deferred` which determines whether the view will
|
212
208
|
# be shown immediately or later respectively.
|
209
|
+
# @param client [Object] The client class which called the DSL
|
210
|
+
# object.
|
213
211
|
# @param block [Proc]
|
214
212
|
# @return [Array]
|
215
|
-
def store(method, &block)
|
216
|
-
composition(client
|
213
|
+
def store(method, client, &block)
|
214
|
+
composition(client, &block).views.map do |view|
|
217
215
|
view.public_send(method)
|
218
216
|
end
|
219
217
|
end
|
data/lib/vedeu/editor/cropper.rb
CHANGED
@@ -178,14 +178,14 @@ module Vedeu
|
|
178
178
|
#
|
179
179
|
# @return [Vedeu::Editor::Document]
|
180
180
|
def up
|
181
|
-
|
182
|
-
cursor.up
|
181
|
+
return self if y - 1 < 0
|
183
182
|
|
183
|
+
cursor.up
|
184
|
+
|
185
|
+
if x > line(y).size
|
184
186
|
eol
|
185
187
|
|
186
188
|
else
|
187
|
-
cursor.up
|
188
|
-
|
189
189
|
refresh
|
190
190
|
|
191
191
|
end
|
@@ -197,14 +197,12 @@ module Vedeu
|
|
197
197
|
def down
|
198
198
|
return self if y + 1 >= lines.size
|
199
199
|
|
200
|
-
|
201
|
-
cursor.down
|
200
|
+
cursor.down
|
202
201
|
|
202
|
+
if x > line(y).size
|
203
203
|
eol
|
204
204
|
|
205
205
|
else
|
206
|
-
cursor.down
|
207
|
-
|
208
206
|
refresh
|
209
207
|
|
210
208
|
end
|
@@ -72,6 +72,10 @@ module Vedeu
|
|
72
72
|
# @return [Fixnum]
|
73
73
|
attr_writer :yn
|
74
74
|
|
75
|
+
# @!attribute [rw] client
|
76
|
+
# @return [Object]
|
77
|
+
attr_accessor :client
|
78
|
+
|
75
79
|
# @param (see #initialize)
|
76
80
|
# @return (see #initialize)
|
77
81
|
def self.store(attributes)
|
@@ -194,6 +198,7 @@ module Vedeu
|
|
194
198
|
store do
|
195
199
|
Vedeu.trigger(:_clear_)
|
196
200
|
Vedeu.trigger(:_refresh_)
|
201
|
+
Vedeu.trigger(:_refresh_view_, name)
|
197
202
|
end
|
198
203
|
end
|
199
204
|
|
@@ -283,6 +288,7 @@ module Vedeu
|
|
283
288
|
# @return [Hash]
|
284
289
|
def defaults
|
285
290
|
{
|
291
|
+
client: nil,
|
286
292
|
centred: nil,
|
287
293
|
height: nil,
|
288
294
|
maximised: false,
|
data/lib/vedeu/groups/group.rb
CHANGED
@@ -162,7 +162,7 @@ module Vedeu
|
|
162
162
|
|
163
163
|
# Return the interfaces for all members of the group.
|
164
164
|
#
|
165
|
-
# @return [Array<Vedeu::
|
165
|
+
# @return [Array<Vedeu::Interfaces::Interface]
|
166
166
|
def interfaces
|
167
167
|
members.map { |name| Vedeu.interfaces.by_name(name) }
|
168
168
|
end
|
data/lib/vedeu/input/all.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
module
|
3
|
+
module Keymaps
|
4
4
|
|
5
5
|
# You can define keymaps by name which matches a defined
|
6
6
|
# interface. When that interface is in focus, keys pressed as part
|
7
7
|
# of this definition will affect that interface. This allows you
|
8
8
|
# to form context driven behaviour for your application.
|
9
9
|
#
|
10
|
-
class
|
10
|
+
class DSL
|
11
11
|
|
12
12
|
include Vedeu::Common
|
13
13
|
include Vedeu::DSL
|
@@ -110,12 +110,12 @@ module Vedeu
|
|
110
110
|
end
|
111
111
|
alias_method :name=, :name
|
112
112
|
|
113
|
-
end #
|
113
|
+
end # DSL
|
114
114
|
|
115
|
-
end #
|
115
|
+
end # Keymaps
|
116
116
|
|
117
117
|
# @!method keymap
|
118
|
-
# @see Vedeu::DSL
|
119
|
-
def_delegators Vedeu::DSL
|
118
|
+
# @see Vedeu::Keymaps::DSL.keymap
|
119
|
+
def_delegators Vedeu::Keymaps::DSL, :keymap
|
120
120
|
|
121
121
|
end # Vedeu
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
module
|
3
|
+
module Interfaces
|
4
4
|
|
5
5
|
# DSL for creating interfaces.
|
6
6
|
#
|
7
|
-
class
|
7
|
+
class DSL
|
8
8
|
|
9
9
|
include Vedeu::Common
|
10
10
|
include Vedeu::DSL
|
@@ -32,7 +32,7 @@ module Vedeu
|
|
32
32
|
# @param block [Proc] A set of attributes which define the
|
33
33
|
# features of the interface.
|
34
34
|
# @raise [Vedeu::Error::RequiresBlock]
|
35
|
-
# @return [Vedeu::
|
35
|
+
# @return [Vedeu::Interfaces::Interface]
|
36
36
|
# @todo More documentation required.
|
37
37
|
def interface(name, &block)
|
38
38
|
fail Vedeu::Error::RequiresBlock unless block_given?
|
@@ -45,7 +45,7 @@ module Vedeu
|
|
45
45
|
|
46
46
|
attributes = { client: client(&block), name: name }
|
47
47
|
|
48
|
-
Vedeu::
|
48
|
+
Vedeu::Interfaces::Interface.build(attributes, &block).store
|
49
49
|
end
|
50
50
|
|
51
51
|
private
|
@@ -193,7 +193,7 @@ module Vedeu
|
|
193
193
|
|
194
194
|
# @param name [String|Symbol] The name of the interface to which
|
195
195
|
# this keymap should belong.
|
196
|
-
# @see Vedeu::DSL
|
196
|
+
# @see Vedeu::Keymaps::DSL.keymap
|
197
197
|
def keymap(name = model.name, &block)
|
198
198
|
Vedeu.keymap(name, &block)
|
199
199
|
end
|
@@ -252,7 +252,7 @@ module Vedeu
|
|
252
252
|
#
|
253
253
|
# @param name [String|Symbol] The name of the interface model
|
254
254
|
# you wish to use a value from.
|
255
|
-
# @return [Vedeu::
|
255
|
+
# @return [Vedeu::Interfaces::Interface]
|
256
256
|
def use(name)
|
257
257
|
model.repository.by_name(name)
|
258
258
|
end
|
@@ -312,12 +312,12 @@ module Vedeu
|
|
312
312
|
alias_method :z_index, :zindex
|
313
313
|
alias_method :z, :zindex
|
314
314
|
|
315
|
-
end #
|
315
|
+
end # DSL
|
316
316
|
|
317
|
-
end #
|
317
|
+
end # Interfaces
|
318
318
|
|
319
319
|
# @!method interface
|
320
|
-
# @see Vedeu::DSL
|
321
|
-
def_delegators Vedeu::DSL
|
320
|
+
# @see Vedeu::Interfaces::DSL.interface
|
321
|
+
def_delegators Vedeu::Interfaces::DSL, :interface
|
322
322
|
|
323
323
|
end # Vedeu
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
module
|
3
|
+
module Interfaces
|
4
4
|
|
5
5
|
# An Interface represents a portion of the terminal defined by
|
6
6
|
# {Vedeu::Geometry::Geometry}.
|
@@ -39,7 +39,7 @@ module Vedeu
|
|
39
39
|
# @return [Fixnum]
|
40
40
|
attr_accessor :zindex
|
41
41
|
|
42
|
-
# Return a new instance of Vedeu::
|
42
|
+
# Return a new instance of Vedeu::Interfaces::Interface.
|
43
43
|
#
|
44
44
|
# @param attributes [Hash]
|
45
45
|
# @option attributes client [Vedeu::Client]
|
@@ -48,11 +48,11 @@ module Vedeu
|
|
48
48
|
# @option attributes group [String]
|
49
49
|
# @option attributes name [String|Symbol]
|
50
50
|
# @option attributes parent [Vedeu::Views::Composition]
|
51
|
-
# @option attributes repository [Vedeu::
|
51
|
+
# @option attributes repository [Vedeu::Interfaces::Repository]
|
52
52
|
# @option attributes style [Vedeu::Presentation::Style]
|
53
53
|
# @option attributes visible [Boolean]
|
54
54
|
# @option attributes zindex [Fixnum]
|
55
|
-
# @return [Vedeu::
|
55
|
+
# @return [Vedeu::Interfaces::Interface]
|
56
56
|
def initialize(attributes = {})
|
57
57
|
@attributes = defaults.merge!(attributes)
|
58
58
|
|
@@ -123,7 +123,7 @@ module Vedeu
|
|
123
123
|
|
124
124
|
end # Interface
|
125
125
|
|
126
|
-
end #
|
126
|
+
end # Interfaces
|
127
127
|
|
128
128
|
# @!method hide_interface
|
129
129
|
# @see Vedeu::Toggleable::ClassMethods#hide
|
@@ -131,7 +131,7 @@ module Vedeu
|
|
131
131
|
# @see Vedeu::Toggleable::ClassMethods#show
|
132
132
|
# @!method toggle_interface
|
133
133
|
# @see Vedeu::Toggleable::ClassMethods#toggle
|
134
|
-
def_delegators Vedeu::
|
134
|
+
def_delegators Vedeu::Interfaces::Interface, :hide_interface, :show_interface,
|
135
135
|
:toggle_interface
|
136
136
|
|
137
137
|
end # Vedeu
|
@@ -1,10 +1,10 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
module
|
3
|
+
module Interfaces
|
4
4
|
|
5
5
|
# Provides a non-existent model to swallow messages.
|
6
6
|
#
|
7
|
-
class
|
7
|
+
class Null < Vedeu::Null::Generic
|
8
8
|
|
9
9
|
include Vedeu::Presentation
|
10
10
|
|
@@ -12,19 +12,19 @@ module Vedeu
|
|
12
12
|
# @return [String]
|
13
13
|
attr_reader :attributes
|
14
14
|
|
15
|
-
# Returns a new instance of Vedeu::Null
|
15
|
+
# Returns a new instance of Vedeu::Interfaces::Null.
|
16
16
|
#
|
17
17
|
# @param attributes [Hash<Symbol => void>]
|
18
18
|
# @option attributes name [String|Symbol]
|
19
|
-
# @return [Vedeu::Null
|
19
|
+
# @return [Vedeu::Interfaces::Null]
|
20
20
|
def initialize(attributes = {})
|
21
21
|
@attributes = attributes
|
22
22
|
@name = @attributes[:name]
|
23
23
|
@visible = false
|
24
24
|
end
|
25
25
|
|
26
|
-
end #
|
26
|
+
end # Null
|
27
27
|
|
28
|
-
end #
|
28
|
+
end # Interfaces
|
29
29
|
|
30
30
|
end # Vedeu
|
@@ -1,23 +1,23 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
|
-
module
|
3
|
+
module Interfaces
|
4
4
|
|
5
5
|
# Allows the storing of interfaces and views.
|
6
6
|
#
|
7
|
-
class
|
7
|
+
class Repository < Vedeu::Repositories::Repository
|
8
8
|
|
9
9
|
singleton_class.send(:alias_method, :interfaces, :repository)
|
10
10
|
|
11
|
-
null Vedeu::Null
|
12
|
-
real Vedeu::
|
11
|
+
null Vedeu::Interfaces::Null
|
12
|
+
real Vedeu::Interfaces::Interface
|
13
13
|
|
14
14
|
# Returns the interfaces in zindex order.
|
15
15
|
#
|
16
16
|
# @example
|
17
17
|
# Vedeu.interfaces.zindexed
|
18
18
|
#
|
19
|
-
# @return [Array<Vedeu::
|
20
|
-
# @see Vedeu::DSL
|
19
|
+
# @return [Array<Vedeu::Interfaces::Interface>]
|
20
|
+
# @see Vedeu::Interfaces::DSL#zindex
|
21
21
|
def zindexed
|
22
22
|
all.sort_by(&:zindex)
|
23
23
|
end
|
@@ -26,11 +26,11 @@ module Vedeu
|
|
26
26
|
|
27
27
|
class Interface
|
28
28
|
|
29
|
-
repo Vedeu::
|
29
|
+
repo Vedeu::Interfaces::Repository.repository
|
30
30
|
|
31
31
|
end # Interface
|
32
32
|
|
33
|
-
end #
|
33
|
+
end # Interfaces
|
34
34
|
|
35
35
|
# Manipulate the repository of interfaces.
|
36
36
|
#
|
@@ -38,7 +38,7 @@ module Vedeu
|
|
38
38
|
# Vedeu.interfaces
|
39
39
|
#
|
40
40
|
# @!method interfaces
|
41
|
-
# @return [Vedeu::
|
42
|
-
def_delegators Vedeu::
|
41
|
+
# @return [Vedeu::Interfaces::Repository]
|
42
|
+
def_delegators Vedeu::Interfaces::Repository, :interfaces
|
43
43
|
|
44
44
|
end # Vedeu
|
data/lib/vedeu/logging/log.rb
CHANGED
@@ -138,21 +138,27 @@ module Vedeu
|
|
138
138
|
# @return [Hash<Symbol => Array<Symbol>>]
|
139
139
|
def message_types
|
140
140
|
{
|
141
|
-
|
142
|
-
|
143
|
-
|
141
|
+
create: [:light_cyan, :cyan],
|
142
|
+
store: [:light_cyan, :cyan],
|
143
|
+
update: [:light_cyan, :cyan],
|
144
|
+
reset: [:light_cyan, :cyan],
|
145
|
+
|
146
|
+
event: [:light_magenta, :magenta],
|
147
|
+
|
148
|
+
timer: [:light_yellow, :yellow],
|
149
|
+
|
150
|
+
info: [:white, :default],
|
151
|
+
test: [:white, :default],
|
152
|
+
debug: [:white, :default],
|
153
|
+
|
154
|
+
input: [:light_red, :red],
|
155
|
+
output: [:light_red, :red],
|
144
156
|
error: [:light_red, :red],
|
157
|
+
|
158
|
+
config: [:light_blue, :blue],
|
159
|
+
dsl: [:light_blue, :blue],
|
145
160
|
editor: [:light_blue, :blue],
|
146
161
|
drb: [:light_blue, :blue],
|
147
|
-
event: [:light_magenta, :magenta],
|
148
|
-
info: [:white, :default],
|
149
|
-
input: [:light_red, :red],
|
150
|
-
output: [:light_green, :green],
|
151
|
-
reset: [:light_cyan, :cyan],
|
152
|
-
store: [:light_cyan, :cyan],
|
153
|
-
test: [:light_white, :white],
|
154
|
-
timer: [:light_yellow, :yellow],
|
155
|
-
update: [:light_cyan, :cyan],
|
156
162
|
}
|
157
163
|
end
|
158
164
|
|
data/lib/vedeu/models/focus.rb
CHANGED
@@ -10,7 +10,7 @@ module Vedeu
|
|
10
10
|
# - Interfaces are added to the collection in the order they are
|
11
11
|
# defined.
|
12
12
|
# - If the interface definition contains `focus!`,
|
13
|
-
# (see Vedeu::DSL
|
13
|
+
# (see Vedeu::Interfaces::DSL#focus!) then that interface is
|
14
14
|
# prepended to the list.
|
15
15
|
# - If the `Vedeu.focus_by_name 'some_interface'` declaration is
|
16
16
|
# used, then the list pointer (`current`) is set to the
|
@@ -12,7 +12,5 @@ require 'vedeu/models/views/char'
|
|
12
12
|
require 'vedeu/models/views/html_char'
|
13
13
|
require 'vedeu/models/views/stream'
|
14
14
|
require 'vedeu/models/views/line'
|
15
|
-
require 'vedeu/models/interface'
|
16
|
-
require 'vedeu/models/interfaces'
|
17
15
|
require 'vedeu/models/views/view'
|
18
16
|
require 'vedeu/models/views/composition'
|