vedeu 0.6.69 → 0.6.70

Sign up to get free protection for your applications and to get access to all the features.
Files changed (114) hide show
  1. checksums.yaml +4 -4
  2. data/docs/api.md +4 -0
  3. data/lib/vedeu/all.rb +5 -7
  4. data/lib/vedeu/borders/all.rb +1 -0
  5. data/lib/vedeu/borders/repository.rb +2 -6
  6. data/lib/vedeu/borders/set_attribute.rb +71 -0
  7. data/lib/vedeu/buffers/buffer.rb +6 -1
  8. data/lib/vedeu/buffers/refresh.rb +6 -1
  9. data/lib/vedeu/common.rb +2 -1
  10. data/lib/vedeu/configuration/configuration.rb +1 -1
  11. data/lib/vedeu/cursors/all.rb +1 -0
  12. data/lib/vedeu/cursors/cursor.rb +8 -27
  13. data/lib/vedeu/cursors/move.rb +69 -0
  14. data/lib/vedeu/cursors/repository.rb +1 -1
  15. data/lib/vedeu/dsl/all.rb +2 -0
  16. data/lib/vedeu/dsl/composition.rb +6 -1
  17. data/lib/vedeu/dsl/lines.rb +21 -0
  18. data/lib/vedeu/dsl/streams.rb +21 -0
  19. data/lib/vedeu/groups/clear.rb +6 -1
  20. data/lib/vedeu/groups/refresh.rb +6 -1
  21. data/lib/vedeu/input/capture.rb +6 -1
  22. data/lib/vedeu/interfaces/clear.rb +6 -1
  23. data/lib/vedeu/interfaces/interface.rb +20 -8
  24. data/lib/vedeu/models/all.rb +1 -0
  25. data/lib/vedeu/models/focus.rb +19 -14
  26. data/lib/vedeu/models/page.rb +5 -0
  27. data/lib/vedeu/models/row.rb +5 -0
  28. data/lib/vedeu/models/toggleable.rb +6 -1
  29. data/lib/vedeu/null/all.rb +0 -1
  30. data/lib/vedeu/output/all.rb +0 -2
  31. data/lib/vedeu/output/compressor.rb +2 -1
  32. data/lib/vedeu/output/wordwrap.rb +6 -1
  33. data/lib/vedeu/output/write.rb +2 -0
  34. data/lib/vedeu/presentation/all.rb +17 -0
  35. data/lib/vedeu/presentation/background.rb +47 -0
  36. data/lib/vedeu/presentation/colour.rb +42 -0
  37. data/lib/vedeu/presentation/foreground.rb +47 -0
  38. data/lib/vedeu/{output/presentation → presentation}/presentation.rb +0 -0
  39. data/lib/vedeu/{output/presentation → presentation}/style.rb +0 -0
  40. data/lib/vedeu/presentation/styles.rb +45 -0
  41. data/lib/vedeu/{output/renderers → renderers}/all.rb +5 -5
  42. data/lib/vedeu/{output/renderers → renderers}/file.rb +0 -0
  43. data/lib/vedeu/{output/renderers → renderers}/html.rb +0 -0
  44. data/lib/vedeu/{output/renderers → renderers}/json.rb +0 -0
  45. data/lib/vedeu/{output/renderers → renderers}/options.rb +5 -1
  46. data/lib/vedeu/{output → renderers}/templates/html_renderer.vedeu +0 -0
  47. data/lib/vedeu/{output/renderers → renderers}/terminal.rb +1 -1
  48. data/lib/vedeu/repositories/all.rb +1 -0
  49. data/lib/vedeu/repositories/parent.rb +32 -0
  50. data/lib/vedeu/repositories/repositories.rb +1 -0
  51. data/lib/vedeu/runtime/flags.rb +2 -0
  52. data/lib/vedeu/templating/view_template.rb +6 -1
  53. data/lib/vedeu/version.rb +1 -1
  54. data/lib/vedeu/views/all.rb +20 -0
  55. data/lib/vedeu/{models/views → views}/char.rb +33 -21
  56. data/lib/vedeu/views/chars.rb +15 -0
  57. data/lib/vedeu/{models/views → views}/composition.rb +0 -0
  58. data/lib/vedeu/{models/views → views}/html_char.rb +0 -0
  59. data/lib/vedeu/{models/views → views}/line.rb +17 -21
  60. data/lib/vedeu/views/lines.rb +15 -0
  61. data/lib/vedeu/{models/views → views}/stream.rb +16 -20
  62. data/lib/vedeu/views/streams.rb +15 -0
  63. data/lib/vedeu/{models/views → views}/view.rb +28 -17
  64. data/lib/vedeu/views/view_collection.rb +15 -0
  65. data/lib/vedeu.rb +2 -0
  66. data/test/lib/vedeu/borders/set_attribute_test.rb +62 -0
  67. data/test/lib/vedeu/common_test.rb +6 -0
  68. data/test/lib/vedeu/cursors/cursor_test.rb +0 -8
  69. data/test/lib/vedeu/cursors/move_test.rb +73 -0
  70. data/test/lib/vedeu/cursors/repository_test.rb +3 -1
  71. data/test/lib/vedeu/dsl/lines_test.rb +12 -0
  72. data/test/lib/vedeu/dsl/streams_test.rb +13 -0
  73. data/test/lib/vedeu/events/aliases_test.rb +4 -4
  74. data/test/lib/vedeu/groups/refresh_test.rb +0 -6
  75. data/test/lib/vedeu/input/store_test.rb +2 -2
  76. data/test/lib/vedeu/interfaces/interface_test.rb +6 -1
  77. data/test/lib/vedeu/models/focus_test.rb +25 -10
  78. data/test/lib/vedeu/models/page_test.rb +6 -0
  79. data/test/lib/vedeu/models/row_test.rb +12 -0
  80. data/test/lib/vedeu/presentation/background_test.rb +72 -0
  81. data/test/lib/vedeu/presentation/colour_test.rb +67 -0
  82. data/test/lib/vedeu/presentation/foreground_test.rb +73 -0
  83. data/test/lib/vedeu/{output/presentation → presentation}/presentation_test.rb +0 -0
  84. data/test/lib/vedeu/{output/presentation → presentation}/style_test.rb +0 -0
  85. data/test/lib/vedeu/{output/presentation → presentation}/styles_test.rb +7 -9
  86. data/test/lib/vedeu/{output/renderers → renderers}/all_test.rb +3 -2
  87. data/test/lib/vedeu/{output/renderers → renderers}/file_test.rb +0 -0
  88. data/test/lib/vedeu/{output/renderers → renderers}/html_test.rb +2 -1
  89. data/test/lib/vedeu/{output/renderers → renderers}/json_test.rb +1 -0
  90. data/test/lib/vedeu/{output/renderers → renderers}/options_test.rb +10 -6
  91. data/test/lib/vedeu/{output/renderers → renderers}/terminal_test.rb +0 -0
  92. data/test/lib/vedeu/repositories/repositories_test.rb +1 -0
  93. data/test/lib/vedeu/runtime/flags_test.rb +2 -0
  94. data/test/lib/vedeu/templating/helpers_test.rb +15 -6
  95. data/test/lib/vedeu/{models/views → views}/char_test.rb +0 -0
  96. data/test/lib/vedeu/{models/views → views}/composition_test.rb +0 -0
  97. data/test/lib/vedeu/{models/views → views}/html_char_test.rb +0 -0
  98. data/test/lib/vedeu/{models/views → views}/line_test.rb +6 -1
  99. data/test/lib/vedeu/views/lines_test.rb +13 -0
  100. data/test/lib/vedeu/{models/views → views}/stream_test.rb +6 -1
  101. data/test/lib/vedeu/views/streams_test.rb +13 -0
  102. data/test/lib/vedeu/views/view_collection_test.rb +13 -0
  103. data/test/lib/vedeu/{models/views → views}/view_test.rb +6 -1
  104. data/test/support/examples/material_colours_app.rb +1 -1
  105. data/test/support/helpers/presentation_colour_test_class.rb +29 -0
  106. data/test/test_helper.rb +4 -0
  107. metadata +84 -56
  108. data/lib/vedeu/models/views/all.rb +0 -16
  109. data/lib/vedeu/null/view.rb +0 -26
  110. data/lib/vedeu/output/presentation/all.rb +0 -15
  111. data/lib/vedeu/output/presentation/colour.rb +0 -100
  112. data/lib/vedeu/output/presentation/styles.rb +0 -42
  113. data/test/lib/vedeu/null/view_test.rb +0 -31
  114. data/test/lib/vedeu/output/presentation/colour_test.rb +0 -172
@@ -0,0 +1,29 @@
1
+ module Vedeu
2
+
3
+ class ParentPresentationColourTestClass
4
+
5
+ include Vedeu::Presentation
6
+
7
+ attr_reader :colour
8
+
9
+ def initialize
10
+ @colour = { background: '#330000', foreground: '#00aadd' }
11
+ @parent = nil
12
+ end
13
+
14
+ end # ParentPresentationColourTestClass
15
+
16
+ class PresentationColourTestClass
17
+
18
+ include Vedeu::Presentation
19
+
20
+ attr_reader :parent
21
+
22
+ def initialize(attributes = {})
23
+ @colour = attributes[:colour]
24
+ @parent = attributes[:parent]
25
+ end
26
+
27
+ end # PresentationTestClass
28
+
29
+ end # Vedeu
data/test/test_helper.rb CHANGED
@@ -27,10 +27,13 @@ if ENV['SIMPLECOV'].to_i == 1 || ENV['CONSOLE_COVERAGE'].to_i == 1
27
27
  add_group 'null', 'vedeu/null'
28
28
  add_group 'output', 'vedeu/output'
29
29
  add_group 'plugins', 'vedeu/plugins'
30
+ add_group 'presentation', 'vedeu/presentation'
31
+ add_group 'renderers', 'vedeu/renders'
30
32
  add_group 'repositories', 'vedeu/repositories'
31
33
  add_group 'runtime', 'vedeu/runtime'
32
34
  add_group 'templating', 'vedeu/templating'
33
35
  add_group 'terminal', 'vedeu/terminal'
36
+ add_group 'views', 'vedeu/views'
34
37
  end
35
38
  end
36
39
 
@@ -88,6 +91,7 @@ end # MiniTest
88
91
  require 'mocha/setup'
89
92
  require 'vedeu'
90
93
  require 'support/helpers/model_test_class'
94
+ require 'support/helpers/presentation_colour_test_class'
91
95
 
92
96
  if ENV['PERFORMANCE'].to_i == 1
93
97
  require 'minitest/reporters'
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.6.69
4
+ version: 0.6.70
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-26 00:00:00.000000000 Z
11
+ date: 2015-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -334,6 +334,7 @@ files:
334
334
  - lib/vedeu/borders/dsl.rb
335
335
  - lib/vedeu/borders/refresh.rb
336
336
  - lib/vedeu/borders/repository.rb
337
+ - lib/vedeu/borders/set_attribute.rb
337
338
  - lib/vedeu/borders/title.rb
338
339
  - lib/vedeu/buffers/all.rb
339
340
  - lib/vedeu/buffers/buffer.rb
@@ -359,6 +360,7 @@ files:
359
360
  - lib/vedeu/cursors/coordinate.rb
360
361
  - lib/vedeu/cursors/cursor.rb
361
362
  - lib/vedeu/cursors/dsl.rb
363
+ - lib/vedeu/cursors/move.rb
362
364
  - lib/vedeu/cursors/refresh.rb
363
365
  - lib/vedeu/cursors/reposition.rb
364
366
  - lib/vedeu/cursors/repository.rb
@@ -381,9 +383,11 @@ files:
381
383
  - lib/vedeu/dsl/composition.rb
382
384
  - lib/vedeu/dsl/dsl.rb
383
385
  - lib/vedeu/dsl/line.rb
386
+ - lib/vedeu/dsl/lines.rb
384
387
  - lib/vedeu/dsl/presentation.rb
385
388
  - lib/vedeu/dsl/shared.rb
386
389
  - lib/vedeu/dsl/stream.rb
390
+ - lib/vedeu/dsl/streams.rb
387
391
  - lib/vedeu/dsl/text.rb
388
392
  - lib/vedeu/dsl/use.rb
389
393
  - lib/vedeu/dsl/view.rb
@@ -473,33 +477,13 @@ files:
473
477
  - lib/vedeu/models/page.rb
474
478
  - lib/vedeu/models/row.rb
475
479
  - lib/vedeu/models/toggleable.rb
476
- - lib/vedeu/models/views/all.rb
477
- - lib/vedeu/models/views/char.rb
478
- - lib/vedeu/models/views/composition.rb
479
- - lib/vedeu/models/views/html_char.rb
480
- - lib/vedeu/models/views/line.rb
481
- - lib/vedeu/models/views/stream.rb
482
- - lib/vedeu/models/views/view.rb
483
480
  - lib/vedeu/null/all.rb
484
481
  - lib/vedeu/null/generic.rb
485
- - lib/vedeu/null/view.rb
486
482
  - lib/vedeu/output/all.rb
487
483
  - lib/vedeu/output/compressor.rb
488
484
  - lib/vedeu/output/compressor_cache.rb
489
485
  - lib/vedeu/output/output.rb
490
- - lib/vedeu/output/presentation/all.rb
491
- - lib/vedeu/output/presentation/colour.rb
492
- - lib/vedeu/output/presentation/presentation.rb
493
- - lib/vedeu/output/presentation/style.rb
494
- - lib/vedeu/output/presentation/styles.rb
495
486
  - lib/vedeu/output/refresh.rb
496
- - lib/vedeu/output/renderers/all.rb
497
- - lib/vedeu/output/renderers/file.rb
498
- - lib/vedeu/output/renderers/html.rb
499
- - lib/vedeu/output/renderers/json.rb
500
- - lib/vedeu/output/renderers/options.rb
501
- - lib/vedeu/output/renderers/terminal.rb
502
- - lib/vedeu/output/templates/html_renderer.vedeu
503
487
  - lib/vedeu/output/text.rb
504
488
  - lib/vedeu/output/viewport.rb
505
489
  - lib/vedeu/output/wordwrap.rb
@@ -507,11 +491,26 @@ files:
507
491
  - lib/vedeu/plugins/all.rb
508
492
  - lib/vedeu/plugins/plugin.rb
509
493
  - lib/vedeu/plugins/plugins.rb
494
+ - lib/vedeu/presentation/all.rb
495
+ - lib/vedeu/presentation/background.rb
496
+ - lib/vedeu/presentation/colour.rb
497
+ - lib/vedeu/presentation/foreground.rb
498
+ - lib/vedeu/presentation/presentation.rb
499
+ - lib/vedeu/presentation/style.rb
500
+ - lib/vedeu/presentation/styles.rb
501
+ - lib/vedeu/renderers/all.rb
502
+ - lib/vedeu/renderers/file.rb
503
+ - lib/vedeu/renderers/html.rb
504
+ - lib/vedeu/renderers/json.rb
505
+ - lib/vedeu/renderers/options.rb
506
+ - lib/vedeu/renderers/templates/html_renderer.vedeu
507
+ - lib/vedeu/renderers/terminal.rb
510
508
  - lib/vedeu/repositories/all.rb
511
509
  - lib/vedeu/repositories/assemblage.rb
512
510
  - lib/vedeu/repositories/collection.rb
513
511
  - lib/vedeu/repositories/defaults.rb
514
512
  - lib/vedeu/repositories/model.rb
513
+ - lib/vedeu/repositories/parent.rb
515
514
  - lib/vedeu/repositories/registerable.rb
516
515
  - lib/vedeu/repositories/repositories.rb
517
516
  - lib/vedeu/repositories/repository.rb
@@ -534,6 +533,17 @@ files:
534
533
  - lib/vedeu/terminal/mode.rb
535
534
  - lib/vedeu/terminal/terminal.rb
536
535
  - lib/vedeu/version.rb
536
+ - lib/vedeu/views/all.rb
537
+ - lib/vedeu/views/char.rb
538
+ - lib/vedeu/views/chars.rb
539
+ - lib/vedeu/views/composition.rb
540
+ - lib/vedeu/views/html_char.rb
541
+ - lib/vedeu/views/line.rb
542
+ - lib/vedeu/views/lines.rb
543
+ - lib/vedeu/views/stream.rb
544
+ - lib/vedeu/views/streams.rb
545
+ - lib/vedeu/views/view.rb
546
+ - lib/vedeu/views/view_collection.rb
537
547
  - test/lib/vedeu/application/application_controller_test.rb
538
548
  - test/lib/vedeu/application/application_helper_test.rb
539
549
  - test/lib/vedeu/application/application_view_test.rb
@@ -545,6 +555,7 @@ files:
545
555
  - test/lib/vedeu/borders/dsl_test.rb
546
556
  - test/lib/vedeu/borders/refresh_test.rb
547
557
  - test/lib/vedeu/borders/repository_test.rb
558
+ - test/lib/vedeu/borders/set_attribute_test.rb
548
559
  - test/lib/vedeu/borders/title_test.rb
549
560
  - test/lib/vedeu/buffers/buffer_test.rb
550
561
  - test/lib/vedeu/buffers/empty_test.rb
@@ -566,6 +577,7 @@ files:
566
577
  - test/lib/vedeu/cursors/coordinate_test.rb
567
578
  - test/lib/vedeu/cursors/cursor_test.rb
568
579
  - test/lib/vedeu/cursors/dsl_test.rb
580
+ - test/lib/vedeu/cursors/move_test.rb
569
581
  - test/lib/vedeu/cursors/refresh_test.rb
570
582
  - test/lib/vedeu/cursors/reposition_test.rb
571
583
  - test/lib/vedeu/cursors/repository_test.rb
@@ -577,9 +589,11 @@ files:
577
589
  - test/lib/vedeu/dsl/composition_test.rb
578
590
  - test/lib/vedeu/dsl/dsl_test.rb
579
591
  - test/lib/vedeu/dsl/line_test.rb
592
+ - test/lib/vedeu/dsl/lines_test.rb
580
593
  - test/lib/vedeu/dsl/presentation_test.rb
581
594
  - test/lib/vedeu/dsl/shared_test.rb
582
595
  - test/lib/vedeu/dsl/stream_test.rb
596
+ - test/lib/vedeu/dsl/streams_test.rb
583
597
  - test/lib/vedeu/dsl/text_test.rb
584
598
  - test/lib/vedeu/dsl/use_test.rb
585
599
  - test/lib/vedeu/dsl/view_test.rb
@@ -656,34 +670,29 @@ files:
656
670
  - test/lib/vedeu/models/page_test.rb
657
671
  - test/lib/vedeu/models/row_test.rb
658
672
  - test/lib/vedeu/models/toggleable_test.rb
659
- - test/lib/vedeu/models/views/char_test.rb
660
- - test/lib/vedeu/models/views/composition_test.rb
661
- - test/lib/vedeu/models/views/html_char_test.rb
662
- - test/lib/vedeu/models/views/line_test.rb
663
- - test/lib/vedeu/models/views/stream_test.rb
664
- - test/lib/vedeu/models/views/view_test.rb
665
673
  - test/lib/vedeu/null/generic_test.rb
666
- - test/lib/vedeu/null/view_test.rb
667
674
  - test/lib/vedeu/output/compressor_cache_test.rb
668
675
  - test/lib/vedeu/output/compressor_test.rb
669
676
  - test/lib/vedeu/output/output_test.rb
670
- - test/lib/vedeu/output/presentation/colour_test.rb
671
- - test/lib/vedeu/output/presentation/presentation_test.rb
672
- - test/lib/vedeu/output/presentation/style_test.rb
673
- - test/lib/vedeu/output/presentation/styles_test.rb
674
677
  - test/lib/vedeu/output/refresh_test.rb
675
- - test/lib/vedeu/output/renderers/all_test.rb
676
- - test/lib/vedeu/output/renderers/file_test.rb
677
- - test/lib/vedeu/output/renderers/html_test.rb
678
- - test/lib/vedeu/output/renderers/json_test.rb
679
- - test/lib/vedeu/output/renderers/options_test.rb
680
- - test/lib/vedeu/output/renderers/terminal_test.rb
681
678
  - test/lib/vedeu/output/text_test.rb
682
679
  - test/lib/vedeu/output/viewport_test.rb
683
680
  - test/lib/vedeu/output/wordwrap_test.rb
684
681
  - test/lib/vedeu/output/write_test.rb
685
682
  - test/lib/vedeu/plugins/plugin_test.rb
686
683
  - test/lib/vedeu/plugins/plugins_test.rb
684
+ - test/lib/vedeu/presentation/background_test.rb
685
+ - test/lib/vedeu/presentation/colour_test.rb
686
+ - test/lib/vedeu/presentation/foreground_test.rb
687
+ - test/lib/vedeu/presentation/presentation_test.rb
688
+ - test/lib/vedeu/presentation/style_test.rb
689
+ - test/lib/vedeu/presentation/styles_test.rb
690
+ - test/lib/vedeu/renderers/all_test.rb
691
+ - test/lib/vedeu/renderers/file_test.rb
692
+ - test/lib/vedeu/renderers/html_test.rb
693
+ - test/lib/vedeu/renderers/json_test.rb
694
+ - test/lib/vedeu/renderers/options_test.rb
695
+ - test/lib/vedeu/renderers/terminal_test.rb
687
696
  - test/lib/vedeu/repositories/assemblage_test.rb
688
697
  - test/lib/vedeu/repositories/collection_test.rb
689
698
  - test/lib/vedeu/repositories/defaults_test.rb
@@ -706,6 +715,15 @@ files:
706
715
  - test/lib/vedeu/templating/view_template_test.rb
707
716
  - test/lib/vedeu/terminal/mode_test.rb
708
717
  - test/lib/vedeu/terminal/terminal_test.rb
718
+ - test/lib/vedeu/views/char_test.rb
719
+ - test/lib/vedeu/views/composition_test.rb
720
+ - test/lib/vedeu/views/html_char_test.rb
721
+ - test/lib/vedeu/views/line_test.rb
722
+ - test/lib/vedeu/views/lines_test.rb
723
+ - test/lib/vedeu/views/stream_test.rb
724
+ - test/lib/vedeu/views/streams_test.rb
725
+ - test/lib/vedeu/views/view_collection_test.rb
726
+ - test/lib/vedeu/views/view_test.rb
709
727
  - test/lib/vedeu_test.rb
710
728
  - test/support/colour_support.sh
711
729
  - test/support/coverage.rb
@@ -719,6 +737,7 @@ files:
719
737
  - test/support/examples/view_templates_app/view_templates_app.rb
720
738
  - test/support/examples/view_templates_app/wrap.erb
721
739
  - test/support/helpers/model_test_class.rb
740
+ - test/support/helpers/presentation_colour_test_class.rb
722
741
  - test/support/stats.sh
723
742
  - test/support/templates/html_renderer.vedeu
724
743
  - test/support/ttyrec.rb
@@ -761,6 +780,7 @@ test_files:
761
780
  - test/lib/vedeu/borders/dsl_test.rb
762
781
  - test/lib/vedeu/borders/refresh_test.rb
763
782
  - test/lib/vedeu/borders/repository_test.rb
783
+ - test/lib/vedeu/borders/set_attribute_test.rb
764
784
  - test/lib/vedeu/borders/title_test.rb
765
785
  - test/lib/vedeu/buffers/buffer_test.rb
766
786
  - test/lib/vedeu/buffers/empty_test.rb
@@ -782,6 +802,7 @@ test_files:
782
802
  - test/lib/vedeu/cursors/coordinate_test.rb
783
803
  - test/lib/vedeu/cursors/cursor_test.rb
784
804
  - test/lib/vedeu/cursors/dsl_test.rb
805
+ - test/lib/vedeu/cursors/move_test.rb
785
806
  - test/lib/vedeu/cursors/refresh_test.rb
786
807
  - test/lib/vedeu/cursors/reposition_test.rb
787
808
  - test/lib/vedeu/cursors/repository_test.rb
@@ -793,9 +814,11 @@ test_files:
793
814
  - test/lib/vedeu/dsl/composition_test.rb
794
815
  - test/lib/vedeu/dsl/dsl_test.rb
795
816
  - test/lib/vedeu/dsl/line_test.rb
817
+ - test/lib/vedeu/dsl/lines_test.rb
796
818
  - test/lib/vedeu/dsl/presentation_test.rb
797
819
  - test/lib/vedeu/dsl/shared_test.rb
798
820
  - test/lib/vedeu/dsl/stream_test.rb
821
+ - test/lib/vedeu/dsl/streams_test.rb
799
822
  - test/lib/vedeu/dsl/text_test.rb
800
823
  - test/lib/vedeu/dsl/use_test.rb
801
824
  - test/lib/vedeu/dsl/view_test.rb
@@ -872,34 +895,29 @@ test_files:
872
895
  - test/lib/vedeu/models/page_test.rb
873
896
  - test/lib/vedeu/models/row_test.rb
874
897
  - test/lib/vedeu/models/toggleable_test.rb
875
- - test/lib/vedeu/models/views/char_test.rb
876
- - test/lib/vedeu/models/views/composition_test.rb
877
- - test/lib/vedeu/models/views/html_char_test.rb
878
- - test/lib/vedeu/models/views/line_test.rb
879
- - test/lib/vedeu/models/views/stream_test.rb
880
- - test/lib/vedeu/models/views/view_test.rb
881
898
  - test/lib/vedeu/null/generic_test.rb
882
- - test/lib/vedeu/null/view_test.rb
883
899
  - test/lib/vedeu/output/compressor_cache_test.rb
884
900
  - test/lib/vedeu/output/compressor_test.rb
885
901
  - test/lib/vedeu/output/output_test.rb
886
- - test/lib/vedeu/output/presentation/colour_test.rb
887
- - test/lib/vedeu/output/presentation/presentation_test.rb
888
- - test/lib/vedeu/output/presentation/style_test.rb
889
- - test/lib/vedeu/output/presentation/styles_test.rb
890
902
  - test/lib/vedeu/output/refresh_test.rb
891
- - test/lib/vedeu/output/renderers/all_test.rb
892
- - test/lib/vedeu/output/renderers/file_test.rb
893
- - test/lib/vedeu/output/renderers/html_test.rb
894
- - test/lib/vedeu/output/renderers/json_test.rb
895
- - test/lib/vedeu/output/renderers/options_test.rb
896
- - test/lib/vedeu/output/renderers/terminal_test.rb
897
903
  - test/lib/vedeu/output/text_test.rb
898
904
  - test/lib/vedeu/output/viewport_test.rb
899
905
  - test/lib/vedeu/output/wordwrap_test.rb
900
906
  - test/lib/vedeu/output/write_test.rb
901
907
  - test/lib/vedeu/plugins/plugin_test.rb
902
908
  - test/lib/vedeu/plugins/plugins_test.rb
909
+ - test/lib/vedeu/presentation/background_test.rb
910
+ - test/lib/vedeu/presentation/colour_test.rb
911
+ - test/lib/vedeu/presentation/foreground_test.rb
912
+ - test/lib/vedeu/presentation/presentation_test.rb
913
+ - test/lib/vedeu/presentation/style_test.rb
914
+ - test/lib/vedeu/presentation/styles_test.rb
915
+ - test/lib/vedeu/renderers/all_test.rb
916
+ - test/lib/vedeu/renderers/file_test.rb
917
+ - test/lib/vedeu/renderers/html_test.rb
918
+ - test/lib/vedeu/renderers/json_test.rb
919
+ - test/lib/vedeu/renderers/options_test.rb
920
+ - test/lib/vedeu/renderers/terminal_test.rb
903
921
  - test/lib/vedeu/repositories/assemblage_test.rb
904
922
  - test/lib/vedeu/repositories/collection_test.rb
905
923
  - test/lib/vedeu/repositories/defaults_test.rb
@@ -922,6 +940,15 @@ test_files:
922
940
  - test/lib/vedeu/templating/view_template_test.rb
923
941
  - test/lib/vedeu/terminal/mode_test.rb
924
942
  - test/lib/vedeu/terminal/terminal_test.rb
943
+ - test/lib/vedeu/views/char_test.rb
944
+ - test/lib/vedeu/views/composition_test.rb
945
+ - test/lib/vedeu/views/html_char_test.rb
946
+ - test/lib/vedeu/views/line_test.rb
947
+ - test/lib/vedeu/views/lines_test.rb
948
+ - test/lib/vedeu/views/stream_test.rb
949
+ - test/lib/vedeu/views/streams_test.rb
950
+ - test/lib/vedeu/views/view_collection_test.rb
951
+ - test/lib/vedeu/views/view_test.rb
925
952
  - test/lib/vedeu_test.rb
926
953
  - test/support/colour_support.sh
927
954
  - test/support/coverage.rb
@@ -935,6 +962,7 @@ test_files:
935
962
  - test/support/examples/view_templates_app/view_templates_app.rb
936
963
  - test/support/examples/view_templates_app/wrap.erb
937
964
  - test/support/helpers/model_test_class.rb
965
+ - test/support/helpers/presentation_colour_test_class.rb
938
966
  - test/support/stats.sh
939
967
  - test/support/templates/html_renderer.vedeu
940
968
  - test/support/ttyrec.rb
@@ -1,16 +0,0 @@
1
- module Vedeu
2
-
3
- # View related models.
4
- #
5
- module Views
6
-
7
- end # Views
8
-
9
- end # Vedeu
10
-
11
- require 'vedeu/models/views/char'
12
- require 'vedeu/models/views/html_char'
13
- require 'vedeu/models/views/stream'
14
- require 'vedeu/models/views/line'
15
- require 'vedeu/models/views/view'
16
- require 'vedeu/models/views/composition'
@@ -1,26 +0,0 @@
1
- module Vedeu
2
-
3
- module Null
4
-
5
- # Provides a non-existent model to swallow messages.
6
- #
7
- class View < Vedeu::Null::Generic
8
-
9
- include Vedeu::Presentation
10
-
11
- # Returns a new instance of Vedeu::Null::View.
12
- #
13
- # @param attributes [Hash<Symbol => void>]
14
- # @option attributes name [String|Symbol]
15
- # @return [Vedeu::Null::View]
16
- def initialize(attributes = {})
17
- @attributes = attributes
18
- @name = @attributes[:name]
19
- @visible = false
20
- end
21
-
22
- end # View
23
-
24
- end # Null
25
-
26
- end # Vedeu
@@ -1,15 +0,0 @@
1
- require 'vedeu/output/presentation/colour'
2
- require 'vedeu/output/presentation/styles'
3
- require 'vedeu/output/presentation/style'
4
- require 'vedeu/output/presentation/presentation'
5
-
6
- module Vedeu
7
-
8
- # This module allows the sharing of presentation concerns between
9
- # the models: Interface, View, Line and Stream.
10
- #
11
- module Presentation
12
-
13
- end # Presentation
14
-
15
- end # Vedeu
@@ -1,100 +0,0 @@
1
- module Vedeu
2
-
3
- module Presentation
4
-
5
- # Provides colour related presentation behaviour.
6
- #
7
- module Colour
8
-
9
- # When the background colour for the model exists, return it,
10
- # otherwise returns the parent background colour, or an empty
11
- # Vedeu::Colours::Background.
12
- #
13
- # @return [Vedeu::Colours::Background]
14
- def background
15
- @background ||= if colour
16
- colour.background
17
-
18
- elsif self.is_a?(Vedeu::Views::Char) && name
19
- interface.colour.background
20
-
21
- elsif parent
22
- parent.background
23
-
24
- else
25
- Vedeu::Colours::Background.new
26
-
27
- end
28
- end
29
-
30
- # Allows the setting of the background colour by coercing the
31
- # given value into a Vedeu::Colours::Background colour.
32
- #
33
- # @return [Vedeu::Colours::Background]
34
- def background=(value)
35
- @colour = Vedeu::Colours::Colour.coerce(
36
- background: Vedeu::Colours::Background.coerce(value),
37
- foreground: colour.foreground)
38
- end
39
-
40
- # @return [Vedeu::Colours::Colour]
41
- def colour
42
- @colour ||= if attributes[:colour]
43
- Vedeu::Colours::Colour.coerce(attributes[:colour])
44
-
45
- elsif self.is_a?(Vedeu::Views::Char) && name
46
- Vedeu::Colours::Colour.coerce(interface.colour)
47
-
48
- elsif parent
49
- Vedeu::Colours::Colour.coerce(parent.colour)
50
-
51
- else
52
- Vedeu::Colours::Colour.new
53
-
54
- end
55
- end
56
-
57
- # Allows the setting of the model's colour by coercing the given
58
- # value into a Vedeu::Colours::Colour.
59
- #
60
- # @return [Vedeu::Colours::Colour]
61
- def colour=(value)
62
- @colour = attributes[:colour] = Vedeu::Colours::Colour.coerce(value)
63
- end
64
-
65
- # When the foreground colour for the model exists, return it,
66
- # otherwise returns the parent foreground colour, or an empty
67
- # Vedeu::Colours::Foreground.
68
- #
69
- # @return [Vedeu::Colours::Foreground]
70
- def foreground
71
- @foreground ||= if colour
72
- colour.foreground
73
-
74
- elsif self.is_a?(Vedeu::Views::Char) && name
75
- interface.colour.background
76
-
77
- elsif parent
78
- parent.foreground
79
-
80
- else
81
- Vedeu::Colours::Foreground.new
82
-
83
- end
84
- end
85
-
86
- # Allows the setting of the foreground colour by coercing the
87
- # given value into a Vedeu::Colours::Foreground colour.
88
- #
89
- # @return [Vedeu::Colours::Foreground]
90
- def foreground=(value)
91
- @colour = attributes[:colour] = Vedeu::Colours::Colour.coerce(
92
- background: colour.background,
93
- foreground: Vedeu::Colours::Foreground.coerce(value))
94
- end
95
-
96
- end # Colour
97
-
98
- end # Presentation
99
-
100
- end # Vedeu
@@ -1,42 +0,0 @@
1
- module Vedeu
2
-
3
- module Presentation
4
-
5
- # Provides style related presentation behaviour.
6
- #
7
- module Styles
8
-
9
- # When the style for the model exists, return it, otherwise
10
- # returns the parent style, or an empty
11
- # {Vedeu::Presentation::Style}.
12
- #
13
- # @return [Vedeu::Presentation::Style]
14
- def style
15
- @style ||= if attributes[:style]
16
- Vedeu::Presentation::Style.coerce(attributes[:style])
17
-
18
- elsif self.is_a?(Vedeu::Views::Char) && name
19
- Vedeu::Presentation::Style.coerce(interface.style)
20
-
21
- elsif parent
22
- Vedeu::Presentation::Style.coerce(parent.style)
23
-
24
- else
25
- Vedeu::Presentation::Style.new
26
-
27
- end
28
- end
29
-
30
- # Allows the setting of the style by coercing the given value
31
- # into a {Vedeu::Presentation::Style}.
32
- #
33
- # @return [Vedeu::Presentation::Style]
34
- def style=(value)
35
- @style = Vedeu::Presentation::Style.coerce(value)
36
- end
37
-
38
- end # Style
39
-
40
- end # Presentation
41
-
42
- end # Vedeu
@@ -1,31 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Null
6
-
7
- describe View do
8
-
9
- let(:described) { Vedeu::Null::View }
10
- let(:instance) { described.new(attributes) }
11
- let(:_name) { 'vedeu_null_view' }
12
- let(:visible) { false }
13
- let(:attributes) {
14
- {
15
- name: _name,
16
- visible: visible,
17
- }
18
- }
19
-
20
- describe '#initialize' do
21
- it { instance.must_be_instance_of(described) }
22
- it { instance.instance_variable_get('@attributes').must_equal(attributes) }
23
- it { instance.instance_variable_get('@name').must_equal(_name) }
24
- it { instance.instance_variable_get('@visible').must_equal(visible) }
25
- end
26
-
27
- end # View
28
-
29
- end # Null
30
-
31
- end # Vedeu