vedeu 0.4.32 → 0.4.33
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/vedeu +3 -0
- data/docs/dsl.md +36 -2
- data/examples/borders_app.rb +5 -0
- data/examples/colours_app.rb +5 -0
- data/examples/configuration_app.rb +5 -0
- data/examples/drb_app.rb +4 -0
- data/examples/focus_app.rb +5 -0
- data/examples/geometry_app.rb +4 -0
- data/examples/hello_world.rb +5 -0
- data/examples/material_colours_app.rb +15 -8
- data/examples/panel_app.rb +5 -0
- data/examples/typed_commands/typed_commands_app.rb +4 -4
- data/examples/view_templates_app/view_templates_app.rb +4 -4
- data/lib/vedeu/application.rb +2 -0
- data/lib/vedeu/bindings.rb +1 -0
- data/lib/vedeu/buffers/buffer.rb +2 -0
- data/lib/vedeu/buffers/display_buffer.rb +1 -0
- data/lib/vedeu/configuration/api.rb +2 -0
- data/lib/vedeu/configuration/cli.rb +2 -0
- data/lib/vedeu/configuration/configuration.rb +1 -0
- data/lib/vedeu/cursor/cursor.rb +2 -0
- data/lib/vedeu/cursor/move.rb +2 -0
- data/lib/vedeu/cursor/refresh_cursor.rb +2 -0
- data/lib/vedeu/debug.rb +1 -0
- data/lib/vedeu/distributed/uri.rb +2 -0
- data/lib/vedeu/dsl/all.rb +1 -0
- data/lib/vedeu/dsl/border.rb +3 -0
- data/lib/vedeu/dsl/composition.rb +1 -0
- data/lib/vedeu/dsl/geometry.rb +1 -0
- data/lib/vedeu/dsl/group.rb +2 -0
- data/lib/vedeu/dsl/interface.rb +22 -1
- data/lib/vedeu/dsl/presentation.rb +0 -1
- data/lib/vedeu/dsl/text.rb +1 -0
- data/lib/vedeu/dsl/use.rb +3 -1
- data/lib/vedeu/events/event.rb +2 -0
- data/lib/vedeu/events/trigger.rb +2 -0
- data/lib/vedeu/geometry/area.rb +2 -0
- data/lib/vedeu/geometry/coordinate.rb +2 -0
- data/lib/vedeu/geometry/dimension.rb +2 -0
- data/lib/vedeu/geometry/geometry.rb +1 -0
- data/lib/vedeu/geometry/grid.rb +2 -0
- data/lib/vedeu/geometry/index_position.rb +2 -0
- data/lib/vedeu/geometry/position.rb +2 -0
- data/lib/vedeu/geometry/position_index.rb +2 -0
- data/lib/vedeu/geometry/position_validator.rb +2 -0
- data/lib/vedeu/input/input.rb +2 -0
- data/lib/vedeu/input/key.rb +2 -0
- data/lib/vedeu/input/keymap.rb +2 -0
- data/lib/vedeu/input/mapper.rb +2 -0
- data/lib/vedeu/main_loop.rb +1 -0
- data/lib/vedeu/models/cell.rb +2 -0
- data/lib/vedeu/models/char.rb +2 -0
- data/lib/vedeu/models/composition.rb +2 -0
- data/lib/vedeu/models/escape_char.rb +2 -0
- data/lib/vedeu/models/focus.rb +1 -0
- data/lib/vedeu/models/group.rb +2 -0
- data/lib/vedeu/models/interface.rb +2 -0
- data/lib/vedeu/models/line.rb +2 -0
- data/lib/vedeu/models/menu.rb +2 -0
- data/lib/vedeu/models/panel.rb +2 -0
- data/lib/vedeu/models/stream.rb +2 -0
- data/lib/vedeu/null/all.rb +2 -0
- data/lib/vedeu/null/border.rb +2 -0
- data/lib/vedeu/null/buffer.rb +2 -0
- data/lib/vedeu/null/generic.rb +2 -0
- data/lib/vedeu/null/geometry.rb +2 -0
- data/lib/vedeu/null/interface.rb +2 -0
- data/lib/vedeu/output/background.rb +2 -0
- data/lib/vedeu/output/border.rb +2 -0
- data/lib/vedeu/output/clear.rb +2 -0
- data/lib/vedeu/output/colour.rb +1 -0
- data/lib/vedeu/output/compressor.rb +2 -0
- data/lib/vedeu/output/esc.rb +1 -0
- data/lib/vedeu/output/foreground.rb +2 -0
- data/lib/vedeu/output/html_char.rb +2 -0
- data/lib/vedeu/output/output.rb +2 -0
- data/lib/vedeu/output/presentation.rb +1 -0
- data/lib/vedeu/output/refresh.rb +1 -0
- data/lib/vedeu/output/renderers/all.rb +3 -0
- data/lib/vedeu/output/renderers/escape_sequence.rb +2 -0
- data/lib/vedeu/output/renderers/file.rb +2 -0
- data/lib/vedeu/output/renderers/html.rb +2 -0
- data/lib/vedeu/output/renderers/json.rb +2 -0
- data/lib/vedeu/output/renderers/null.rb +2 -0
- data/lib/vedeu/output/renderers/terminal.rb +2 -0
- data/lib/vedeu/output/renderers/text.rb +2 -0
- data/lib/vedeu/output/style.rb +1 -0
- data/lib/vedeu/output/text.rb +2 -0
- data/lib/vedeu/output/translator.rb +2 -0
- data/lib/vedeu/output/viewport.rb +2 -0
- data/lib/vedeu/output/virtual_terminal.rb +2 -0
- data/lib/vedeu/output/wordwrap.rb +2 -0
- data/lib/vedeu/repositories/collection.rb +2 -0
- data/lib/vedeu/repositories/collections/all.rb +12 -0
- data/lib/vedeu/repositories/model.rb +2 -0
- data/lib/vedeu/repositories/registerable.rb +2 -0
- data/lib/vedeu/repositories/repositories/background_colours.rb +2 -0
- data/lib/vedeu/repositories/repositories/borders.rb +2 -0
- data/lib/vedeu/repositories/repositories/buffers.rb +2 -0
- data/lib/vedeu/repositories/repositories/colours.rb +2 -0
- data/lib/vedeu/repositories/repositories/cursors.rb +2 -0
- data/lib/vedeu/repositories/repositories/events_repository.rb +2 -0
- data/lib/vedeu/repositories/repositories/foreground_colours.rb +2 -0
- data/lib/vedeu/repositories/repositories/geometries.rb +2 -0
- data/lib/vedeu/repositories/repositories/groups.rb +2 -0
- data/lib/vedeu/repositories/repositories/interfaces_repository.rb +2 -0
- data/lib/vedeu/repositories/repositories/keymaps.rb +2 -0
- data/lib/vedeu/repositories/repositories/menus.rb +2 -0
- data/lib/vedeu/repositories/repository.rb +3 -3
- data/lib/vedeu/storage/associative_store.rb +2 -0
- data/lib/vedeu/storage/conveyor_store.rb +2 -0
- data/lib/vedeu/storage/fifo_store.rb +2 -0
- data/lib/vedeu/storage/store.rb +1 -0
- data/lib/vedeu/support/common.rb +1 -0
- data/lib/vedeu/support/log.rb +3 -0
- data/lib/vedeu/support/options.rb +2 -0
- data/lib/vedeu/support/template.rb +2 -0
- data/lib/vedeu/support/terminal.rb +1 -0
- data/lib/vedeu/support/timer.rb +2 -1
- data/lib/vedeu/support/visibility.rb +2 -0
- data/lib/vedeu/templating/directive.rb +3 -0
- data/lib/vedeu/templating/helpers.rb +2 -0
- data/lib/vedeu/templating/preprocessor.rb +4 -0
- data/lib/vedeu/traps.rb +1 -0
- data/lib/vedeu/version.rb +2 -1
- data/test/lib/vedeu/dsl/border_test.rb +19 -0
- data/test/lib/vedeu/dsl/geometry_test.rb +19 -0
- data/test/lib/vedeu/dsl/interface_test.rb +19 -0
- metadata +2 -2
data/lib/vedeu/support/log.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
3
|
# Allows the creation of a lock-less log device.
|
4
|
+
#
|
5
|
+
# @api private
|
4
6
|
class MonoLogger < Logger
|
5
7
|
|
6
8
|
# Create a trappable Logger instance.
|
@@ -76,6 +78,7 @@ module Vedeu
|
|
76
78
|
|
77
79
|
# Provides the ability to log anything to the Vedeu log file.
|
78
80
|
#
|
81
|
+
# @api public
|
79
82
|
class Log
|
80
83
|
|
81
84
|
class << self
|
@@ -3,6 +3,8 @@ module Vedeu
|
|
3
3
|
# Converts an options Hash into a class containing methods for each of the
|
4
4
|
# keys, which when called returns the value associated. When the value is
|
5
5
|
# either true or false, an additional predicate method is created.
|
6
|
+
#
|
7
|
+
# @api private
|
6
8
|
class Options
|
7
9
|
|
8
10
|
# @!attribute [r] _defined
|
data/lib/vedeu/support/timer.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Vedeu
|
2
2
|
|
3
3
|
# Measure the duration. Used for debugging.
|
4
|
+
#
|
5
|
+
# @api public
|
4
6
|
class Timer
|
5
7
|
|
6
8
|
class << self
|
@@ -21,7 +23,6 @@ module Vedeu
|
|
21
23
|
@started = Time.now.to_f
|
22
24
|
end
|
23
25
|
|
24
|
-
# @param block [Proc]
|
25
26
|
# @return [void]
|
26
27
|
def measure
|
27
28
|
work = yield
|
@@ -3,6 +3,8 @@ module Vedeu
|
|
3
3
|
module Templating
|
4
4
|
|
5
5
|
# Converts a directive found in a template into a Vedeu::Stream object.
|
6
|
+
#
|
7
|
+
# @api private
|
6
8
|
class Directive
|
7
9
|
|
8
10
|
include Vedeu::Templating::Helpers
|
@@ -14,6 +16,7 @@ module Vedeu
|
|
14
16
|
end
|
15
17
|
|
16
18
|
# @param code [String]
|
19
|
+
# @return [Vedeu::Templating::Directive]
|
17
20
|
def initialize(code)
|
18
21
|
@code = code
|
19
22
|
end
|
@@ -14,14 +14,18 @@ module Vedeu
|
|
14
14
|
#
|
15
15
|
# Pre-processes a template, to convert all lines and lines with directives
|
16
16
|
# into Vedeu::Streams.
|
17
|
+
#
|
18
|
+
# @api private
|
17
19
|
class Preprocessor
|
18
20
|
|
19
21
|
# @param lines [Array<String>]
|
22
|
+
# @return [Array<Vedeu::Stream>]
|
20
23
|
def self.process(lines)
|
21
24
|
new(lines).process
|
22
25
|
end
|
23
26
|
|
24
27
|
# @param lines [Array<String>]
|
28
|
+
# @return [Vedeu::Templating::Preprocessor]
|
25
29
|
def initialize(lines)
|
26
30
|
@lines = lines
|
27
31
|
end
|
data/lib/vedeu/traps.rb
CHANGED
data/lib/vedeu/version.rb
CHANGED
@@ -201,6 +201,25 @@ module Vedeu
|
|
201
201
|
it { subject.must_equal('B') }
|
202
202
|
end
|
203
203
|
|
204
|
+
describe '#use' do
|
205
|
+
before do
|
206
|
+
Vedeu.border 'some_border' do
|
207
|
+
title 'Some border'
|
208
|
+
end
|
209
|
+
Vedeu.border 'other_border' do
|
210
|
+
title use('some_border').title
|
211
|
+
end
|
212
|
+
end
|
213
|
+
after { Vedeu.borders.reset }
|
214
|
+
|
215
|
+
subject { instance.use('other_border').title }
|
216
|
+
|
217
|
+
it 'allows the use of another models attributes' do
|
218
|
+
subject
|
219
|
+
Vedeu.borders.by_name('other_border').title.must_equal('Some border')
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
204
223
|
describe '#vertical' do
|
205
224
|
let(:char) { 'V' }
|
206
225
|
|
@@ -87,6 +87,25 @@ module Vedeu
|
|
87
87
|
it { subject.must_equal(6) }
|
88
88
|
end
|
89
89
|
|
90
|
+
describe '#use' do
|
91
|
+
before do
|
92
|
+
Vedeu.geometry 'some_geometry' do
|
93
|
+
x 5
|
94
|
+
end
|
95
|
+
Vedeu.geometry 'other_geometry' do
|
96
|
+
x use('some_geometry').x
|
97
|
+
end
|
98
|
+
end
|
99
|
+
after { Vedeu.geometries.reset }
|
100
|
+
|
101
|
+
subject { instance.use('other_geometry').x }
|
102
|
+
|
103
|
+
it 'allows the use of another models attributes' do
|
104
|
+
subject
|
105
|
+
Vedeu.geometries.by_name('other_geometry').x.must_equal(5)
|
106
|
+
end
|
107
|
+
end
|
108
|
+
|
90
109
|
describe '#width' do
|
91
110
|
subject { instance.width(25) }
|
92
111
|
|
@@ -303,6 +303,25 @@ module Vedeu
|
|
303
303
|
it { subject.visible.must_equal(false) }
|
304
304
|
end
|
305
305
|
|
306
|
+
describe '#use' do
|
307
|
+
before do
|
308
|
+
Vedeu.interface 'some_interface' do
|
309
|
+
delay 0.75
|
310
|
+
end
|
311
|
+
Vedeu.interface 'other_interface' do
|
312
|
+
delay use('some_interface').delay
|
313
|
+
end
|
314
|
+
end
|
315
|
+
after { Vedeu.interfaces.reset }
|
316
|
+
|
317
|
+
subject { instance.use('other_interface').delay }
|
318
|
+
|
319
|
+
it 'allows the use of another models attributes' do
|
320
|
+
subject
|
321
|
+
Vedeu.interfaces.by_name('other_interface').delay.must_equal(0.75)
|
322
|
+
end
|
323
|
+
end
|
324
|
+
|
306
325
|
describe '#visible' do
|
307
326
|
it { instance.visible(false).must_equal(false) }
|
308
327
|
it { instance.visible(true).must_equal(true) }
|
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.4.
|
4
|
+
version: 0.4.33
|
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-06-
|
11
|
+
date: 2015-06-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|