vedeu 0.4.13 → 0.4.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (251) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -1
  3. data/.travis.yml +2 -1
  4. data/Guardfile +6 -5
  5. data/README.md +3 -30
  6. data/Rakefile +5 -5
  7. data/bin/vedeu_drb_client +1 -1
  8. data/bin/vedeu_drb_server +91 -89
  9. data/bin/vedeu_test +4 -0
  10. data/config/rubocop_enabled.yml +5 -10
  11. data/examples/borders_app.rb +2 -1
  12. data/examples/colours_app.rb +13 -8
  13. data/examples/configuration_app.rb +3 -2
  14. data/examples/cursor_app.rb +16 -11
  15. data/examples/drb_app.rb +88 -89
  16. data/examples/focus_app.rb +31 -32
  17. data/examples/geometry_app.rb +2 -1
  18. data/examples/hello_world.rb +2 -1
  19. data/examples/lines_app.rb +2 -1
  20. data/examples/material_colours_app.rb +126 -0
  21. data/examples/typed_commands/typed_commands_app.rb +5 -1
  22. data/examples/view_templates_app/view_templates_app.rb +6 -3
  23. data/lib/vedeu/all.rb +1 -1
  24. data/lib/vedeu/api.rb +18 -10
  25. data/lib/vedeu/application.rb +0 -1
  26. data/lib/vedeu/bindings.rb +77 -16
  27. data/lib/vedeu/buffers/all.rb +2 -5
  28. data/lib/vedeu/buffers/buffer.rb +69 -25
  29. data/lib/vedeu/buffers/display_buffer.rb +3 -7
  30. data/lib/vedeu/configuration/all.rb +3 -6
  31. data/lib/vedeu/configuration/api.rb +28 -4
  32. data/lib/vedeu/configuration/cli.rb +9 -9
  33. data/lib/vedeu/configuration/configuration.rb +11 -7
  34. data/lib/vedeu/cursor/all.rb +3 -6
  35. data/lib/vedeu/cursor/cursor.rb +22 -14
  36. data/lib/vedeu/cursor/move.rb +32 -22
  37. data/lib/vedeu/cursor/refresh_cursor.rb +1 -1
  38. data/lib/vedeu/debug.rb +2 -1
  39. data/lib/vedeu/distributed/client.rb +1 -7
  40. data/lib/vedeu/distributed/server.rb +0 -4
  41. data/lib/vedeu/distributed/subprocess.rb +1 -1
  42. data/lib/vedeu/distributed/templates/default_configuration.vedeu +1 -1
  43. data/lib/vedeu/distributed/test_application.rb +3 -5
  44. data/lib/vedeu/distributed/uri.rb +2 -2
  45. data/lib/vedeu/dsl/all.rb +6 -6
  46. data/lib/vedeu/dsl/components/all.rb +0 -3
  47. data/lib/vedeu/dsl/components/border.rb +20 -12
  48. data/lib/vedeu/dsl/components/geometry.rb +68 -3
  49. data/lib/vedeu/dsl/components/keymap.rb +1 -2
  50. data/lib/vedeu/dsl/composition.rb +8 -1
  51. data/lib/vedeu/dsl/interface.rb +61 -11
  52. data/lib/vedeu/dsl/line.rb +12 -12
  53. data/lib/vedeu/dsl/shared/all.rb +4 -7
  54. data/lib/vedeu/dsl/shared/colour.rb +2 -2
  55. data/lib/vedeu/dsl/shared/text.rb +2 -35
  56. data/lib/vedeu/dsl/shared/use.rb +2 -2
  57. data/lib/vedeu/dsl/view.rb +4 -4
  58. data/lib/vedeu/events/all.rb +3 -5
  59. data/lib/vedeu/events/event.rb +5 -5
  60. data/lib/vedeu/geometry/all.rb +11 -16
  61. data/lib/vedeu/geometry/area.rb +2 -5
  62. data/lib/vedeu/geometry/canvas.rb +12 -16
  63. data/lib/vedeu/geometry/dimension.rb +20 -22
  64. data/lib/vedeu/geometry/geometry.rb +28 -30
  65. data/lib/vedeu/geometry/grid.rb +1 -1
  66. data/lib/vedeu/geometry/index_position.rb +7 -0
  67. data/lib/vedeu/geometry/null_geometry.rb +61 -0
  68. data/lib/vedeu/geometry/position.rb +0 -3
  69. data/lib/vedeu/geometry/position_index.rb +7 -0
  70. data/lib/vedeu/geometry/position_validator.rb +44 -33
  71. data/lib/vedeu/input/all.rb +5 -4
  72. data/lib/vedeu/input/keymap.rb +0 -1
  73. data/lib/vedeu/input/mapper.rb +1 -3
  74. data/lib/vedeu/launcher.rb +6 -7
  75. data/lib/vedeu/main_loop.rb +1 -2
  76. data/lib/vedeu/models/all.rb +1 -0
  77. data/lib/vedeu/models/cell.rb +5 -8
  78. data/lib/vedeu/models/char.rb +50 -15
  79. data/lib/vedeu/models/composition.rb +8 -1
  80. data/lib/vedeu/models/focus.rb +4 -4
  81. data/lib/vedeu/models/group.rb +3 -3
  82. data/lib/vedeu/models/interface.rb +62 -46
  83. data/lib/vedeu/models/line.rb +1 -1
  84. data/lib/vedeu/models/null.rb +48 -0
  85. data/lib/vedeu/models/stream.rb +5 -5
  86. data/lib/vedeu/output/all.rb +20 -30
  87. data/lib/vedeu/output/border.rb +93 -40
  88. data/lib/vedeu/output/clear.rb +100 -15
  89. data/lib/vedeu/output/colour.rb +56 -12
  90. data/lib/vedeu/output/compressor.rb +59 -0
  91. data/lib/vedeu/output/html_char.rb +4 -2
  92. data/lib/vedeu/output/null_border.rb +16 -4
  93. data/lib/vedeu/output/output.rb +13 -21
  94. data/lib/vedeu/output/presentation.rb +28 -23
  95. data/lib/vedeu/output/refresh.rb +2 -2
  96. data/lib/vedeu/output/renderers/all.rb +80 -3
  97. data/lib/vedeu/output/renderers/file_renderer.rb +38 -2
  98. data/lib/vedeu/output/renderers/html_renderer.rb +6 -4
  99. data/lib/vedeu/output/renderers/json_renderer.rb +52 -0
  100. data/lib/vedeu/output/renderers/null_renderer.rb +14 -0
  101. data/lib/vedeu/output/renderers/terminal_renderer.rb +2 -12
  102. data/lib/vedeu/output/style.rb +33 -3
  103. data/lib/vedeu/output/text.rb +98 -1
  104. data/lib/vedeu/output/translator.rb +30 -7
  105. data/lib/vedeu/output/viewport.rb +43 -79
  106. data/lib/vedeu/output/wordwrap.rb +4 -4
  107. data/lib/vedeu/repositories/all.rb +22 -179
  108. data/lib/vedeu/repositories/collection.rb +11 -13
  109. data/lib/vedeu/repositories/collections/all.rb +8 -0
  110. data/lib/vedeu/repositories/collections/chars.rb +9 -0
  111. data/lib/vedeu/repositories/collections/events.rb +9 -0
  112. data/lib/vedeu/repositories/collections/interfaces.rb +9 -0
  113. data/lib/vedeu/repositories/collections/keys.rb +9 -0
  114. data/lib/vedeu/repositories/collections/lines.rb +9 -0
  115. data/lib/vedeu/repositories/collections/streams.rb +9 -0
  116. data/lib/vedeu/repositories/model.rb +7 -2
  117. data/lib/vedeu/repositories/repositories/all.rb +14 -0
  118. data/lib/vedeu/repositories/repositories/background_colours.rb +14 -0
  119. data/lib/vedeu/repositories/repositories/borders.rb +38 -0
  120. data/lib/vedeu/repositories/repositories/buffers.rb +36 -0
  121. data/lib/vedeu/repositories/repositories/colours.rb +63 -0
  122. data/lib/vedeu/repositories/repositories/cursors.rb +29 -0
  123. data/lib/vedeu/repositories/repositories/events_repository.rb +24 -0
  124. data/lib/vedeu/repositories/repositories/foreground_colours.rb +14 -0
  125. data/lib/vedeu/repositories/repositories/geometries.rb +37 -0
  126. data/lib/vedeu/repositories/repositories/groups.rb +24 -0
  127. data/lib/vedeu/repositories/repositories/interfaces_repository.rb +24 -0
  128. data/lib/vedeu/repositories/repositories/keymaps.rb +24 -0
  129. data/lib/vedeu/repositories/repositories/menus.rb +24 -0
  130. data/lib/vedeu/repositories/repository.rb +29 -47
  131. data/lib/vedeu/storage/all.rb +6 -0
  132. data/lib/vedeu/storage/associative_store.rb +47 -0
  133. data/lib/vedeu/storage/conveyor_store.rb +69 -0
  134. data/lib/vedeu/storage/fifo_store.rb +37 -0
  135. data/lib/vedeu/storage/store.rb +58 -0
  136. data/lib/vedeu/support/all.rb +5 -10
  137. data/lib/vedeu/support/common.rb +0 -8
  138. data/lib/vedeu/support/log.rb +13 -24
  139. data/lib/vedeu/support/template.rb +4 -1
  140. data/lib/vedeu/support/terminal.rb +10 -10
  141. data/lib/vedeu/support/trace.rb +15 -88
  142. data/lib/vedeu/support/visibility.rb +73 -0
  143. data/lib/vedeu.rb +37 -0
  144. data/test/lib/vedeu/api_test.rb +7 -3
  145. data/test/lib/vedeu/application_test.rb +9 -3
  146. data/test/lib/vedeu/bindings_test.rb +21 -0
  147. data/test/lib/vedeu/buffers/buffer_test.rb +110 -134
  148. data/test/lib/vedeu/buffers/display_buffer_test.rb +8 -0
  149. data/test/lib/vedeu/configuration/api_test.rb +5 -1
  150. data/test/lib/vedeu/configuration/configuration_test.rb +4 -6
  151. data/test/lib/vedeu/cursor/cursor_test.rb +25 -17
  152. data/test/lib/vedeu/cursor/move_test.rb +7 -7
  153. data/test/lib/vedeu/distributed/client_test.rb +1 -1
  154. data/test/lib/vedeu/distributed/subprocess_test.rb +3 -1
  155. data/test/lib/vedeu/distributed/uri_test.rb +5 -5
  156. data/test/lib/vedeu/dsl/components/geometry_test.rb +43 -0
  157. data/test/lib/vedeu/dsl/components/keymap_test.rb +1 -1
  158. data/test/lib/vedeu/dsl/composition_test.rb +6 -5
  159. data/test/lib/vedeu/dsl/interface_test.rb +81 -16
  160. data/test/lib/vedeu/dsl/shared/colour_test.rb +4 -4
  161. data/test/lib/vedeu/dsl/shared/text_test.rb +87 -9
  162. data/test/lib/vedeu/dsl/stream_test.rb +1 -1
  163. data/test/lib/vedeu/events/event_test.rb +3 -1
  164. data/test/lib/vedeu/events/trigger_test.rb +8 -4
  165. data/test/lib/vedeu/geometry/dimension_test.rb +1 -1
  166. data/test/lib/vedeu/geometry/geometry_test.rb +5 -3
  167. data/test/lib/vedeu/geometry/index_position_test.rb +30 -7
  168. data/test/lib/vedeu/geometry/null_geometry_test.rb +57 -0
  169. data/test/lib/vedeu/geometry/position_index_test.rb +14 -0
  170. data/test/lib/vedeu/geometry/position_validator_test.rb +17 -3
  171. data/test/lib/vedeu/input/keymap_test.rb +3 -1
  172. data/test/lib/vedeu/input/mapper_test.rb +8 -4
  173. data/test/lib/vedeu/launcher_test.rb +1 -1
  174. data/test/lib/vedeu/models/cell_test.rb +10 -8
  175. data/test/lib/vedeu/models/char_test.rb +52 -28
  176. data/test/lib/vedeu/models/composition_test.rb +26 -4
  177. data/test/lib/vedeu/models/group_test.rb +11 -5
  178. data/test/lib/vedeu/models/interface_test.rb +32 -19
  179. data/test/lib/vedeu/models/line_test.rb +21 -25
  180. data/test/lib/vedeu/models/menu_test.rb +10 -6
  181. data/test/lib/vedeu/models/null_test.rb +66 -0
  182. data/test/lib/vedeu/models/stream_test.rb +13 -10
  183. data/test/lib/vedeu/output/border_test.rb +29 -8
  184. data/test/lib/vedeu/output/clear_test.rb +23 -4
  185. data/test/lib/vedeu/output/colour_test.rb +20 -4
  186. data/test/lib/vedeu/output/compressor_test.rb +43 -0
  187. data/test/lib/vedeu/output/html_char_test.rb +29 -17
  188. data/test/lib/vedeu/output/null_border_test.rb +2 -1
  189. data/test/lib/vedeu/output/output_test.rb +20 -30
  190. data/test/lib/vedeu/output/presentation_test.rb +39 -16
  191. data/test/lib/vedeu/output/refresh_test.rb +14 -10
  192. data/test/lib/vedeu/output/renderers/all_test.rb +96 -0
  193. data/test/lib/vedeu/output/renderers/file_renderer_test.rb +1 -1
  194. data/test/lib/vedeu/output/renderers/html_renderer_test.rb +13 -9
  195. data/test/lib/vedeu/output/renderers/json_renderer_test.rb +52 -0
  196. data/test/lib/vedeu/output/renderers/null_renderer_test.rb +19 -0
  197. data/test/lib/vedeu/output/style_test.rb +41 -1
  198. data/test/lib/vedeu/output/text_test.rb +61 -10
  199. data/test/lib/vedeu/output/translator_test.rb +14 -0
  200. data/test/lib/vedeu/output/viewport_test.rb +22 -3
  201. data/test/lib/vedeu/output/virtual_terminal_test.rb +3 -3
  202. data/test/lib/vedeu/output/wordwrap_test.rb +58 -45
  203. data/test/lib/vedeu/repositories/collections/chars_test.rb +16 -0
  204. data/test/lib/vedeu/repositories/collections/events_test.rb +16 -0
  205. data/test/lib/vedeu/repositories/collections/interfaces_test.rb +16 -0
  206. data/test/lib/vedeu/repositories/collections/keys_test.rb +16 -0
  207. data/test/lib/vedeu/repositories/collections/lines_test.rb +16 -0
  208. data/test/lib/vedeu/repositories/collections/streams_test.rb +16 -0
  209. data/test/lib/vedeu/repositories/repositories/background_colours_test.rb +17 -0
  210. data/test/lib/vedeu/repositories/repositories/borders_test.rb +51 -0
  211. data/test/lib/vedeu/repositories/repositories/buffers_test.rb +52 -0
  212. data/test/lib/vedeu/repositories/repositories/colours_test.rb +16 -0
  213. data/test/lib/vedeu/repositories/repositories/cursors_test.rb +39 -0
  214. data/test/lib/vedeu/repositories/repositories/events_repository_test.rb +17 -0
  215. data/test/lib/vedeu/repositories/repositories/foreground_colours_test.rb +17 -0
  216. data/test/lib/vedeu/repositories/repositories/geometries_test.rb +42 -0
  217. data/test/lib/vedeu/repositories/repositories/groups_test.rb +17 -0
  218. data/test/lib/vedeu/repositories/repositories/interfaces_repositories_test.rb +17 -0
  219. data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +17 -0
  220. data/test/lib/vedeu/repositories/repositories/menus_test.rb +17 -0
  221. data/test/lib/vedeu/repositories/repository_test.rb +16 -36
  222. data/test/lib/vedeu/storage/associative_store_test.rb +69 -0
  223. data/test/lib/vedeu/storage/conveyor_store_test.rb +135 -0
  224. data/test/lib/vedeu/storage/fifo_store_test.rb +47 -0
  225. data/test/lib/vedeu/storage/store_test.rb +123 -0
  226. data/test/lib/vedeu/support/common_test.rb +0 -9
  227. data/test/lib/vedeu/support/terminal_test.rb +78 -55
  228. data/test/lib/vedeu/support/visibility_test.rb +80 -0
  229. data/test/test_helper.rb +13 -11
  230. data/vedeu.gemspec +4 -3
  231. metadata +92 -32
  232. data/lib/vedeu/cursor/toggle.rb +0 -55
  233. data/lib/vedeu/exceptions.rb +0 -37
  234. data/lib/vedeu/geometry/centre.rb +0 -85
  235. data/lib/vedeu/geometry/content.rb +0 -70
  236. data/lib/vedeu/geometry/limit.rb +0 -58
  237. data/lib/vedeu/output/compositor.rb +0 -62
  238. data/lib/vedeu/repositories/collections.rb +0 -41
  239. data/lib/vedeu/support/coercions.rb +0 -60
  240. data/lib/vedeu/support/sentence.rb +0 -91
  241. data/lib/vedeu/support/visible.rb +0 -90
  242. data/test/lib/vedeu/cursor/toggle_test.rb +0 -63
  243. data/test/lib/vedeu/geometry/centre_test.rb +0 -58
  244. data/test/lib/vedeu/geometry/content_test.rb +0 -98
  245. data/test/lib/vedeu/geometry/limit_test.rb +0 -30
  246. data/test/lib/vedeu/output/compositor_test.rb +0 -48
  247. data/test/lib/vedeu/repositories/all_test.rb +0 -135
  248. data/test/lib/vedeu/repositories/collections_test.rb +0 -71
  249. data/test/lib/vedeu/support/coercions_test.rb +0 -84
  250. data/test/lib/vedeu/support/sentence_test.rb +0 -56
  251. data/test/lib/vedeu/support/visible_test.rb +0 -161
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.13
4
+ version: 0.4.14
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-04-07 00:00:00.000000000 Z
11
+ date: 2015-04-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -305,6 +305,7 @@ files:
305
305
  - examples/geometry_app.rb
306
306
  - examples/hello_world.rb
307
307
  - examples/lines_app.rb
308
+ - examples/material_colours_app.rb
308
309
  - examples/typed_commands/command.erb
309
310
  - examples/typed_commands/output.erb
310
311
  - examples/typed_commands/status.erb
@@ -330,7 +331,6 @@ files:
330
331
  - lib/vedeu/cursor/cursor.rb
331
332
  - lib/vedeu/cursor/move.rb
332
333
  - lib/vedeu/cursor/refresh_cursor.rb
333
- - lib/vedeu/cursor/toggle.rb
334
334
  - lib/vedeu/debug.rb
335
335
  - lib/vedeu/distributed/all.rb
336
336
  - lib/vedeu/distributed/client.rb
@@ -367,18 +367,15 @@ files:
367
367
  - lib/vedeu/events/all.rb
368
368
  - lib/vedeu/events/event.rb
369
369
  - lib/vedeu/events/trigger.rb
370
- - lib/vedeu/exceptions.rb
371
370
  - lib/vedeu/geometry/all.rb
372
371
  - lib/vedeu/geometry/area.rb
373
372
  - lib/vedeu/geometry/canvas.rb
374
- - lib/vedeu/geometry/centre.rb
375
- - lib/vedeu/geometry/content.rb
376
373
  - lib/vedeu/geometry/coordinate.rb
377
374
  - lib/vedeu/geometry/dimension.rb
378
375
  - lib/vedeu/geometry/geometry.rb
379
376
  - lib/vedeu/geometry/grid.rb
380
377
  - lib/vedeu/geometry/index_position.rb
381
- - lib/vedeu/geometry/limit.rb
378
+ - lib/vedeu/geometry/null_geometry.rb
382
379
  - lib/vedeu/geometry/position.rb
383
380
  - lib/vedeu/geometry/position_index.rb
384
381
  - lib/vedeu/geometry/position_validator.rb
@@ -398,13 +395,14 @@ files:
398
395
  - lib/vedeu/models/interface.rb
399
396
  - lib/vedeu/models/line.rb
400
397
  - lib/vedeu/models/menu.rb
398
+ - lib/vedeu/models/null.rb
401
399
  - lib/vedeu/models/stream.rb
402
400
  - lib/vedeu/output/all.rb
403
401
  - lib/vedeu/output/background.rb
404
402
  - lib/vedeu/output/border.rb
405
403
  - lib/vedeu/output/clear.rb
406
404
  - lib/vedeu/output/colour.rb
407
- - lib/vedeu/output/compositor.rb
405
+ - lib/vedeu/output/compressor.rb
408
406
  - lib/vedeu/output/esc.rb
409
407
  - lib/vedeu/output/foreground.rb
410
408
  - lib/vedeu/output/html_char.rb
@@ -415,6 +413,8 @@ files:
415
413
  - lib/vedeu/output/renderers/all.rb
416
414
  - lib/vedeu/output/renderers/file_renderer.rb
417
415
  - lib/vedeu/output/renderers/html_renderer.rb
416
+ - lib/vedeu/output/renderers/json_renderer.rb
417
+ - lib/vedeu/output/renderers/null_renderer.rb
418
418
  - lib/vedeu/output/renderers/terminal_renderer.rb
419
419
  - lib/vedeu/output/style.rb
420
420
  - lib/vedeu/output/templates/html_renderer.vedeu
@@ -426,18 +426,40 @@ files:
426
426
  - lib/vedeu/output/wordwrap.rb
427
427
  - lib/vedeu/repositories/all.rb
428
428
  - lib/vedeu/repositories/collection.rb
429
- - lib/vedeu/repositories/collections.rb
429
+ - lib/vedeu/repositories/collections/all.rb
430
+ - lib/vedeu/repositories/collections/chars.rb
431
+ - lib/vedeu/repositories/collections/events.rb
432
+ - lib/vedeu/repositories/collections/interfaces.rb
433
+ - lib/vedeu/repositories/collections/keys.rb
434
+ - lib/vedeu/repositories/collections/lines.rb
435
+ - lib/vedeu/repositories/collections/streams.rb
430
436
  - lib/vedeu/repositories/model.rb
437
+ - lib/vedeu/repositories/repositories/all.rb
438
+ - lib/vedeu/repositories/repositories/background_colours.rb
439
+ - lib/vedeu/repositories/repositories/borders.rb
440
+ - lib/vedeu/repositories/repositories/buffers.rb
441
+ - lib/vedeu/repositories/repositories/colours.rb
442
+ - lib/vedeu/repositories/repositories/cursors.rb
443
+ - lib/vedeu/repositories/repositories/events_repository.rb
444
+ - lib/vedeu/repositories/repositories/foreground_colours.rb
445
+ - lib/vedeu/repositories/repositories/geometries.rb
446
+ - lib/vedeu/repositories/repositories/groups.rb
447
+ - lib/vedeu/repositories/repositories/interfaces_repository.rb
448
+ - lib/vedeu/repositories/repositories/keymaps.rb
449
+ - lib/vedeu/repositories/repositories/menus.rb
431
450
  - lib/vedeu/repositories/repository.rb
451
+ - lib/vedeu/storage/all.rb
452
+ - lib/vedeu/storage/associative_store.rb
453
+ - lib/vedeu/storage/conveyor_store.rb
454
+ - lib/vedeu/storage/fifo_store.rb
455
+ - lib/vedeu/storage/store.rb
432
456
  - lib/vedeu/support/all.rb
433
- - lib/vedeu/support/coercions.rb
434
457
  - lib/vedeu/support/common.rb
435
458
  - lib/vedeu/support/log.rb
436
- - lib/vedeu/support/sentence.rb
437
459
  - lib/vedeu/support/template.rb
438
460
  - lib/vedeu/support/terminal.rb
439
461
  - lib/vedeu/support/trace.rb
440
- - lib/vedeu/support/visible.rb
462
+ - lib/vedeu/support/visibility.rb
441
463
  - lib/vedeu/traps.rb
442
464
  - logs/.gitkeep
443
465
  - test/lib/vedeu/api_test.rb
@@ -451,7 +473,6 @@ files:
451
473
  - test/lib/vedeu/cursor/cursor_test.rb
452
474
  - test/lib/vedeu/cursor/move_test.rb
453
475
  - test/lib/vedeu/cursor/refresh_cursor_test.rb
454
- - test/lib/vedeu/cursor/toggle_test.rb
455
476
  - test/lib/vedeu/distributed/client_test.rb
456
477
  - test/lib/vedeu/distributed/server_test.rb
457
478
  - test/lib/vedeu/distributed/subprocess_test.rb
@@ -475,14 +496,12 @@ files:
475
496
  - test/lib/vedeu/events/trigger_test.rb
476
497
  - test/lib/vedeu/geometry/area_test.rb
477
498
  - test/lib/vedeu/geometry/canvas_test.rb
478
- - test/lib/vedeu/geometry/centre_test.rb
479
- - test/lib/vedeu/geometry/content_test.rb
480
499
  - test/lib/vedeu/geometry/coordinate_test.rb
481
500
  - test/lib/vedeu/geometry/dimension_test.rb
482
501
  - test/lib/vedeu/geometry/geometry_test.rb
483
502
  - test/lib/vedeu/geometry/grid_test.rb
484
503
  - test/lib/vedeu/geometry/index_position_test.rb
485
- - test/lib/vedeu/geometry/limit_test.rb
504
+ - test/lib/vedeu/geometry/null_geometry_test.rb
486
505
  - test/lib/vedeu/geometry/position_index_test.rb
487
506
  - test/lib/vedeu/geometry/position_test.rb
488
507
  - test/lib/vedeu/geometry/position_validator_test.rb
@@ -500,12 +519,13 @@ files:
500
519
  - test/lib/vedeu/models/interface_test.rb
501
520
  - test/lib/vedeu/models/line_test.rb
502
521
  - test/lib/vedeu/models/menu_test.rb
522
+ - test/lib/vedeu/models/null_test.rb
503
523
  - test/lib/vedeu/models/stream_test.rb
504
524
  - test/lib/vedeu/output/background_test.rb
505
525
  - test/lib/vedeu/output/border_test.rb
506
526
  - test/lib/vedeu/output/clear_test.rb
507
527
  - test/lib/vedeu/output/colour_test.rb
508
- - test/lib/vedeu/output/compositor_test.rb
528
+ - test/lib/vedeu/output/compressor_test.rb
509
529
  - test/lib/vedeu/output/esc_test.rb
510
530
  - test/lib/vedeu/output/foreground_test.rb
511
531
  - test/lib/vedeu/output/html_char_test.rb
@@ -513,8 +533,11 @@ files:
513
533
  - test/lib/vedeu/output/output_test.rb
514
534
  - test/lib/vedeu/output/presentation_test.rb
515
535
  - test/lib/vedeu/output/refresh_test.rb
536
+ - test/lib/vedeu/output/renderers/all_test.rb
516
537
  - test/lib/vedeu/output/renderers/file_renderer_test.rb
517
538
  - test/lib/vedeu/output/renderers/html_renderer_test.rb
539
+ - test/lib/vedeu/output/renderers/json_renderer_test.rb
540
+ - test/lib/vedeu/output/renderers/null_renderer_test.rb
518
541
  - test/lib/vedeu/output/renderers/terminal_renderer_test.rb
519
542
  - test/lib/vedeu/output/style_test.rb
520
543
  - test/lib/vedeu/output/text_test.rb
@@ -523,19 +546,37 @@ files:
523
546
  - test/lib/vedeu/output/virtual_buffer_test.rb
524
547
  - test/lib/vedeu/output/virtual_terminal_test.rb
525
548
  - test/lib/vedeu/output/wordwrap_test.rb
526
- - test/lib/vedeu/repositories/all_test.rb
527
549
  - test/lib/vedeu/repositories/collection_test.rb
528
- - test/lib/vedeu/repositories/collections_test.rb
550
+ - test/lib/vedeu/repositories/collections/chars_test.rb
551
+ - test/lib/vedeu/repositories/collections/events_test.rb
552
+ - test/lib/vedeu/repositories/collections/interfaces_test.rb
553
+ - test/lib/vedeu/repositories/collections/keys_test.rb
554
+ - test/lib/vedeu/repositories/collections/lines_test.rb
555
+ - test/lib/vedeu/repositories/collections/streams_test.rb
529
556
  - test/lib/vedeu/repositories/model_test.rb
557
+ - test/lib/vedeu/repositories/repositories/background_colours_test.rb
558
+ - test/lib/vedeu/repositories/repositories/borders_test.rb
559
+ - test/lib/vedeu/repositories/repositories/buffers_test.rb
560
+ - test/lib/vedeu/repositories/repositories/colours_test.rb
561
+ - test/lib/vedeu/repositories/repositories/cursors_test.rb
562
+ - test/lib/vedeu/repositories/repositories/events_repository_test.rb
563
+ - test/lib/vedeu/repositories/repositories/foreground_colours_test.rb
564
+ - test/lib/vedeu/repositories/repositories/geometries_test.rb
565
+ - test/lib/vedeu/repositories/repositories/groups_test.rb
566
+ - test/lib/vedeu/repositories/repositories/interfaces_repositories_test.rb
567
+ - test/lib/vedeu/repositories/repositories/keymaps_test.rb
568
+ - test/lib/vedeu/repositories/repositories/menus_test.rb
530
569
  - test/lib/vedeu/repositories/repository_test.rb
531
- - test/lib/vedeu/support/coercions_test.rb
570
+ - test/lib/vedeu/storage/associative_store_test.rb
571
+ - test/lib/vedeu/storage/conveyor_store_test.rb
572
+ - test/lib/vedeu/storage/fifo_store_test.rb
573
+ - test/lib/vedeu/storage/store_test.rb
532
574
  - test/lib/vedeu/support/common_test.rb
533
575
  - test/lib/vedeu/support/log_test.rb
534
- - test/lib/vedeu/support/sentence_test.rb
535
576
  - test/lib/vedeu/support/template_test.rb
536
577
  - test/lib/vedeu/support/terminal_test.rb
537
578
  - test/lib/vedeu/support/trace_test.rb
538
- - test/lib/vedeu/support/visible_test.rb
579
+ - test/lib/vedeu/support/visibility_test.rb
539
580
  - test/lib/vedeu/traps_test.rb
540
581
  - test/lib/vedeu_test.rb
541
582
  - test/support/colour_test.sh
@@ -586,7 +627,6 @@ test_files:
586
627
  - test/lib/vedeu/cursor/cursor_test.rb
587
628
  - test/lib/vedeu/cursor/move_test.rb
588
629
  - test/lib/vedeu/cursor/refresh_cursor_test.rb
589
- - test/lib/vedeu/cursor/toggle_test.rb
590
630
  - test/lib/vedeu/distributed/client_test.rb
591
631
  - test/lib/vedeu/distributed/server_test.rb
592
632
  - test/lib/vedeu/distributed/subprocess_test.rb
@@ -610,14 +650,12 @@ test_files:
610
650
  - test/lib/vedeu/events/trigger_test.rb
611
651
  - test/lib/vedeu/geometry/area_test.rb
612
652
  - test/lib/vedeu/geometry/canvas_test.rb
613
- - test/lib/vedeu/geometry/centre_test.rb
614
- - test/lib/vedeu/geometry/content_test.rb
615
653
  - test/lib/vedeu/geometry/coordinate_test.rb
616
654
  - test/lib/vedeu/geometry/dimension_test.rb
617
655
  - test/lib/vedeu/geometry/geometry_test.rb
618
656
  - test/lib/vedeu/geometry/grid_test.rb
619
657
  - test/lib/vedeu/geometry/index_position_test.rb
620
- - test/lib/vedeu/geometry/limit_test.rb
658
+ - test/lib/vedeu/geometry/null_geometry_test.rb
621
659
  - test/lib/vedeu/geometry/position_index_test.rb
622
660
  - test/lib/vedeu/geometry/position_test.rb
623
661
  - test/lib/vedeu/geometry/position_validator_test.rb
@@ -635,12 +673,13 @@ test_files:
635
673
  - test/lib/vedeu/models/interface_test.rb
636
674
  - test/lib/vedeu/models/line_test.rb
637
675
  - test/lib/vedeu/models/menu_test.rb
676
+ - test/lib/vedeu/models/null_test.rb
638
677
  - test/lib/vedeu/models/stream_test.rb
639
678
  - test/lib/vedeu/output/background_test.rb
640
679
  - test/lib/vedeu/output/border_test.rb
641
680
  - test/lib/vedeu/output/clear_test.rb
642
681
  - test/lib/vedeu/output/colour_test.rb
643
- - test/lib/vedeu/output/compositor_test.rb
682
+ - test/lib/vedeu/output/compressor_test.rb
644
683
  - test/lib/vedeu/output/esc_test.rb
645
684
  - test/lib/vedeu/output/foreground_test.rb
646
685
  - test/lib/vedeu/output/html_char_test.rb
@@ -648,8 +687,11 @@ test_files:
648
687
  - test/lib/vedeu/output/output_test.rb
649
688
  - test/lib/vedeu/output/presentation_test.rb
650
689
  - test/lib/vedeu/output/refresh_test.rb
690
+ - test/lib/vedeu/output/renderers/all_test.rb
651
691
  - test/lib/vedeu/output/renderers/file_renderer_test.rb
652
692
  - test/lib/vedeu/output/renderers/html_renderer_test.rb
693
+ - test/lib/vedeu/output/renderers/json_renderer_test.rb
694
+ - test/lib/vedeu/output/renderers/null_renderer_test.rb
653
695
  - test/lib/vedeu/output/renderers/terminal_renderer_test.rb
654
696
  - test/lib/vedeu/output/style_test.rb
655
697
  - test/lib/vedeu/output/text_test.rb
@@ -658,19 +700,37 @@ test_files:
658
700
  - test/lib/vedeu/output/virtual_buffer_test.rb
659
701
  - test/lib/vedeu/output/virtual_terminal_test.rb
660
702
  - test/lib/vedeu/output/wordwrap_test.rb
661
- - test/lib/vedeu/repositories/all_test.rb
662
703
  - test/lib/vedeu/repositories/collection_test.rb
663
- - test/lib/vedeu/repositories/collections_test.rb
704
+ - test/lib/vedeu/repositories/collections/chars_test.rb
705
+ - test/lib/vedeu/repositories/collections/events_test.rb
706
+ - test/lib/vedeu/repositories/collections/interfaces_test.rb
707
+ - test/lib/vedeu/repositories/collections/keys_test.rb
708
+ - test/lib/vedeu/repositories/collections/lines_test.rb
709
+ - test/lib/vedeu/repositories/collections/streams_test.rb
664
710
  - test/lib/vedeu/repositories/model_test.rb
711
+ - test/lib/vedeu/repositories/repositories/background_colours_test.rb
712
+ - test/lib/vedeu/repositories/repositories/borders_test.rb
713
+ - test/lib/vedeu/repositories/repositories/buffers_test.rb
714
+ - test/lib/vedeu/repositories/repositories/colours_test.rb
715
+ - test/lib/vedeu/repositories/repositories/cursors_test.rb
716
+ - test/lib/vedeu/repositories/repositories/events_repository_test.rb
717
+ - test/lib/vedeu/repositories/repositories/foreground_colours_test.rb
718
+ - test/lib/vedeu/repositories/repositories/geometries_test.rb
719
+ - test/lib/vedeu/repositories/repositories/groups_test.rb
720
+ - test/lib/vedeu/repositories/repositories/interfaces_repositories_test.rb
721
+ - test/lib/vedeu/repositories/repositories/keymaps_test.rb
722
+ - test/lib/vedeu/repositories/repositories/menus_test.rb
665
723
  - test/lib/vedeu/repositories/repository_test.rb
666
- - test/lib/vedeu/support/coercions_test.rb
724
+ - test/lib/vedeu/storage/associative_store_test.rb
725
+ - test/lib/vedeu/storage/conveyor_store_test.rb
726
+ - test/lib/vedeu/storage/fifo_store_test.rb
727
+ - test/lib/vedeu/storage/store_test.rb
667
728
  - test/lib/vedeu/support/common_test.rb
668
729
  - test/lib/vedeu/support/log_test.rb
669
- - test/lib/vedeu/support/sentence_test.rb
670
730
  - test/lib/vedeu/support/template_test.rb
671
731
  - test/lib/vedeu/support/terminal_test.rb
672
732
  - test/lib/vedeu/support/trace_test.rb
673
- - test/lib/vedeu/support/visible_test.rb
733
+ - test/lib/vedeu/support/visibility_test.rb
674
734
  - test/lib/vedeu/traps_test.rb
675
735
  - test/lib/vedeu_test.rb
676
736
  - test/support/colour_test.sh
@@ -1,55 +0,0 @@
1
- module Vedeu
2
-
3
- # Adjusts the visibility of the cursor.
4
- #
5
- class Toggle
6
-
7
- # Returns an instance of Vedeu::Toggle.
8
- #
9
- # @param cursor [Cursor]
10
- # @return [Toggle]
11
- def initialize(cursor)
12
- @cursor = cursor
13
- end
14
-
15
- # Hides the cursor.
16
- #
17
- # @param (see #initialize)
18
- def self.hide(cursor)
19
- return cursor if cursor.invisible?
20
-
21
- new(cursor).hide
22
- end
23
-
24
- # Shows the cursor.
25
- #
26
- # @param (see #initialize)
27
- def self.show(cursor)
28
- return cursor if cursor.visible?
29
-
30
- new(cursor).show
31
- end
32
-
33
- # Hides the cursor.
34
- #
35
- # @return [Cursor]
36
- def hide
37
- cursor.class.new(cursor.attributes.merge!({ state: false })).store
38
- end
39
-
40
- # Shows the cursor.
41
- #
42
- # @return [Cursor]
43
- def show
44
- cursor.class.new(cursor.attributes.merge!({ state: true })).store
45
- end
46
-
47
- private
48
-
49
- # @!attribute [r] cursor
50
- # @return [Vedeu::Cursor]
51
- attr_reader :cursor
52
-
53
- end # Toggle
54
-
55
- end # Vedeu
@@ -1,37 +0,0 @@
1
- module Vedeu
2
-
3
- # ModelNotFound: Raised with Vedeu attempts to access a named model that does
4
- # not exist.
5
- #
6
- # InvalidSyntax: Raised when Vedeu attempts to parse a {Vedeu.view} or
7
- # {Vedeu.interface} and encounters a problem.
8
- #
9
- # MissingRequired: Raised when a name is not provided for a model when
10
- # attempting to store it in a repository.
11
- #
12
- # ModeSwitch: Raised intentionally when the client application wishes to
13
- # switch between cooked and raw (or vice versa) terminal modes. Vedeu is
14
- # hard-wired to use the `Escape` key to trigger this change for the time
15
- # being.
16
- #
17
- # NotImplemented: Raised to remind me (or client application developers) that
18
- # the subclass implements the functionality sought.
19
- #
20
- # OutOfRange: Raised when trying to access an interface column less than 1 or
21
- # greater than 12. Vedeu is hard-wired to a 12-column layout for the time
22
- # being.
23
- #
24
- # VedeuInterrupt: Raised when Vedeu wishes to exit.
25
- #
26
- Exceptions = %w[
27
- ModelNotFound
28
- InvalidSyntax
29
- MissingRequired
30
- ModeSwitch
31
- NotImplemented
32
- OutOfRange
33
- VedeuInterrupt
34
- ]
35
- Exceptions.each { |e| const_set(e, Class.new(StandardError)) }
36
-
37
- end # Vedeu
@@ -1,85 +0,0 @@
1
- module Vedeu
2
-
3
- # Return the centre character position for a value (width or height), or
4
- # starting and ending coordinate.
5
- #
6
- # @example
7
- # Vedeu::Centre.for_value(27) # => 13
8
- #
9
- # Vedeu::Centre.for_points(3, 17) # => 10
10
- #
11
- # @note
12
- # If initialized with a `:value` in the attributes, then :v and :vn are
13
- # ignored.
14
- #
15
- class Centre
16
-
17
- # @param value [Fixnum] A width of height.
18
- # @return [Fixnum]
19
- def self.for_value(value)
20
- new({ value: value }).centre
21
- end
22
-
23
- # @param v [Fixnum] The starting coordinate value.
24
- # @param vn [Fixnum] The ending coordinate value.
25
- # @return [Fixnum]
26
- def self.for_points(v, vn)
27
- new({ v: v, vn: vn }).centre
28
- end
29
-
30
- # Returns a new instance of Vedeu::Centre.
31
- #
32
- # @param attributes [Hash<Symbol => Fixnum>]
33
- # @option attributes v [Fixnum] The starting coordinate value.
34
- # @option attributes vn [Fixnum] The ending coordinate value.
35
- # @option attributes value [Fixnum] A width of height.
36
- # @return [Vedeu::Centre]
37
- def initialize(attributes = {})
38
- @v = attributes[:v]
39
- @vn = attributes[:vn]
40
- @value = attributes[:value]
41
- end
42
-
43
- # @raise [InvalidSyntax] When :v or :vn is missing, or :vn is less than :v.
44
- # @return [Fixnum]
45
- def centre
46
- if value
47
- value / 2
48
-
49
- else
50
- v + (v_vn / 2)
51
-
52
- end
53
- end
54
-
55
- private
56
-
57
- # @!attribute [r] v
58
- # @return [Fixnum]
59
- attr_reader :v
60
-
61
- # @!attribute [r] vn
62
- # @return [Fixnum]
63
- attr_reader :vn
64
-
65
- # @!attribute [r] value
66
- # @return [Fixnum]
67
- attr_reader :value
68
-
69
- # @return [Fixnum]
70
- def v_vn
71
- if vn.nil? || v.nil?
72
- fail InvalidSyntax, 'Missing values for :v, :vn.'
73
-
74
- elsif vn < v
75
- fail InvalidSyntax, "Values invalid for :v (#{v}), :vn (#{vn})."
76
-
77
- else
78
- vn - v
79
-
80
- end
81
- end
82
-
83
- end # Centre
84
-
85
- end # Vedeu
@@ -1,70 +0,0 @@
1
- module Vedeu
2
-
3
- # Provides information about the content within an interface or view.
4
- #
5
- class Content
6
-
7
- extend Forwardable
8
-
9
- def_delegators :interface,
10
- :lines?,
11
- :lines,
12
- :geometry
13
-
14
- def_delegators :geometry,
15
- :height,
16
- :width,
17
- :x,
18
- :y
19
-
20
- # Returns a new instance of Vedeu::Content.
21
- #
22
- # @param interface [Vedeu::Interface]
23
- # @return [Vedeu::Content]
24
- def initialize(interface)
25
- @interface = interface
26
- end
27
-
28
- # Returns the height of the content, or when no content, the visible height
29
- # of the interface.
30
- #
31
- # @return [Fixnum]
32
- def yn
33
- [rows, height].max
34
- end
35
-
36
- # Returns the width of the content, or when no content, the visible width of
37
- # the interface.
38
- #
39
- # @return [Fixnum]
40
- def xn
41
- [columns, width].max
42
- end
43
-
44
- private
45
-
46
- # @!attribute [r] interface
47
- # @return [Vedeu::Interface]
48
- attr_reader :interface
49
-
50
- # Returns the number of lines of content for this interface.
51
- #
52
- # @return [Fixnum]
53
- def rows
54
- return height unless lines?
55
-
56
- lines.size
57
- end
58
-
59
- # Returns the character length of the longest line for this interface.
60
- #
61
- # @return [Fixnum]
62
- def columns
63
- return width unless lines?
64
-
65
- lines.map { |line| line.size }.max
66
- end
67
-
68
- end # Content
69
-
70
- end # Vedeu
@@ -1,58 +0,0 @@
1
- module Vedeu
2
-
3
- # Forces the value within defined limits.
4
- #
5
- class Limit
6
-
7
- # @param (see #initialize)
8
- def self.apply(v, vn, max, min = 1)
9
- new(v, vn, max, min).apply
10
- end
11
-
12
- # Returns a new instance of Vedeu::Limit.
13
- #
14
- # @param v [Fixnum]
15
- # @param vn [Fixnum]
16
- # @param max [Fixnum]
17
- # @param min [Fixnum]
18
- # @return [Vedeu::Limit]
19
- def initialize(v, vn, max, min = 1)
20
- @v = v
21
- @vn = vn
22
- @max = max
23
- @min = min || 1
24
- end
25
-
26
- # @return [Fixnum]
27
- def apply
28
- if (v + vn) > max
29
- applied = vn - ((v + vn) - max)
30
- return applied < min ? min : applied
31
-
32
- else
33
- vn
34
-
35
- end
36
- end
37
-
38
- private
39
-
40
- # @!attribute [r] v
41
- # @return [Fixnum]
42
- attr_reader :v
43
-
44
- # @!attribute [r] vn
45
- # @return [Fixnum]
46
- attr_reader :vn
47
-
48
- # @!attribute [r] min
49
- # @return [Fixnum]
50
- attr_reader :min
51
-
52
- # @!attribute [r] max
53
- # @return [Fixnum]
54
- attr_reader :max
55
-
56
- end # Limit
57
-
58
- end # Vedeu
@@ -1,62 +0,0 @@
1
- module Vedeu
2
-
3
- # Before the content of the buffer can be output to the terminal, if there are
4
- # any changes to the geometry of the interface (stored in the buffer), then
5
- # these need to be stored; replacing those already stored. This is our last
6
- # chance to do this as the terminal may have resized, or the client
7
- # application may have specified this this view should move to a new location.
8
-
9
- # Combines stored interface layout/geometry with an interface view/buffer
10
- # to create a single view to be sent to the terminal for output.
11
- #
12
- class Compositor
13
-
14
- # Convenience method to initialize a new Compositor and call its {#compose}
15
- # method.
16
- #
17
- # @return [Compositor]
18
- # @see #initialize
19
- def self.compose(name)
20
- new(name).compose
21
- end
22
-
23
- # Initialize a new Vedeu::Compositor.
24
- #
25
- # @param name [String] The name of the buffer.
26
- # @return [Compositor]
27
- def initialize(name)
28
- @name = name
29
- end
30
-
31
- # Applies any overridden colours or styles in the buffered view to the
32
- # stored interface.
33
- #
34
- # @return [Array<Interface>]
35
- def compose
36
- buffer.each do |view|
37
- view.colour = interface.colour unless view.colour
38
- view.style = interface.style unless view.style
39
-
40
- Vedeu::Output.render(view)
41
- end
42
- end
43
-
44
- private
45
-
46
- # @!attribute [r] name
47
- # @return [String]
48
- attr_reader :name
49
-
50
- # @return [Vedeu::Interface]
51
- def buffer
52
- Vedeu.buffers.find(name).content
53
- end
54
-
55
- # @return [Vedeu::Interface]
56
- def interface
57
- @interface ||= Vedeu.interfaces.find(name)
58
- end
59
-
60
- end # Compositor
61
-
62
- end # Vedeu