vedeu 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu.rb +1 -1
- data/lib/vedeu/all.rb +2 -0
- data/lib/vedeu/buffers/buffer.rb +0 -11
- data/lib/vedeu/configuration/api.rb +4 -6
- data/lib/vedeu/configuration/cli.rb +1 -3
- data/lib/vedeu/configuration/configuration.rb +15 -0
- data/lib/vedeu/cursor/cursor.rb +2 -9
- data/lib/vedeu/cursor/move_cursor.rb +7 -9
- data/lib/vedeu/cursor/toggle_cursor.rb +2 -2
- data/lib/vedeu/debug.rb +3 -0
- data/lib/vedeu/distributed/test_application.rb +4 -8
- data/lib/vedeu/dsl/components/keymap.rb +1 -3
- data/lib/vedeu/dsl/composition.rb +2 -2
- data/lib/vedeu/dsl/interface.rb +2 -2
- data/lib/vedeu/dsl/shared/text.rb +2 -2
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/geometry/all.rb +10 -0
- data/lib/vedeu/{support → geometry}/bounding_area.rb +1 -0
- data/lib/vedeu/{support → geometry}/content_geometry.rb +0 -7
- data/lib/vedeu/{support → geometry}/coordinate.rb +0 -14
- data/lib/vedeu/{support → geometry}/grid.rb +0 -0
- data/lib/vedeu/{support → geometry}/limit.rb +0 -0
- data/lib/vedeu/{support → geometry}/position.rb +3 -5
- data/lib/vedeu/{support → geometry}/position_validator.rb +2 -0
- data/lib/vedeu/input/input.rb +1 -1
- data/lib/vedeu/input/key.rb +0 -13
- data/lib/vedeu/input/keymap.rb +1 -1
- data/lib/vedeu/models/focus.rb +2 -2
- data/lib/vedeu/models/geometry.rb +4 -51
- data/lib/vedeu/models/menu.rb +1 -1
- data/lib/vedeu/models/model.rb +1 -1
- data/lib/vedeu/models/view/char.rb +2 -9
- data/lib/vedeu/models/view/composition.rb +3 -10
- data/lib/vedeu/models/view/interface.rb +5 -13
- data/lib/vedeu/models/view/line.rb +3 -10
- data/lib/vedeu/models/view/stream.rb +18 -11
- data/lib/vedeu/output/background.rb +6 -21
- data/lib/vedeu/output/border.rb +26 -17
- data/lib/vedeu/output/colour.rb +1 -1
- data/lib/vedeu/output/foreground.rb +6 -21
- data/lib/vedeu/output/html_renderer.rb +3 -9
- data/lib/vedeu/output/output.rb +38 -11
- data/lib/vedeu/output/style.rb +1 -1
- data/lib/vedeu/output/translator.rb +45 -15
- data/lib/vedeu/output/viewport.rb +1 -1
- data/lib/vedeu/output/virtual_buffer.rb +2 -2
- data/lib/vedeu/output/wordwrap.rb +1 -1
- data/lib/vedeu/repositories/all.rb +9 -9
- data/lib/vedeu/repositories/repository.rb +0 -7
- data/lib/vedeu/support/all.rb +1 -7
- data/lib/vedeu/support/esc.rb +33 -11
- data/lib/vedeu/support/template.rb +39 -0
- data/lib/vedeu/support/terminal.rb +3 -3
- data/lib/vedeu/support/text.rb +1 -1
- data/lib/vedeu/support/trace.rb +4 -4
- data/lib/vedeu/support/visible.rb +2 -7
- data/test/lib/vedeu/buffers/buffer_test.rb +0 -6
- data/test/lib/vedeu/cursor/cursor_test.rb +0 -6
- data/test/lib/vedeu/{support → geometry}/bounding_area_test.rb +0 -0
- data/test/lib/vedeu/{support → geometry}/content_geometry_test.rb +0 -6
- data/test/lib/vedeu/{support → geometry}/coordinate_test.rb +0 -8
- data/test/lib/vedeu/{support → geometry}/grid_test.rb +0 -0
- data/test/lib/vedeu/{support → geometry}/limit_test.rb +0 -0
- data/test/lib/vedeu/{support → geometry}/position_test.rb +8 -6
- data/test/lib/vedeu/{support → geometry}/position_validator_test.rb +0 -0
- data/test/lib/vedeu/input/key_test.rb +0 -12
- data/test/lib/vedeu/models/geometry_test.rb +0 -47
- data/test/lib/vedeu/models/view/char_test.rb +5 -9
- data/test/lib/vedeu/models/view/composition_test.rb +2 -8
- data/test/lib/vedeu/models/view/interface_test.rb +2 -8
- data/test/lib/vedeu/models/view/line_test.rb +0 -6
- data/test/lib/vedeu/models/view/stream_test.rb +0 -6
- data/test/lib/vedeu/output/border_test.rb +2 -2
- data/test/lib/vedeu/output/html_renderer_test.rb +0 -1
- data/test/lib/vedeu/output/output_test.rb +39 -0
- data/test/lib/vedeu/repositories/repository_test.rb +0 -6
- data/test/lib/vedeu/support/template_test.rb +24 -0
- data/test/lib/vedeu/support/visible_test.rb +0 -6
- data/test/support/helpers/model_test_class.rb +1 -1
- data/vedeu.gemspec +1 -1
- metadata +27 -23
@@ -45,6 +45,45 @@ module Vedeu
|
|
45
45
|
end
|
46
46
|
end
|
47
47
|
|
48
|
+
# describe '#origin' do
|
49
|
+
# it 'returns the origin for the interface' do
|
50
|
+
# geometry = Geometry.new({ width: 5, height: 5 })
|
51
|
+
# geometry.origin.must_be_instance_of(Vedeu::Position)
|
52
|
+
# geometry.origin.y.must_equal(1)
|
53
|
+
# geometry.origin.x.must_equal(1)
|
54
|
+
# end
|
55
|
+
|
56
|
+
# it 'returns the origin for the interface' do
|
57
|
+
# geometry = Geometry.new({ width: 5, height: 5, centred: true })
|
58
|
+
# geometry.origin.must_be_instance_of(Vedeu::Position)
|
59
|
+
# geometry.origin.y.must_equal(10)
|
60
|
+
# geometry.origin.x.must_equal(38)
|
61
|
+
# end
|
62
|
+
|
63
|
+
# it 'returns the line position relative to the origin' do
|
64
|
+
# geometry = Geometry.new({ width: 5, height: 5 })
|
65
|
+
# geometry.origin(3).must_be_instance_of(Vedeu::Position)
|
66
|
+
# geometry.origin(3).y.must_equal(4)
|
67
|
+
# geometry.origin(3).x.must_equal(1)
|
68
|
+
# end
|
69
|
+
|
70
|
+
# it 'returns the origin for the interface when the interface' \
|
71
|
+
# ' is at a custom position' do
|
72
|
+
# geometry = Geometry.new({ width: 5, height: 5, x: 3, y: 6 })
|
73
|
+
# geometry.origin.must_be_instance_of(Vedeu::Position)
|
74
|
+
# geometry.origin.y.must_equal(6)
|
75
|
+
# geometry.origin.x.must_equal(3)
|
76
|
+
# end
|
77
|
+
|
78
|
+
# it 'returns the line position relative to the origin when the' \
|
79
|
+
# ' interface is at a custom position' do
|
80
|
+
# geometry = Geometry.new({ width: 5, height: 5, x: 3, y: 6 })
|
81
|
+
# geometry.origin(3).must_be_instance_of(Vedeu::Position)
|
82
|
+
# geometry.origin(3).y.must_equal(9)
|
83
|
+
# geometry.origin(3).x.must_equal(3)
|
84
|
+
# end
|
85
|
+
# end
|
86
|
+
|
48
87
|
end # Output
|
49
88
|
|
50
89
|
end # Vedeu
|
@@ -31,12 +31,6 @@ module Vedeu
|
|
31
31
|
it { instance.instance_variable_get('@storage').must_equal(storage) }
|
32
32
|
end
|
33
33
|
|
34
|
-
describe '#inspect' do
|
35
|
-
subject { instance.inspect }
|
36
|
-
|
37
|
-
it { subject.must_equal('<Vedeu::Repository (0)>') }
|
38
|
-
end
|
39
|
-
|
40
34
|
describe '#all' do
|
41
35
|
subject { instance.all }
|
42
36
|
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
describe Template do
|
6
|
+
|
7
|
+
let(:described) { Vedeu::Template }
|
8
|
+
let(:instance) { described.new(object, path) }
|
9
|
+
let(:object) {}
|
10
|
+
let(:path) {}
|
11
|
+
|
12
|
+
describe '#initialize' do
|
13
|
+
it { instance.must_be_instance_of(Vedeu::Template) }
|
14
|
+
it { instance.instance_variable_get('@object').must_equal(object) }
|
15
|
+
it { instance.instance_variable_get('@path').must_equal(path) }
|
16
|
+
end
|
17
|
+
|
18
|
+
describe '.parse' do
|
19
|
+
subject { described.parse(object, path) }
|
20
|
+
end
|
21
|
+
|
22
|
+
end # Template
|
23
|
+
|
24
|
+
end # Vedeu
|
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.2'
|
8
8
|
spec.authors = ['Gavin Laking']
|
9
9
|
spec.email = ['gavinlaking@gmail.com']
|
10
10
|
spec.summary = %q{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.2
|
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-
|
11
|
+
date: 2015-03-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: aruba
|
@@ -342,6 +342,14 @@ files:
|
|
342
342
|
- lib/vedeu/events/event.rb
|
343
343
|
- lib/vedeu/events/trigger.rb
|
344
344
|
- lib/vedeu/exceptions.rb
|
345
|
+
- lib/vedeu/geometry/all.rb
|
346
|
+
- lib/vedeu/geometry/bounding_area.rb
|
347
|
+
- lib/vedeu/geometry/content_geometry.rb
|
348
|
+
- lib/vedeu/geometry/coordinate.rb
|
349
|
+
- lib/vedeu/geometry/grid.rb
|
350
|
+
- lib/vedeu/geometry/limit.rb
|
351
|
+
- lib/vedeu/geometry/position.rb
|
352
|
+
- lib/vedeu/geometry/position_validator.rb
|
345
353
|
- lib/vedeu/input/all.rb
|
346
354
|
- lib/vedeu/input/input.rb
|
347
355
|
- lib/vedeu/input/key.rb
|
@@ -390,22 +398,16 @@ files:
|
|
390
398
|
- lib/vedeu/repositories/all.rb
|
391
399
|
- lib/vedeu/repositories/repository.rb
|
392
400
|
- lib/vedeu/support/all.rb
|
393
|
-
- lib/vedeu/support/bounding_area.rb
|
394
401
|
- lib/vedeu/support/coercions.rb
|
395
402
|
- lib/vedeu/support/common.rb
|
396
403
|
- lib/vedeu/support/console.rb
|
397
|
-
- lib/vedeu/support/content_geometry.rb
|
398
|
-
- lib/vedeu/support/coordinate.rb
|
399
404
|
- lib/vedeu/support/esc.rb
|
400
|
-
- lib/vedeu/support/grid.rb
|
401
|
-
- lib/vedeu/support/limit.rb
|
402
405
|
- lib/vedeu/support/log.rb
|
403
406
|
- lib/vedeu/support/node.rb
|
404
|
-
- lib/vedeu/support/position.rb
|
405
|
-
- lib/vedeu/support/position_validator.rb
|
406
407
|
- lib/vedeu/support/read.rb
|
407
408
|
- lib/vedeu/support/refresh.rb
|
408
409
|
- lib/vedeu/support/sentence.rb
|
410
|
+
- lib/vedeu/support/template.rb
|
409
411
|
- lib/vedeu/support/terminal.rb
|
410
412
|
- lib/vedeu/support/text.rb
|
411
413
|
- lib/vedeu/support/trace.rb
|
@@ -452,6 +454,13 @@ files:
|
|
452
454
|
- test/lib/vedeu/dsl/view_test.rb
|
453
455
|
- test/lib/vedeu/events/event_test.rb
|
454
456
|
- test/lib/vedeu/events/trigger_test.rb
|
457
|
+
- test/lib/vedeu/geometry/bounding_area_test.rb
|
458
|
+
- test/lib/vedeu/geometry/content_geometry_test.rb
|
459
|
+
- test/lib/vedeu/geometry/coordinate_test.rb
|
460
|
+
- test/lib/vedeu/geometry/grid_test.rb
|
461
|
+
- test/lib/vedeu/geometry/limit_test.rb
|
462
|
+
- test/lib/vedeu/geometry/position_test.rb
|
463
|
+
- test/lib/vedeu/geometry/position_validator_test.rb
|
455
464
|
- test/lib/vedeu/input/input_test.rb
|
456
465
|
- test/lib/vedeu/input/key_test.rb
|
457
466
|
- test/lib/vedeu/input/keymap_test.rb
|
@@ -493,21 +502,15 @@ files:
|
|
493
502
|
- test/lib/vedeu/output/writer_test.rb
|
494
503
|
- test/lib/vedeu/repositories/all_test.rb
|
495
504
|
- test/lib/vedeu/repositories/repository_test.rb
|
496
|
-
- test/lib/vedeu/support/bounding_area_test.rb
|
497
505
|
- test/lib/vedeu/support/coercions_test.rb
|
498
506
|
- test/lib/vedeu/support/common_test.rb
|
499
507
|
- test/lib/vedeu/support/console_test.rb
|
500
|
-
- test/lib/vedeu/support/content_geometry_test.rb
|
501
|
-
- test/lib/vedeu/support/coordinate_test.rb
|
502
508
|
- test/lib/vedeu/support/esc_test.rb
|
503
|
-
- test/lib/vedeu/support/grid_test.rb
|
504
|
-
- test/lib/vedeu/support/limit_test.rb
|
505
509
|
- test/lib/vedeu/support/log_test.rb
|
506
|
-
- test/lib/vedeu/support/position_test.rb
|
507
|
-
- test/lib/vedeu/support/position_validator_test.rb
|
508
510
|
- test/lib/vedeu/support/read_test.rb
|
509
511
|
- test/lib/vedeu/support/refresh_test.rb
|
510
512
|
- test/lib/vedeu/support/sentence_test.rb
|
513
|
+
- test/lib/vedeu/support/template_test.rb
|
511
514
|
- test/lib/vedeu/support/terminal_test.rb
|
512
515
|
- test/lib/vedeu/support/text_test.rb
|
513
516
|
- test/lib/vedeu/support/trace_test.rb
|
@@ -591,6 +594,13 @@ test_files:
|
|
591
594
|
- test/lib/vedeu/dsl/view_test.rb
|
592
595
|
- test/lib/vedeu/events/event_test.rb
|
593
596
|
- test/lib/vedeu/events/trigger_test.rb
|
597
|
+
- test/lib/vedeu/geometry/bounding_area_test.rb
|
598
|
+
- test/lib/vedeu/geometry/content_geometry_test.rb
|
599
|
+
- test/lib/vedeu/geometry/coordinate_test.rb
|
600
|
+
- test/lib/vedeu/geometry/grid_test.rb
|
601
|
+
- test/lib/vedeu/geometry/limit_test.rb
|
602
|
+
- test/lib/vedeu/geometry/position_test.rb
|
603
|
+
- test/lib/vedeu/geometry/position_validator_test.rb
|
594
604
|
- test/lib/vedeu/input/input_test.rb
|
595
605
|
- test/lib/vedeu/input/key_test.rb
|
596
606
|
- test/lib/vedeu/input/keymap_test.rb
|
@@ -632,21 +642,15 @@ test_files:
|
|
632
642
|
- test/lib/vedeu/output/writer_test.rb
|
633
643
|
- test/lib/vedeu/repositories/all_test.rb
|
634
644
|
- test/lib/vedeu/repositories/repository_test.rb
|
635
|
-
- test/lib/vedeu/support/bounding_area_test.rb
|
636
645
|
- test/lib/vedeu/support/coercions_test.rb
|
637
646
|
- test/lib/vedeu/support/common_test.rb
|
638
647
|
- test/lib/vedeu/support/console_test.rb
|
639
|
-
- test/lib/vedeu/support/content_geometry_test.rb
|
640
|
-
- test/lib/vedeu/support/coordinate_test.rb
|
641
648
|
- test/lib/vedeu/support/esc_test.rb
|
642
|
-
- test/lib/vedeu/support/grid_test.rb
|
643
|
-
- test/lib/vedeu/support/limit_test.rb
|
644
649
|
- test/lib/vedeu/support/log_test.rb
|
645
|
-
- test/lib/vedeu/support/position_test.rb
|
646
|
-
- test/lib/vedeu/support/position_validator_test.rb
|
647
650
|
- test/lib/vedeu/support/read_test.rb
|
648
651
|
- test/lib/vedeu/support/refresh_test.rb
|
649
652
|
- test/lib/vedeu/support/sentence_test.rb
|
653
|
+
- test/lib/vedeu/support/template_test.rb
|
650
654
|
- test/lib/vedeu/support/terminal_test.rb
|
651
655
|
- test/lib/vedeu/support/text_test.rb
|
652
656
|
- test/lib/vedeu/support/trace_test.rb
|