vedeu 0.8.6 → 0.8.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -2
  3. data/.travis.yml +1 -1
  4. data/README.md +2 -6
  5. data/config/rubocop_enabled.yml +0 -6
  6. data/docs/dsl/by_method/clock_time.md +4 -1
  7. data/lib/vedeu/application/application_controller.rb +2 -2
  8. data/lib/vedeu/application/controller.rb +3 -3
  9. data/lib/vedeu/borders/border.rb +6 -6
  10. data/lib/vedeu/borders/dsl.rb +26 -26
  11. data/lib/vedeu/borders/refresh.rb +2 -2
  12. data/lib/vedeu/borders/title.rb +4 -4
  13. data/lib/vedeu/buffers/refresh.rb +8 -7
  14. data/lib/vedeu/buffers/terminal.rb +1 -1
  15. data/lib/vedeu/buffers/view.rb +2 -2
  16. data/lib/vedeu/cells/clear.rb +1 -1
  17. data/lib/vedeu/cells/cursor.rb +6 -6
  18. data/lib/vedeu/cells/empty.rb +2 -2
  19. data/lib/vedeu/cells/escape.rb +6 -6
  20. data/lib/vedeu/coercers/alignment.rb +1 -1
  21. data/lib/vedeu/coercers/colour_attributes.rb +8 -16
  22. data/lib/vedeu/colours/background.rb +4 -8
  23. data/lib/vedeu/colours/colour.rb +4 -4
  24. data/lib/vedeu/colours/foreground.rb +4 -8
  25. data/lib/vedeu/colours/repository.rb +1 -1
  26. data/lib/vedeu/colours/translator.rb +6 -6
  27. data/lib/vedeu/common.rb +1 -1
  28. data/lib/vedeu/configuration/api.rb +15 -15
  29. data/lib/vedeu/configuration/configuration.rb +8 -8
  30. data/lib/vedeu/cursors/coordinate.rb +4 -4
  31. data/lib/vedeu/cursors/cursor.rb +2 -2
  32. data/lib/vedeu/distributed/client.rb +2 -2
  33. data/lib/vedeu/distributed/server.rb +8 -10
  34. data/lib/vedeu/distributed/subprocess.rb +1 -1
  35. data/lib/vedeu/distributed/uri.rb +1 -1
  36. data/lib/vedeu/dsl/cursors.rb +2 -2
  37. data/lib/vedeu/dsl/elements.rb +5 -5
  38. data/lib/vedeu/dsl/helpers/align.rb +1 -1
  39. data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
  40. data/lib/vedeu/dsl/presentation.rb +15 -15
  41. data/lib/vedeu/dsl/view.rb +1 -1
  42. data/lib/vedeu/dsl/views.rb +1 -1
  43. data/lib/vedeu/editor/cursor.rb +1 -1
  44. data/lib/vedeu/editor/line.rb +2 -2
  45. data/lib/vedeu/editor/lines.rb +2 -2
  46. data/lib/vedeu/esc/borders.rb +19 -19
  47. data/lib/vedeu/esc/colours.rb +1 -1
  48. data/lib/vedeu/events/aliases.rb +3 -15
  49. data/lib/vedeu/events/event.rb +14 -14
  50. data/lib/vedeu/events/repository.rb +1 -1
  51. data/lib/vedeu/geometries/area/area.rb +5 -5
  52. data/lib/vedeu/geometries/area/dimension.rb +1 -1
  53. data/lib/vedeu/geometries/dsl/dsl.rb +7 -7
  54. data/lib/vedeu/geometries/geometry.rb +2 -2
  55. data/lib/vedeu/geometries/position.rb +6 -6
  56. data/lib/vedeu/groups/clear.rb +2 -2
  57. data/lib/vedeu/groups/group.rb +2 -2
  58. data/lib/vedeu/input/dsl.rb +1 -1
  59. data/lib/vedeu/input/key.rb +3 -3
  60. data/lib/vedeu/input/mapper.rb +2 -2
  61. data/lib/vedeu/input/read.rb +2 -4
  62. data/lib/vedeu/input/store.rb +1 -17
  63. data/lib/vedeu/input/translator.rb +49 -45
  64. data/lib/vedeu/interfaces/clear.rb +3 -3
  65. data/lib/vedeu/interfaces/dsl.rb +4 -4
  66. data/lib/vedeu/interfaces/interface.rb +2 -2
  67. data/lib/vedeu/logging/clock_time.rb +3 -3
  68. data/lib/vedeu/logging/debug.rb +14 -6
  69. data/lib/vedeu/logging/log.rb +1 -1
  70. data/lib/vedeu/menus/dsl.rb +2 -2
  71. data/lib/vedeu/menus/menu.rb +9 -9
  72. data/lib/vedeu/models/focus.rb +11 -11
  73. data/lib/vedeu/models/page.rb +1 -1
  74. data/lib/vedeu/models/row.rb +1 -1
  75. data/lib/vedeu/models/toggleable.rb +7 -7
  76. data/lib/vedeu/null/generic.rb +29 -29
  77. data/lib/vedeu/output/compressor_cache.rb +1 -11
  78. data/lib/vedeu/output/viewport.rb +4 -12
  79. data/lib/vedeu/output/write.rb +3 -3
  80. data/lib/vedeu/plugins/plugin.rb +1 -1
  81. data/lib/vedeu/presentation/colour.rb +1 -1
  82. data/lib/vedeu/presentation/presentation.rb +1 -1
  83. data/lib/vedeu/presentation/style.rb +4 -4
  84. data/lib/vedeu/renderers/all.rb +1 -14
  85. data/lib/vedeu/renderers/options.rb +1 -1
  86. data/lib/vedeu/repositories/all.rb +1 -0
  87. data/lib/vedeu/repositories/assemblage.rb +1 -1
  88. data/lib/vedeu/repositories/collection.rb +4 -4
  89. data/lib/vedeu/repositories/registerable.rb +2 -2
  90. data/lib/vedeu/repositories/repositories.rb +1 -1
  91. data/lib/vedeu/repositories/repository.rb +3 -3
  92. data/lib/vedeu/repositories/storage.rb +38 -0
  93. data/lib/vedeu/repositories/store.rb +5 -22
  94. data/lib/vedeu/runtime/application.rb +1 -1
  95. data/lib/vedeu/runtime/flags.rb +3 -3
  96. data/lib/vedeu/runtime/router.rb +3 -18
  97. data/lib/vedeu/templating/helpers.rb +5 -3
  98. data/lib/vedeu/templating/view_template.rb +26 -18
  99. data/lib/vedeu/terminal/terminal.rb +5 -5
  100. data/lib/vedeu/version.rb +1 -1
  101. data/lib/vedeu/views/chars.rb +1 -1
  102. data/lib/vedeu/views/composition.rb +4 -4
  103. data/lib/vedeu/views/default_attributes.rb +2 -2
  104. data/lib/vedeu/views/line.rb +6 -6
  105. data/lib/vedeu/views/lines.rb +1 -1
  106. data/lib/vedeu/views/stream.rb +6 -6
  107. data/lib/vedeu/views/streams.rb +1 -1
  108. data/lib/vedeu/views/view.rb +4 -4
  109. data/test/lib/vedeu/borders/border_test.rb +1 -1
  110. data/test/lib/vedeu/borders/caption_test.rb +1 -1
  111. data/test/lib/vedeu/borders/dsl_test.rb +2 -3
  112. data/test/lib/vedeu/borders/refresh_test.rb +1 -1
  113. data/test/lib/vedeu/borders/title_test.rb +1 -1
  114. data/test/lib/vedeu/buffers/buffer_test.rb +7 -7
  115. data/test/lib/vedeu/buffers/refresh_test.rb +1 -1
  116. data/test/lib/vedeu/colours/background_test.rb +27 -0
  117. data/test/lib/vedeu/colours/foreground_test.rb +27 -0
  118. data/test/lib/vedeu/cursors/cursor_test.rb +3 -3
  119. data/test/lib/vedeu/cursors/move_test.rb +1 -1
  120. data/test/lib/vedeu/cursors/refresh_test.rb +1 -1
  121. data/test/lib/vedeu/cursors/reposition_test.rb +2 -2
  122. data/test/lib/vedeu/dsl/view_test.rb +6 -8
  123. data/test/lib/vedeu/editor/cropper_test.rb +1 -1
  124. data/test/lib/vedeu/editor/cursor_test.rb +1 -1
  125. data/test/lib/vedeu/editor/document_test.rb +1 -1
  126. data/test/lib/vedeu/editor/editor_test.rb +1 -1
  127. data/test/lib/vedeu/events/aliases_test.rb +0 -14
  128. data/test/lib/vedeu/geometries/area/area_test.rb +1 -1
  129. data/test/lib/vedeu/geometries/geometry_test.rb +1 -1
  130. data/test/lib/vedeu/geometries/move_test.rb +1 -1
  131. data/test/lib/vedeu/groups/clear_test.rb +1 -1
  132. data/test/lib/vedeu/groups/dsl_test.rb +1 -1
  133. data/test/lib/vedeu/groups/group_test.rb +1 -1
  134. data/test/lib/vedeu/groups/refresh_test.rb +1 -1
  135. data/test/lib/vedeu/input/capture_test.rb +2 -2
  136. data/test/lib/vedeu/input/store_test.rb +0 -34
  137. data/test/lib/vedeu/interfaces/clear_test.rb +1 -1
  138. data/test/lib/vedeu/interfaces/dsl_test.rb +4 -4
  139. data/test/lib/vedeu/interfaces/interface_test.rb +1 -1
  140. data/test/lib/vedeu/menus/dsl_test.rb +1 -1
  141. data/test/lib/vedeu/null/generic_test.rb +1 -1
  142. data/test/lib/vedeu/output/compressor_cache_test.rb +0 -33
  143. data/test/lib/vedeu/renderers/all_test.rb +0 -8
  144. data/test/lib/vedeu/repositories/repository_test.rb +2 -2
  145. data/test/lib/vedeu/repositories/storage_test.rb +74 -0
  146. data/test/lib/vedeu/repositories/store_test.rb +10 -28
  147. data/test/lib/vedeu/runtime/router_test.rb +0 -8
  148. data/test/lib/vedeu/views/default_attributes_test.rb +5 -5
  149. data/test/lib/vedeu/views/view_test.rb +5 -2
  150. data/test/test_helper.rb +1 -1
  151. data/vedeu.gemspec +1 -1
  152. metadata +7 -4
@@ -0,0 +1,74 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Repositories
6
+
7
+ module StorageTestModule
8
+
9
+ extend self
10
+ extend Vedeu::Repositories::Storage
11
+
12
+ def store(test_item = nil)
13
+ storage << test_item if test_item
14
+ end
15
+
16
+ def in_memory
17
+ []
18
+ end
19
+
20
+ end # StorageTestModule
21
+
22
+ describe Storage do
23
+
24
+ let(:extended_described) { Vedeu::Repositories::StorageTestModule }
25
+
26
+ describe '#all' do
27
+ it { extended_described.must_respond_to(:all) }
28
+ end
29
+
30
+ describe '#reset' do
31
+ it { extended_described.must_respond_to(:reset) }
32
+ end
33
+
34
+ describe '#reset!' do
35
+ before do
36
+ extended_described.reset!
37
+ extended_described.store(:some_item)
38
+ end
39
+
40
+ subject { extended_described.reset! }
41
+
42
+ it 'resets the storage to an empty state' do
43
+ extended_described.storage.must_equal([:some_item])
44
+ subject.must_equal([])
45
+ end
46
+ end
47
+
48
+ describe '#storage' do
49
+ subject { extended_described.storage }
50
+
51
+ context 'when the storage is empty' do
52
+ before { extended_described.reset! }
53
+
54
+ it { subject.must_equal([]) }
55
+ end
56
+
57
+ context 'when the storage is not empty' do
58
+ let(:expected) { [:some_item, :other_item] }
59
+
60
+ before do
61
+ extended_described.reset!
62
+ extended_described.store(:some_item)
63
+ extended_described.store(:other_item)
64
+ end
65
+
66
+ it { subject.must_equal(expected) }
67
+ end
68
+ end
69
+
70
+ end # Storage
71
+
72
+ end # Repositories
73
+
74
+ end # Vedeu
@@ -30,6 +30,14 @@ module Vedeu
30
30
  let(:model) {}
31
31
  let(:storage) {}
32
32
 
33
+ describe '#all' do
34
+ it { instance.must_respond_to(:all) }
35
+ end
36
+
37
+ describe '#clear' do
38
+ it { instance.must_respond_to(:clear) }
39
+ end
40
+
33
41
  describe '#each' do
34
42
  subject { instance.each }
35
43
 
@@ -55,8 +63,8 @@ module Vedeu
55
63
 
56
64
  subject { instance.exists?(_name) }
57
65
 
58
- context 'when empty' do
59
- let(:_name) { 'terbium' }
66
+ context 'when the store is empty' do
67
+ let(:_name) { :vedeu_repositories_store }
60
68
 
61
69
  it { subject.must_equal(false) }
62
70
  end
@@ -130,26 +138,6 @@ module Vedeu
130
138
  end
131
139
  end
132
140
 
133
- describe '#reset' do
134
- before { Vedeu.stubs(:log) }
135
-
136
- it 'returns a Hash' do
137
- instance.reset.must_be_instance_of(Hash)
138
- end
139
-
140
- it 'resets the repository' do
141
- instance.reset.must_equal({})
142
- end
143
- end
144
-
145
- describe '#reset!' do
146
- it { instance.must_respond_to(:reset!) }
147
- end
148
-
149
- describe '#clear' do
150
- it { instance.must_respond_to(:clear) }
151
- end
152
-
153
141
  describe '#size' do
154
142
  subject { instance.size }
155
143
 
@@ -164,12 +152,6 @@ module Vedeu
164
152
  end
165
153
  end
166
154
 
167
- describe '#storage' do
168
- subject { instance.storage }
169
-
170
- it { subject.must_equal({}) }
171
- end
172
-
173
155
  describe '#all' do
174
156
  it { instance.must_respond_to(:all) }
175
157
  end
@@ -227,14 +227,6 @@ module Vedeu
227
227
  end
228
228
  end
229
229
 
230
- describe '.reset!' do
231
- subject { described.reset! }
232
-
233
- it { subject.must_equal({}) }
234
-
235
- it { described.must_respond_to(:reset) }
236
- end
237
-
238
230
  end # Router
239
231
 
240
232
  end # Runtime
@@ -13,11 +13,11 @@ module Vedeu
13
13
  def nil_for_testing_purposes
14
14
  nil
15
15
  end
16
- alias_method :client, :nil_for_testing_purposes
17
- alias_method :colour, :nil_for_testing_purposes
18
- alias_method :name, :nil_for_testing_purposes
19
- alias_method :parent, :nil_for_testing_purposes
20
- alias_method :style, :nil_for_testing_purposes
16
+ alias client nil_for_testing_purposes
17
+ alias colour nil_for_testing_purposes
18
+ alias name nil_for_testing_purposes
19
+ alias parent nil_for_testing_purposes
20
+ alias style nil_for_testing_purposes
21
21
 
22
22
  end # DefaultAttributesTest
23
23
 
@@ -25,7 +25,7 @@ module Vedeu
25
25
  let(:client) {}
26
26
  let(:colour) {}
27
27
  let(:cursor_visible) {}
28
- let(:_name) { 'Vedeu::Views::View' }
28
+ let(:_name) { :vedeu_views_view }
29
29
  let(:parent) {}
30
30
  let(:style) {}
31
31
  let(:_value) {}
@@ -35,7 +35,10 @@ module Vedeu
35
35
  it { instance.must_be_instance_of(described) }
36
36
  it { instance.instance_variable_get('@client').must_equal(client) }
37
37
  it { instance.instance_variable_get('@colour').must_equal(colour) }
38
- it { instance.instance_variable_get('@cursor_visible').must_equal(cursor_visible) }
38
+ it do
39
+ instance.instance_variable_get('@cursor_visible')
40
+ .must_equal(cursor_visible)
41
+ end
39
42
  it { instance.instance_variable_get('@name').must_equal(_name) }
40
43
  it { instance.instance_variable_get('@parent').must_equal(parent) }
41
44
  it { instance.instance_variable_get('@style').must_equal(style) }
data/test/test_helper.rb CHANGED
@@ -84,7 +84,7 @@ module MiniTest
84
84
 
85
85
  class << self
86
86
 
87
- alias_method :context, :describe
87
+ alias context describe
88
88
 
89
89
  end # Eigenclass
90
90
 
data/vedeu.gemspec CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'minitest', '5.8.3'
27
27
  spec.add_development_dependency 'minitest-reporters', '1.1.7'
28
28
  spec.add_development_dependency 'mocha', '1.1.0'
29
- spec.add_development_dependency 'rubocop', '0.35.1'
29
+ spec.add_development_dependency 'rubocop', '0.36.0'
30
30
  spec.add_development_dependency 'simplecov', '0.11.1'
31
31
  spec.add_development_dependency 'simplecov-console', '0.3.0'
32
32
  spec.add_development_dependency 'yard', '0.8.7.6'
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.8.6
4
+ version: 0.8.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-16 00:00:00.000000000 Z
11
+ date: 2016-01-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -100,14 +100,14 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 0.35.1
103
+ version: 0.36.0
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 0.35.1
110
+ version: 0.36.0
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: simplecov
113
113
  requirement: !ruby/object:Gem::Requirement
@@ -766,6 +766,7 @@ files:
766
766
  - lib/vedeu/repositories/registerable.rb
767
767
  - lib/vedeu/repositories/repositories.rb
768
768
  - lib/vedeu/repositories/repository.rb
769
+ - lib/vedeu/repositories/storage.rb
769
770
  - lib/vedeu/repositories/store.rb
770
771
  - lib/vedeu/runtime/all.rb
771
772
  - lib/vedeu/runtime/application.rb
@@ -975,6 +976,7 @@ files:
975
976
  - test/lib/vedeu/repositories/registerable_test.rb
976
977
  - test/lib/vedeu/repositories/repositories_test.rb
977
978
  - test/lib/vedeu/repositories/repository_test.rb
979
+ - test/lib/vedeu/repositories/storage_test.rb
978
980
  - test/lib/vedeu/repositories/store_test.rb
979
981
  - test/lib/vedeu/runtime/application_test.rb
980
982
  - test/lib/vedeu/runtime/bootstrap_test.rb
@@ -1224,6 +1226,7 @@ test_files:
1224
1226
  - test/lib/vedeu/repositories/registerable_test.rb
1225
1227
  - test/lib/vedeu/repositories/repositories_test.rb
1226
1228
  - test/lib/vedeu/repositories/repository_test.rb
1229
+ - test/lib/vedeu/repositories/storage_test.rb
1227
1230
  - test/lib/vedeu/repositories/store_test.rb
1228
1231
  - test/lib/vedeu/runtime/application_test.rb
1229
1232
  - test/lib/vedeu/runtime/bootstrap_test.rb