vedeu 0.4.1 → 0.4.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (82) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vedeu.rb +1 -1
  3. data/lib/vedeu/all.rb +2 -0
  4. data/lib/vedeu/buffers/buffer.rb +0 -11
  5. data/lib/vedeu/configuration/api.rb +4 -6
  6. data/lib/vedeu/configuration/cli.rb +1 -3
  7. data/lib/vedeu/configuration/configuration.rb +15 -0
  8. data/lib/vedeu/cursor/cursor.rb +2 -9
  9. data/lib/vedeu/cursor/move_cursor.rb +7 -9
  10. data/lib/vedeu/cursor/toggle_cursor.rb +2 -2
  11. data/lib/vedeu/debug.rb +3 -0
  12. data/lib/vedeu/distributed/test_application.rb +4 -8
  13. data/lib/vedeu/dsl/components/keymap.rb +1 -3
  14. data/lib/vedeu/dsl/composition.rb +2 -2
  15. data/lib/vedeu/dsl/interface.rb +2 -2
  16. data/lib/vedeu/dsl/shared/text.rb +2 -2
  17. data/lib/vedeu/events/event.rb +1 -1
  18. data/lib/vedeu/geometry/all.rb +10 -0
  19. data/lib/vedeu/{support → geometry}/bounding_area.rb +1 -0
  20. data/lib/vedeu/{support → geometry}/content_geometry.rb +0 -7
  21. data/lib/vedeu/{support → geometry}/coordinate.rb +0 -14
  22. data/lib/vedeu/{support → geometry}/grid.rb +0 -0
  23. data/lib/vedeu/{support → geometry}/limit.rb +0 -0
  24. data/lib/vedeu/{support → geometry}/position.rb +3 -5
  25. data/lib/vedeu/{support → geometry}/position_validator.rb +2 -0
  26. data/lib/vedeu/input/input.rb +1 -1
  27. data/lib/vedeu/input/key.rb +0 -13
  28. data/lib/vedeu/input/keymap.rb +1 -1
  29. data/lib/vedeu/models/focus.rb +2 -2
  30. data/lib/vedeu/models/geometry.rb +4 -51
  31. data/lib/vedeu/models/menu.rb +1 -1
  32. data/lib/vedeu/models/model.rb +1 -1
  33. data/lib/vedeu/models/view/char.rb +2 -9
  34. data/lib/vedeu/models/view/composition.rb +3 -10
  35. data/lib/vedeu/models/view/interface.rb +5 -13
  36. data/lib/vedeu/models/view/line.rb +3 -10
  37. data/lib/vedeu/models/view/stream.rb +18 -11
  38. data/lib/vedeu/output/background.rb +6 -21
  39. data/lib/vedeu/output/border.rb +26 -17
  40. data/lib/vedeu/output/colour.rb +1 -1
  41. data/lib/vedeu/output/foreground.rb +6 -21
  42. data/lib/vedeu/output/html_renderer.rb +3 -9
  43. data/lib/vedeu/output/output.rb +38 -11
  44. data/lib/vedeu/output/style.rb +1 -1
  45. data/lib/vedeu/output/translator.rb +45 -15
  46. data/lib/vedeu/output/viewport.rb +1 -1
  47. data/lib/vedeu/output/virtual_buffer.rb +2 -2
  48. data/lib/vedeu/output/wordwrap.rb +1 -1
  49. data/lib/vedeu/repositories/all.rb +9 -9
  50. data/lib/vedeu/repositories/repository.rb +0 -7
  51. data/lib/vedeu/support/all.rb +1 -7
  52. data/lib/vedeu/support/esc.rb +33 -11
  53. data/lib/vedeu/support/template.rb +39 -0
  54. data/lib/vedeu/support/terminal.rb +3 -3
  55. data/lib/vedeu/support/text.rb +1 -1
  56. data/lib/vedeu/support/trace.rb +4 -4
  57. data/lib/vedeu/support/visible.rb +2 -7
  58. data/test/lib/vedeu/buffers/buffer_test.rb +0 -6
  59. data/test/lib/vedeu/cursor/cursor_test.rb +0 -6
  60. data/test/lib/vedeu/{support → geometry}/bounding_area_test.rb +0 -0
  61. data/test/lib/vedeu/{support → geometry}/content_geometry_test.rb +0 -6
  62. data/test/lib/vedeu/{support → geometry}/coordinate_test.rb +0 -8
  63. data/test/lib/vedeu/{support → geometry}/grid_test.rb +0 -0
  64. data/test/lib/vedeu/{support → geometry}/limit_test.rb +0 -0
  65. data/test/lib/vedeu/{support → geometry}/position_test.rb +8 -6
  66. data/test/lib/vedeu/{support → geometry}/position_validator_test.rb +0 -0
  67. data/test/lib/vedeu/input/key_test.rb +0 -12
  68. data/test/lib/vedeu/models/geometry_test.rb +0 -47
  69. data/test/lib/vedeu/models/view/char_test.rb +5 -9
  70. data/test/lib/vedeu/models/view/composition_test.rb +2 -8
  71. data/test/lib/vedeu/models/view/interface_test.rb +2 -8
  72. data/test/lib/vedeu/models/view/line_test.rb +0 -6
  73. data/test/lib/vedeu/models/view/stream_test.rb +0 -6
  74. data/test/lib/vedeu/output/border_test.rb +2 -2
  75. data/test/lib/vedeu/output/html_renderer_test.rb +0 -1
  76. data/test/lib/vedeu/output/output_test.rb +39 -0
  77. data/test/lib/vedeu/repositories/repository_test.rb +0 -6
  78. data/test/lib/vedeu/support/template_test.rb +24 -0
  79. data/test/lib/vedeu/support/visible_test.rb +0 -6
  80. data/test/support/helpers/model_test_class.rb +1 -1
  81. data/vedeu.gemspec +1 -1
  82. 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
@@ -62,12 +62,6 @@ module Vedeu
62
62
  end
63
63
  end
64
64
 
65
- describe '#inspect' do
66
- subject { instance.inspect }
67
-
68
- it { subject.must_equal('<Vedeu::Visible (true)>') }
69
- end
70
-
71
65
  describe '#cursor' do
72
66
  subject { instance.cursor }
73
67
 
@@ -11,7 +11,7 @@ module Vedeu
11
11
  attr_accessor :background, :colour, :name, :style
12
12
 
13
13
  def initialize(attributes = {})
14
- @attributes = defaults.merge(attributes)
14
+ @attributes = defaults.merge!(attributes)
15
15
 
16
16
  @colour = @attributes[:colour]
17
17
  @name = @attributes[:name]
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.1'
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.1
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-02-26 00:00:00.000000000 Z
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