vedeu 0.4.17 → 0.4.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/docs/dsl.md +54 -0
- data/docs/views.md +25 -25
- data/examples/cursor_app.rb +1 -1
- data/examples/material_colours_app.rb +1 -1
- data/lib/vedeu/all.rb +1 -0
- data/lib/vedeu/bindings.rb +2 -15
- data/lib/vedeu/buffers/buffer.rb +30 -7
- data/lib/vedeu/buffers/display_buffer.rb +1 -1
- data/lib/vedeu/configuration/configuration.rb +1 -1
- data/lib/vedeu/cursor/refresh_cursor.rb +4 -0
- data/lib/vedeu/dsl/components/border.rb +6 -1
- data/lib/vedeu/geometry/all.rb +0 -1
- data/lib/vedeu/geometry/area.rb +0 -20
- data/lib/vedeu/geometry/coordinate.rb +0 -50
- data/lib/vedeu/geometry/geometry.rb +1 -5
- data/lib/vedeu/geometry/position.rb +9 -0
- data/lib/vedeu/geometry/position_index.rb +19 -14
- data/lib/vedeu/geometry/position_validator.rb +3 -0
- data/lib/vedeu/models/all.rb +0 -3
- data/lib/vedeu/models/interface.rb +2 -4
- data/lib/vedeu/null/all.rb +5 -0
- data/lib/vedeu/null/border.rb +79 -0
- data/lib/vedeu/null/buffer.rb +44 -0
- data/lib/vedeu/null/generic.rb +52 -0
- data/lib/vedeu/null/geometry.rb +70 -0
- data/lib/vedeu/null/interface.rb +23 -0
- data/lib/vedeu/output/all.rb +0 -1
- data/lib/vedeu/output/border.rb +9 -9
- data/lib/vedeu/output/clear.rb +2 -1
- data/lib/vedeu/output/output.rb +1 -1
- data/lib/vedeu/output/refresh.rb +1 -1
- data/lib/vedeu/output/renderers/all.rb +7 -7
- data/lib/vedeu/output/renderers/escape_sequence.rb +47 -0
- data/lib/vedeu/output/renderers/{file_renderer.rb → file.rb} +11 -6
- data/lib/vedeu/output/renderers/{html_renderer.rb → html.rb} +4 -4
- data/lib/vedeu/output/renderers/{json_renderer.rb → json.rb} +4 -4
- data/lib/vedeu/output/renderers/{null_renderer.rb → null.rb} +2 -2
- data/lib/vedeu/output/renderers/{terminal_renderer.rb → terminal.rb} +4 -4
- data/lib/vedeu/output/renderers/{text_renderer.rb → text.rb} +4 -4
- data/lib/vedeu/output/text.rb +2 -2
- data/lib/vedeu/output/virtual_terminal.rb +2 -2
- data/lib/vedeu/repositories/all.rb +2 -0
- data/lib/vedeu/repositories/repositories/borders.rb +4 -2
- data/lib/vedeu/repositories/repositories/buffers.rb +11 -9
- data/lib/vedeu/repositories/repositories/cursors.rb +2 -0
- data/lib/vedeu/repositories/repositories/events_repository.rb +2 -0
- data/lib/vedeu/repositories/repositories/geometries.rb +4 -2
- data/lib/vedeu/repositories/repositories/groups.rb +2 -0
- data/lib/vedeu/repositories/repositories/interfaces_repository.rb +4 -2
- data/lib/vedeu/repositories/repositories/keymaps.rb +2 -0
- data/lib/vedeu/repositories/repositories/menus.rb +2 -0
- data/test/lib/vedeu/cursor/cursor_test.rb +1 -1
- data/test/lib/vedeu/cursor/move_test.rb +21 -33
- data/test/lib/vedeu/cursor/refresh_cursor_test.rb +16 -1
- data/test/lib/vedeu/distributed/test_application_test.rb +1 -1
- data/test/lib/vedeu/dsl/components/border_test.rb +1 -1
- data/test/lib/vedeu/dsl/components/geometry_test.rb +5 -5
- data/test/lib/vedeu/dsl/components/menu_test.rb +1 -1
- data/test/lib/vedeu/dsl/composition_test.rb +1 -1
- data/test/lib/vedeu/dsl/group_test.rb +1 -1
- data/test/lib/vedeu/dsl/interface_test.rb +1 -1
- data/test/lib/vedeu/dsl/stream_test.rb +1 -1
- data/test/lib/vedeu/events/event_test.rb +8 -8
- data/test/lib/vedeu/events/trigger_test.rb +1 -1
- data/test/lib/vedeu/geometry/area_test.rb +4 -36
- data/test/lib/vedeu/geometry/canvas_test.rb +2 -2
- data/test/lib/vedeu/geometry/coordinate_test.rb +0 -56
- data/test/lib/vedeu/geometry/dimension_test.rb +1 -1
- data/test/lib/vedeu/geometry/geometry_test.rb +1 -1
- data/test/lib/vedeu/geometry/grid_test.rb +1 -1
- data/test/lib/vedeu/geometry/position_index_test.rb +21 -23
- data/test/lib/vedeu/geometry/position_validator_test.rb +121 -3
- data/test/lib/vedeu/input/input_test.rb +1 -1
- data/test/lib/vedeu/input/key_test.rb +1 -1
- data/test/lib/vedeu/input/keymap_test.rb +1 -1
- data/test/lib/vedeu/models/interface_test.rb +14 -0
- data/test/lib/vedeu/null/border_test.rb +76 -0
- data/test/lib/vedeu/null/generic_test.rb +69 -0
- data/test/lib/vedeu/null/geometry_test.rb +63 -0
- data/test/lib/vedeu/null/interface_test.rb +13 -0
- data/test/lib/vedeu/output/clear_test.rb +1 -1
- data/test/lib/vedeu/output/compressor_test.rb +1 -1
- data/test/lib/vedeu/output/html_char_test.rb +1 -1
- data/test/lib/vedeu/output/output_test.rb +1 -1
- data/test/lib/vedeu/output/refresh_test.rb +17 -5
- data/test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb +4 -4
- data/test/lib/vedeu/output/renderers/{file_renderer_test.rb → file_test.rb} +4 -4
- data/test/lib/vedeu/output/renderers/{html_renderer_test.rb → html_test.rb} +4 -4
- data/test/lib/vedeu/output/renderers/{json_renderer_test.rb → json_test.rb} +4 -4
- data/test/lib/vedeu/output/renderers/{null_renderer_test.rb → null_test.rb} +3 -3
- data/test/lib/vedeu/output/renderers/{terminal_renderer_test.rb → terminal_test.rb} +4 -4
- data/test/lib/vedeu/output/renderers/{text_renderer_test.rb → text_test.rb} +4 -4
- data/test/lib/vedeu/output/style_test.rb +1 -1
- data/test/lib/vedeu/output/translator_test.rb +1 -1
- data/test/lib/vedeu/output/viewport_test.rb +1 -1
- data/test/lib/vedeu/output/virtual_terminal_test.rb +3 -3
- data/test/lib/vedeu/repositories/collection_test.rb +2 -2
- data/test/lib/vedeu/repositories/collections/chars_test.rb +1 -1
- data/test/lib/vedeu/repositories/collections/events_test.rb +1 -1
- data/test/lib/vedeu/repositories/collections/interfaces_test.rb +1 -1
- data/test/lib/vedeu/repositories/collections/keys_test.rb +1 -1
- data/test/lib/vedeu/repositories/collections/lines_test.rb +1 -1
- data/test/lib/vedeu/repositories/collections/streams_test.rb +1 -1
- data/test/lib/vedeu/repositories/repositories/borders_test.rb +1 -1
- data/test/lib/vedeu/repositories/repositories/buffers_test.rb +11 -23
- data/test/lib/vedeu/repositories/repositories/colours_test.rb +1 -1
- data/test/lib/vedeu/repositories/repositories/geometries_test.rb +1 -1
- data/test/lib/vedeu/repositories/repository_test.rb +1 -1
- data/test/lib/vedeu/storage/associative_store_test.rb +1 -1
- data/test/lib/vedeu/storage/conveyor_store_test.rb +1 -1
- data/test/lib/vedeu/storage/fifo_store_test.rb +1 -1
- data/test/lib/vedeu/support/template_test.rb +1 -1
- data/test/lib/vedeu/support/trace_test.rb +1 -1
- data/test/lib/vedeu/support/visibility_test.rb +2 -2
- data/test/test_helper.rb +1 -1
- data/vedeu.gemspec +1 -1
- metadata +36 -33
- data/lib/vedeu/geometry/null_geometry.rb +0 -70
- data/lib/vedeu/models/null.rb +0 -48
- data/lib/vedeu/models/null_interface.rb +0 -20
- data/lib/vedeu/output/null_border.rb +0 -75
- data/lib/vedeu/output/renderers/escape_sequence_renderer.rb +0 -43
- data/test/lib/vedeu/geometry/null_geometry_test.rb +0 -59
- data/test/lib/vedeu/models/null_interface_test.rb +0 -9
- data/test/lib/vedeu/models/null_test.rb +0 -66
- data/test/lib/vedeu/output/null_border_test.rb +0 -72
@@ -10,10 +10,10 @@ module Vedeu
|
|
10
10
|
let(:instance) { described.new(height, width, renderer) }
|
11
11
|
let(:height) { 3 }
|
12
12
|
let(:width) { 3 }
|
13
|
-
let(:renderer) { Vedeu::
|
13
|
+
let(:renderer) { Vedeu::Renderers::HTML }
|
14
14
|
|
15
15
|
describe '#initialize' do
|
16
|
-
it { instance.must_be_instance_of(
|
16
|
+
it { instance.must_be_instance_of(described) }
|
17
17
|
it { instance.instance_variable_get('@height').must_equal(3) }
|
18
18
|
it { instance.instance_variable_get('@width').must_equal(3) }
|
19
19
|
it { instance.instance_variable_get('@renderer').must_equal(renderer) }
|
@@ -23,7 +23,7 @@ module Vedeu
|
|
23
23
|
context '#renderer' do
|
24
24
|
subject { instance.renderer }
|
25
25
|
|
26
|
-
it { subject.must_equal(Vedeu::
|
26
|
+
it { subject.must_equal(Vedeu::Renderers::HTML) }
|
27
27
|
end
|
28
28
|
context '#renderer=' do
|
29
29
|
subject { instance.renderer = (Vedeu::FakeRenderer) }
|
@@ -4,14 +4,14 @@ module Vedeu
|
|
4
4
|
|
5
5
|
describe Collection do
|
6
6
|
|
7
|
-
let(:described) { Collection }
|
7
|
+
let(:described) { Vedeu::Collection }
|
8
8
|
let(:instance) { described.new(collection, parent, model_name) }
|
9
9
|
let(:collection) { [] }
|
10
10
|
let(:model_name) { 'elements' }
|
11
11
|
let(:parent) { Vedeu::ModelTestClass.new }
|
12
12
|
|
13
13
|
describe '#initialize' do
|
14
|
-
it { instance.must_be_instance_of(
|
14
|
+
it { instance.must_be_instance_of(described) }
|
15
15
|
it { instance.instance_variable_get('@collection').must_equal([]) }
|
16
16
|
it { instance.instance_variable_get('@name').must_equal(model_name) }
|
17
17
|
it { instance.instance_variable_get('@parent').must_equal(parent) }
|
@@ -13,37 +13,25 @@ module Vedeu
|
|
13
13
|
it { subject.must_be_instance_of(described) }
|
14
14
|
end
|
15
15
|
|
16
|
-
describe '#
|
17
|
-
let(:_name)
|
18
|
-
let(:buffer) { Vedeu::Buffer.new }
|
16
|
+
describe '#by_name' do
|
17
|
+
let(:_name) { 'carbon' }
|
19
18
|
|
20
|
-
subject {
|
19
|
+
subject { described.buffers.by_name(_name) }
|
21
20
|
|
22
21
|
context 'when the buffer exists' do
|
23
|
-
before
|
22
|
+
before do
|
23
|
+
Vedeu.interface 'carbon' do
|
24
|
+
end
|
25
|
+
end
|
26
|
+
after { Vedeu.buffers.reset }
|
24
27
|
|
25
|
-
it {
|
28
|
+
it { subject.must_be_instance_of(Vedeu::Buffer) }
|
26
29
|
end
|
27
30
|
|
28
31
|
context 'when the buffer does not exist' do
|
29
|
-
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
describe '#render' do
|
34
|
-
let(:_name) { 'silicon' }
|
35
|
-
let(:buffer) { Vedeu::Buffer.new }
|
32
|
+
let(:_name) { 'nitrogen' }
|
36
33
|
|
37
|
-
|
38
|
-
|
39
|
-
context 'when the buffer exists' do
|
40
|
-
before { instance.stubs(:find!).returns(buffer) }
|
41
|
-
|
42
|
-
it { buffer.expects(:render); subject }
|
43
|
-
end
|
44
|
-
|
45
|
-
context 'when the buffer does not exist' do
|
46
|
-
it { proc { subject }.must_raise(ModelNotFound) }
|
34
|
+
it { subject.must_be_instance_of(Vedeu::Null::Buffer) }
|
47
35
|
end
|
48
36
|
end
|
49
37
|
|
@@ -55,7 +55,7 @@ module Vedeu
|
|
55
55
|
end
|
56
56
|
|
57
57
|
describe '#initialize' do
|
58
|
-
it { instance.must_be_instance_of(
|
58
|
+
it { instance.must_be_instance_of(described) }
|
59
59
|
it { instance.instance_variable_get('@model').must_equal(model) }
|
60
60
|
it { instance.instance_variable_get('@storage').must_equal(storage) }
|
61
61
|
end
|
@@ -9,7 +9,7 @@ module Vedeu
|
|
9
9
|
let(:storage) { {} }
|
10
10
|
|
11
11
|
describe '#initialize' do
|
12
|
-
it { instance.must_be_instance_of(
|
12
|
+
it { instance.must_be_instance_of(described) }
|
13
13
|
it { instance.instance_variable_get('@storage').must_equal(storage) }
|
14
14
|
end
|
15
15
|
|
@@ -10,7 +10,7 @@ module Vedeu
|
|
10
10
|
let(:path) {}
|
11
11
|
|
12
12
|
describe '#initialize' do
|
13
|
-
it { instance.must_be_instance_of(
|
13
|
+
it { instance.must_be_instance_of(described) }
|
14
14
|
it { instance.instance_variable_get('@object').must_equal(object) }
|
15
15
|
it { instance.instance_variable_get('@path').must_equal('') }
|
16
16
|
end
|
@@ -23,7 +23,7 @@ module Vedeu
|
|
23
23
|
let(:visible) { true }
|
24
24
|
|
25
25
|
describe '#initialize' do
|
26
|
-
it { instance.must_be_instance_of(
|
26
|
+
it { instance.must_be_instance_of(described) }
|
27
27
|
it { instance.instance_variable_get('@model').must_equal(model) }
|
28
28
|
end
|
29
29
|
|
@@ -32,7 +32,7 @@ module Vedeu
|
|
32
32
|
|
33
33
|
subject { described.for_cursor(_name) }
|
34
34
|
|
35
|
-
it { subject.must_be_instance_of(
|
35
|
+
it { subject.must_be_instance_of(described) }
|
36
36
|
end
|
37
37
|
|
38
38
|
describe '.show' do
|
data/test/test_helper.rb
CHANGED
@@ -41,7 +41,7 @@ require 'support/helpers/model_test_class'
|
|
41
41
|
# require 'minitest/reporters'
|
42
42
|
# Minitest::Reporters.use!(
|
43
43
|
# # commented out by default (makes tests slower)
|
44
|
-
# # Minitest::Reporters::DefaultReporter.new({ color: true, slow_count:
|
44
|
+
# # Minitest::Reporters::DefaultReporter.new({ color: true, slow_count: 15 }),
|
45
45
|
# # Minitest::Reporters::SpecReporter.new
|
46
46
|
# )
|
47
47
|
|
data/vedeu.gemspec
CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |spec|
|
6
6
|
spec.name = 'vedeu'
|
7
|
-
spec.version = '0.4.
|
7
|
+
spec.version = '0.4.18'
|
8
8
|
spec.authors = ['Gavin Laking']
|
9
9
|
spec.email = ['gavinlaking@gmail.com']
|
10
10
|
spec.summary = 'A terminal case of wonderland.'
|
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.18
|
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-04-
|
11
|
+
date: 2015-04-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
@@ -292,6 +292,7 @@ files:
|
|
292
292
|
- config/rubocop_disabled.yml
|
293
293
|
- config/rubocop_enabled.yml
|
294
294
|
- docs/api.md
|
295
|
+
- docs/dsl.md
|
295
296
|
- docs/getting_started.md
|
296
297
|
- docs/object_graph.md
|
297
298
|
- docs/views.md
|
@@ -374,7 +375,6 @@ files:
|
|
374
375
|
- lib/vedeu/geometry/geometry.rb
|
375
376
|
- lib/vedeu/geometry/grid.rb
|
376
377
|
- lib/vedeu/geometry/index_position.rb
|
377
|
-
- lib/vedeu/geometry/null_geometry.rb
|
378
378
|
- lib/vedeu/geometry/position.rb
|
379
379
|
- lib/vedeu/geometry/position_index.rb
|
380
380
|
- lib/vedeu/geometry/position_validator.rb
|
@@ -394,9 +394,13 @@ files:
|
|
394
394
|
- lib/vedeu/models/interface.rb
|
395
395
|
- lib/vedeu/models/line.rb
|
396
396
|
- lib/vedeu/models/menu.rb
|
397
|
-
- lib/vedeu/models/null.rb
|
398
|
-
- lib/vedeu/models/null_interface.rb
|
399
397
|
- lib/vedeu/models/stream.rb
|
398
|
+
- lib/vedeu/null/all.rb
|
399
|
+
- lib/vedeu/null/border.rb
|
400
|
+
- lib/vedeu/null/buffer.rb
|
401
|
+
- lib/vedeu/null/generic.rb
|
402
|
+
- lib/vedeu/null/geometry.rb
|
403
|
+
- lib/vedeu/null/interface.rb
|
400
404
|
- lib/vedeu/output/all.rb
|
401
405
|
- lib/vedeu/output/background.rb
|
402
406
|
- lib/vedeu/output/border.rb
|
@@ -406,18 +410,17 @@ files:
|
|
406
410
|
- lib/vedeu/output/esc.rb
|
407
411
|
- lib/vedeu/output/foreground.rb
|
408
412
|
- lib/vedeu/output/html_char.rb
|
409
|
-
- lib/vedeu/output/null_border.rb
|
410
413
|
- lib/vedeu/output/output.rb
|
411
414
|
- lib/vedeu/output/presentation.rb
|
412
415
|
- lib/vedeu/output/refresh.rb
|
413
416
|
- lib/vedeu/output/renderers/all.rb
|
414
|
-
- lib/vedeu/output/renderers/
|
415
|
-
- lib/vedeu/output/renderers/
|
416
|
-
- lib/vedeu/output/renderers/
|
417
|
-
- lib/vedeu/output/renderers/
|
418
|
-
- lib/vedeu/output/renderers/
|
419
|
-
- lib/vedeu/output/renderers/
|
420
|
-
- lib/vedeu/output/renderers/
|
417
|
+
- lib/vedeu/output/renderers/escape_sequence.rb
|
418
|
+
- lib/vedeu/output/renderers/file.rb
|
419
|
+
- lib/vedeu/output/renderers/html.rb
|
420
|
+
- lib/vedeu/output/renderers/json.rb
|
421
|
+
- lib/vedeu/output/renderers/null.rb
|
422
|
+
- lib/vedeu/output/renderers/terminal.rb
|
423
|
+
- lib/vedeu/output/renderers/text.rb
|
421
424
|
- lib/vedeu/output/style.rb
|
422
425
|
- lib/vedeu/output/templates/html_renderer.vedeu
|
423
426
|
- lib/vedeu/output/text.rb
|
@@ -503,7 +506,6 @@ files:
|
|
503
506
|
- test/lib/vedeu/geometry/geometry_test.rb
|
504
507
|
- test/lib/vedeu/geometry/grid_test.rb
|
505
508
|
- test/lib/vedeu/geometry/index_position_test.rb
|
506
|
-
- test/lib/vedeu/geometry/null_geometry_test.rb
|
507
509
|
- test/lib/vedeu/geometry/position_index_test.rb
|
508
510
|
- test/lib/vedeu/geometry/position_test.rb
|
509
511
|
- test/lib/vedeu/geometry/position_validator_test.rb
|
@@ -521,9 +523,11 @@ files:
|
|
521
523
|
- test/lib/vedeu/models/interface_test.rb
|
522
524
|
- test/lib/vedeu/models/line_test.rb
|
523
525
|
- test/lib/vedeu/models/menu_test.rb
|
524
|
-
- test/lib/vedeu/models/null_interface_test.rb
|
525
|
-
- test/lib/vedeu/models/null_test.rb
|
526
526
|
- test/lib/vedeu/models/stream_test.rb
|
527
|
+
- test/lib/vedeu/null/border_test.rb
|
528
|
+
- test/lib/vedeu/null/generic_test.rb
|
529
|
+
- test/lib/vedeu/null/geometry_test.rb
|
530
|
+
- test/lib/vedeu/null/interface_test.rb
|
527
531
|
- test/lib/vedeu/output/background_test.rb
|
528
532
|
- test/lib/vedeu/output/border_test.rb
|
529
533
|
- test/lib/vedeu/output/clear_test.rb
|
@@ -532,18 +536,17 @@ files:
|
|
532
536
|
- test/lib/vedeu/output/esc_test.rb
|
533
537
|
- test/lib/vedeu/output/foreground_test.rb
|
534
538
|
- test/lib/vedeu/output/html_char_test.rb
|
535
|
-
- test/lib/vedeu/output/null_border_test.rb
|
536
539
|
- test/lib/vedeu/output/output_test.rb
|
537
540
|
- test/lib/vedeu/output/presentation_test.rb
|
538
541
|
- test/lib/vedeu/output/refresh_test.rb
|
539
542
|
- test/lib/vedeu/output/renderers/all_test.rb
|
540
543
|
- test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb
|
541
|
-
- test/lib/vedeu/output/renderers/
|
542
|
-
- test/lib/vedeu/output/renderers/
|
543
|
-
- test/lib/vedeu/output/renderers/
|
544
|
-
- test/lib/vedeu/output/renderers/
|
545
|
-
- test/lib/vedeu/output/renderers/
|
546
|
-
- test/lib/vedeu/output/renderers/
|
544
|
+
- test/lib/vedeu/output/renderers/file_test.rb
|
545
|
+
- test/lib/vedeu/output/renderers/html_test.rb
|
546
|
+
- test/lib/vedeu/output/renderers/json_test.rb
|
547
|
+
- test/lib/vedeu/output/renderers/null_test.rb
|
548
|
+
- test/lib/vedeu/output/renderers/terminal_test.rb
|
549
|
+
- test/lib/vedeu/output/renderers/text_test.rb
|
547
550
|
- test/lib/vedeu/output/style_test.rb
|
548
551
|
- test/lib/vedeu/output/text_test.rb
|
549
552
|
- test/lib/vedeu/output/translator_test.rb
|
@@ -656,7 +659,6 @@ test_files:
|
|
656
659
|
- test/lib/vedeu/geometry/geometry_test.rb
|
657
660
|
- test/lib/vedeu/geometry/grid_test.rb
|
658
661
|
- test/lib/vedeu/geometry/index_position_test.rb
|
659
|
-
- test/lib/vedeu/geometry/null_geometry_test.rb
|
660
662
|
- test/lib/vedeu/geometry/position_index_test.rb
|
661
663
|
- test/lib/vedeu/geometry/position_test.rb
|
662
664
|
- test/lib/vedeu/geometry/position_validator_test.rb
|
@@ -674,9 +676,11 @@ test_files:
|
|
674
676
|
- test/lib/vedeu/models/interface_test.rb
|
675
677
|
- test/lib/vedeu/models/line_test.rb
|
676
678
|
- test/lib/vedeu/models/menu_test.rb
|
677
|
-
- test/lib/vedeu/models/null_interface_test.rb
|
678
|
-
- test/lib/vedeu/models/null_test.rb
|
679
679
|
- test/lib/vedeu/models/stream_test.rb
|
680
|
+
- test/lib/vedeu/null/border_test.rb
|
681
|
+
- test/lib/vedeu/null/generic_test.rb
|
682
|
+
- test/lib/vedeu/null/geometry_test.rb
|
683
|
+
- test/lib/vedeu/null/interface_test.rb
|
680
684
|
- test/lib/vedeu/output/background_test.rb
|
681
685
|
- test/lib/vedeu/output/border_test.rb
|
682
686
|
- test/lib/vedeu/output/clear_test.rb
|
@@ -685,18 +689,17 @@ test_files:
|
|
685
689
|
- test/lib/vedeu/output/esc_test.rb
|
686
690
|
- test/lib/vedeu/output/foreground_test.rb
|
687
691
|
- test/lib/vedeu/output/html_char_test.rb
|
688
|
-
- test/lib/vedeu/output/null_border_test.rb
|
689
692
|
- test/lib/vedeu/output/output_test.rb
|
690
693
|
- test/lib/vedeu/output/presentation_test.rb
|
691
694
|
- test/lib/vedeu/output/refresh_test.rb
|
692
695
|
- test/lib/vedeu/output/renderers/all_test.rb
|
693
696
|
- test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb
|
694
|
-
- test/lib/vedeu/output/renderers/
|
695
|
-
- test/lib/vedeu/output/renderers/
|
696
|
-
- test/lib/vedeu/output/renderers/
|
697
|
-
- test/lib/vedeu/output/renderers/
|
698
|
-
- test/lib/vedeu/output/renderers/
|
699
|
-
- test/lib/vedeu/output/renderers/
|
697
|
+
- test/lib/vedeu/output/renderers/file_test.rb
|
698
|
+
- test/lib/vedeu/output/renderers/html_test.rb
|
699
|
+
- test/lib/vedeu/output/renderers/json_test.rb
|
700
|
+
- test/lib/vedeu/output/renderers/null_test.rb
|
701
|
+
- test/lib/vedeu/output/renderers/terminal_test.rb
|
702
|
+
- test/lib/vedeu/output/renderers/text_test.rb
|
700
703
|
- test/lib/vedeu/output/style_test.rb
|
701
704
|
- test/lib/vedeu/output/text_test.rb
|
702
705
|
- test/lib/vedeu/output/translator_test.rb
|
@@ -1,70 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
# Provides geometry for interfaces that do not have geometry defined.
|
4
|
-
#
|
5
|
-
class NullGeometry
|
6
|
-
|
7
|
-
extend Forwardable
|
8
|
-
|
9
|
-
def_delegators :area,
|
10
|
-
:north,
|
11
|
-
:east,
|
12
|
-
:south,
|
13
|
-
:west,
|
14
|
-
:top,
|
15
|
-
:right,
|
16
|
-
:bottom,
|
17
|
-
:left,
|
18
|
-
:y,
|
19
|
-
:xn,
|
20
|
-
:yn,
|
21
|
-
:x,
|
22
|
-
:height,
|
23
|
-
:width,
|
24
|
-
:top_left,
|
25
|
-
:top_right,
|
26
|
-
:bottom_left,
|
27
|
-
:bottom_right
|
28
|
-
|
29
|
-
# @!attribute [r] name
|
30
|
-
# @return [String|NilClass]
|
31
|
-
attr_reader :name
|
32
|
-
|
33
|
-
# Returns a new instance of Vedeu::NullGeometry.
|
34
|
-
#
|
35
|
-
# @param name [String|NilClass]
|
36
|
-
# @return [Vedeu::NullGeometry]
|
37
|
-
def initialize(name = nil)
|
38
|
-
@name = name
|
39
|
-
end
|
40
|
-
|
41
|
-
# @return [FalseClass]
|
42
|
-
def centred
|
43
|
-
false
|
44
|
-
end
|
45
|
-
|
46
|
-
# @return [Vedeu::NullGeometry]
|
47
|
-
def store
|
48
|
-
self
|
49
|
-
end
|
50
|
-
|
51
|
-
private
|
52
|
-
|
53
|
-
# @return [Vedeu::Area]
|
54
|
-
def area
|
55
|
-
@area ||= Vedeu::Area.from_dimensions(y_yn: y_yn, x_xn: x_xn)
|
56
|
-
end
|
57
|
-
|
58
|
-
# @return [Array<Fixnum>]
|
59
|
-
def x_xn
|
60
|
-
@x_xn ||= Vedeu::Dimension.pair(default: Vedeu::Terminal.width)
|
61
|
-
end
|
62
|
-
|
63
|
-
# @return [Array<Fixnum>]
|
64
|
-
def y_yn
|
65
|
-
@y_yn ||= Vedeu::Dimension.pair(default: Vedeu::Terminal.height)
|
66
|
-
end
|
67
|
-
|
68
|
-
end # NullGeometry
|
69
|
-
|
70
|
-
end # Vedeu
|
data/lib/vedeu/models/null.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
# Represents a empty model.
|
4
|
-
#
|
5
|
-
class Null
|
6
|
-
|
7
|
-
# @return [Vedeu::Null]
|
8
|
-
def initialize; end
|
9
|
-
|
10
|
-
# @return [NilClass]
|
11
|
-
def add(*)
|
12
|
-
nil
|
13
|
-
end
|
14
|
-
|
15
|
-
# @return [NilClass]
|
16
|
-
def colour
|
17
|
-
nil
|
18
|
-
end
|
19
|
-
|
20
|
-
# @return [NilClass]
|
21
|
-
def parent
|
22
|
-
nil
|
23
|
-
end
|
24
|
-
|
25
|
-
# @return [Vedeu::Null]
|
26
|
-
def store
|
27
|
-
self
|
28
|
-
end
|
29
|
-
|
30
|
-
# @return [NilClass]
|
31
|
-
def style
|
32
|
-
nil
|
33
|
-
end
|
34
|
-
|
35
|
-
# @return [FalseClass]
|
36
|
-
def visible?
|
37
|
-
false
|
38
|
-
end
|
39
|
-
alias_method :visible, :visible?
|
40
|
-
|
41
|
-
# @return [FalseClass]
|
42
|
-
def visible=(*)
|
43
|
-
false
|
44
|
-
end
|
45
|
-
|
46
|
-
end # Null
|
47
|
-
|
48
|
-
end # Vedeu
|
@@ -1,20 +0,0 @@
|
|
1
|
-
module Vedeu
|
2
|
-
|
3
|
-
# Provides a non-existent Vedeu::Interface that acts like the real thing, but
|
4
|
-
# does nothing.
|
5
|
-
#
|
6
|
-
class NullInterface
|
7
|
-
|
8
|
-
# @!attribute [r] attributes
|
9
|
-
# @return [Hash]
|
10
|
-
attr_reader :attributes
|
11
|
-
|
12
|
-
# @param attributes [Hash]
|
13
|
-
# @return [Vedeu::NullInterface]
|
14
|
-
def initialize(attributes = {})
|
15
|
-
@attributes = attributes
|
16
|
-
end
|
17
|
-
|
18
|
-
end # NullInterface
|
19
|
-
|
20
|
-
end # Vedeu
|