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
@@ -1,172 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- class ParentPresentationColourTestClass
6
- include Vedeu::Presentation
7
-
8
- def parent
9
- nil
10
- end
11
-
12
- def attributes
13
- {
14
- colour: { background: '#330000', foreground: '#00aadd' },
15
- }
16
- end
17
- end
18
-
19
- class PresentationColourTestClass
20
-
21
- include Vedeu::Presentation
22
-
23
- attr_reader :attributes
24
- attr_reader :parent
25
-
26
- def initialize(attributes = {})
27
- @attributes = attributes
28
- @parent = @attributes[:parent]
29
- end
30
-
31
- end # PresentationTestClass
32
-
33
- module Presentation
34
-
35
- describe Colour do
36
-
37
- let(:includer) { Vedeu::PresentationColourTestClass.new(attributes) }
38
- let(:attributes) {
39
- {
40
- colour: colour,
41
- parent: parent
42
- }
43
- }
44
- let(:colour) {
45
- {
46
- background: background,
47
- foreground: foreground
48
- }
49
- }
50
- let(:background) { '#000033' }
51
- let(:foreground) { '#aadd00' }
52
- let(:parent) { Vedeu::ParentPresentationColourTestClass.new }
53
-
54
- describe '#background' do
55
- subject { includer.background }
56
-
57
- it { subject.must_be_instance_of(Vedeu::Colours::Background) }
58
-
59
- context 'when a colour is not set' do
60
- let(:colour) {}
61
-
62
- context 'when a parent is not available' do
63
- let(:parent) {}
64
-
65
- it { subject.colour.must_equal('') }
66
- end
67
-
68
- context 'when a parent is available' do
69
- it { subject.colour.must_equal('#330000') }
70
- end
71
- end
72
-
73
- context 'when a colour is set' do
74
- it { subject.colour.must_equal('#000033') }
75
- end
76
-
77
- # @todo Add more tests.
78
- end
79
-
80
- describe '#background=' do
81
- subject { includer.background = '#987654' }
82
-
83
- it {
84
- includer.colour.background.colour.must_equal('#000033')
85
- subject
86
- includer.colour.background.colour.must_equal('#987654')
87
- }
88
-
89
- it { subject.must_equal('#987654') }
90
- end
91
-
92
- describe '#foreground' do
93
- subject { includer.foreground }
94
-
95
- it { subject.must_be_instance_of(Vedeu::Colours::Foreground) }
96
- it { subject.colour.must_equal('#aadd00') }
97
-
98
- context 'when a colour is not set' do
99
- let(:colour) {}
100
-
101
- context 'when a parent is not available' do
102
- let(:parent) {}
103
-
104
- it { subject.colour.must_equal('') }
105
- end
106
-
107
- context 'when a parent is available' do
108
- it { subject.colour.must_equal('#00aadd') }
109
- end
110
- end
111
-
112
- context 'when a colour is set' do
113
- it { subject.colour.must_equal('#aadd00') }
114
- end
115
-
116
- # @todo Add more tests.
117
- end
118
-
119
- describe '#foreground=' do
120
- subject { includer.foreground = '#123456' }
121
-
122
- it {
123
- includer.colour.foreground.colour.must_equal('#aadd00')
124
- subject
125
- includer.colour.foreground.colour.must_equal('#123456')
126
- }
127
-
128
- it { subject.must_equal('#123456') }
129
- end
130
-
131
- describe '#colour' do
132
- subject { includer.colour }
133
-
134
- it { subject.must_be_instance_of(Vedeu::Colours::Colour) }
135
-
136
- context 'when a colour is not set' do
137
- let(:colour) {}
138
-
139
- context 'when a parent is not available' do
140
- let(:parent) {}
141
-
142
- it { subject.background.colour.must_equal('') }
143
- it { subject.foreground.colour.must_equal('') }
144
- end
145
-
146
- context 'when a parent is available' do
147
- it { subject.background.colour.must_equal('#330000') }
148
- it { subject.foreground.colour.must_equal('#00aadd') }
149
- end
150
- end
151
-
152
- context 'when a colour is set' do
153
- it { subject.background.colour.must_equal('#000033') }
154
- it { subject.foreground.colour.must_equal('#aadd00') }
155
- end
156
- end
157
-
158
- describe '#colour=' do
159
- let(:colour) {
160
- Vedeu::Colours::Colour.new(foreground: '#00ff00', background: '#000000')
161
- }
162
-
163
- subject { includer.colour=(colour) }
164
-
165
- it { subject.must_be_instance_of(Vedeu::Colours::Colour) }
166
- end
167
-
168
- end # Colour
169
-
170
- end # Presentation
171
-
172
- end # Vedeu