vedeu 0.6.7 → 0.6.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE.txt +1 -1
  3. data/docs/dsl.md +4 -4
  4. data/lib/vedeu/all.rb +6 -18
  5. data/lib/vedeu/api.rb +14 -13
  6. data/lib/vedeu/bindings/system.rb +5 -4
  7. data/lib/vedeu/buffers/virtual_buffer.rb +13 -11
  8. data/lib/vedeu/configuration/api.rb +4 -3
  9. data/lib/vedeu/cursors/cursor.rb +23 -18
  10. data/lib/vedeu/distributed/client.rb +11 -6
  11. data/lib/vedeu/distributed/server.rb +4 -3
  12. data/lib/vedeu/dsl/keymap.rb +6 -6
  13. data/lib/vedeu/editor/all.rb +19 -0
  14. data/lib/vedeu/{input/editor → editor}/capture.rb +1 -1
  15. data/lib/vedeu/{input/editor → editor}/cropper.rb +0 -0
  16. data/lib/vedeu/{input/editor → editor}/cursor.rb +0 -0
  17. data/lib/vedeu/{input/editor → editor}/document.rb +0 -0
  18. data/lib/vedeu/{input/editor → editor}/documents.rb +0 -0
  19. data/lib/vedeu/{input/editor → editor}/editor.rb +0 -0
  20. data/lib/vedeu/{input/editor → editor}/insert.rb +0 -0
  21. data/lib/vedeu/{input/editor → editor}/line.rb +0 -0
  22. data/lib/vedeu/{input/editor → editor}/lines.rb +0 -0
  23. data/lib/vedeu/error.rb +21 -18
  24. data/lib/vedeu/esc/borders.rb +6 -4
  25. data/lib/vedeu/esc/colours.rb +13 -12
  26. data/lib/vedeu/esc/esc.rb +11 -10
  27. data/lib/vedeu/input/all.rb +15 -0
  28. data/lib/vedeu/input/input.rb +55 -52
  29. data/lib/vedeu/input/key.rb +36 -30
  30. data/lib/vedeu/input/keymap.rb +101 -92
  31. data/lib/vedeu/input/keymaps.rb +10 -6
  32. data/lib/vedeu/input/keys.rb +8 -4
  33. data/lib/vedeu/input/mapper.rb +125 -121
  34. data/lib/vedeu/input/translator.rb +159 -0
  35. data/lib/vedeu/internal_api.rb +16 -15
  36. data/lib/vedeu/logging/all.rb +13 -0
  37. data/lib/vedeu/logging/debug.rb +84 -0
  38. data/lib/vedeu/logging/lockless_log_device.rb +65 -0
  39. data/lib/vedeu/logging/log.rb +179 -0
  40. data/lib/vedeu/logging/mono_logger.rb +26 -0
  41. data/lib/vedeu/logging/timer.rb +68 -0
  42. data/lib/vedeu/menus/all.rb +12 -0
  43. data/lib/vedeu/{dsl/menu.rb → menus/dsl.rb} +19 -18
  44. data/lib/vedeu/menus/menu.rb +234 -0
  45. data/lib/vedeu/{null/menu.rb → menus/null.rb} +6 -6
  46. data/lib/vedeu/menus/repository.rb +18 -0
  47. data/lib/vedeu/models/cell.rb +62 -55
  48. data/lib/vedeu/models/escape.rb +55 -50
  49. data/lib/vedeu/models/page.rb +74 -69
  50. data/lib/vedeu/models/row.rb +55 -51
  51. data/lib/vedeu/models/views/all.rb +1 -0
  52. data/lib/vedeu/models/views/char.rb +1 -1
  53. data/lib/vedeu/models/views/html_char.rb +165 -0
  54. data/lib/vedeu/output/renderers/html.rb +5 -4
  55. data/lib/vedeu/repositories/model.rb +2 -0
  56. data/lib/vedeu/runtime/application.rb +110 -103
  57. data/lib/vedeu/runtime/bootstrap.rb +109 -103
  58. data/lib/vedeu/runtime/flags.rb +45 -41
  59. data/lib/vedeu/runtime/launcher.rb +1 -1
  60. data/lib/vedeu/runtime/main_loop.rb +51 -46
  61. data/lib/vedeu/runtime/traps.rb +20 -16
  62. data/lib/vedeu/version.rb +1 -1
  63. data/lib/vedeu.rb +2 -2
  64. data/test/lib/vedeu/buffers/virtual_buffer_test.rb +1 -1
  65. data/test/lib/vedeu/cursors/cursor_test.rb +11 -5
  66. data/test/lib/vedeu/dsl/interface_test.rb +1 -1
  67. data/test/lib/vedeu/dsl/keymap_test.rb +2 -2
  68. data/test/lib/vedeu/{input/editor → editor}/capture_test.rb +0 -0
  69. data/test/lib/vedeu/{input/editor → editor}/cropper_test.rb +0 -0
  70. data/test/lib/vedeu/{input/editor → editor}/cursor_test.rb +0 -0
  71. data/test/lib/vedeu/{input/editor → editor}/document_test.rb +0 -0
  72. data/test/lib/vedeu/{input/editor → editor}/documents_test.rb +0 -0
  73. data/test/lib/vedeu/{input/editor → editor}/editor_test.rb +0 -0
  74. data/test/lib/vedeu/{input/editor → editor}/insert_test.rb +0 -0
  75. data/test/lib/vedeu/{input/editor → editor}/line_test.rb +0 -0
  76. data/test/lib/vedeu/{input/editor → editor}/lines_test.rb +0 -0
  77. data/test/lib/vedeu/input/input_test.rb +58 -54
  78. data/test/lib/vedeu/input/key_test.rb +29 -25
  79. data/test/lib/vedeu/input/keymap_test.rb +74 -70
  80. data/test/lib/vedeu/input/keymaps_test.rb +8 -4
  81. data/test/lib/vedeu/input/keys_test.rb +12 -8
  82. data/test/lib/vedeu/input/mapper_test.rb +64 -56
  83. data/test/lib/vedeu/input/translator_test.rb +36 -0
  84. data/test/lib/vedeu/logging/debug_test.rb +39 -0
  85. data/test/lib/vedeu/logging/lockless_log_device_test.rb +42 -0
  86. data/test/lib/vedeu/logging/log_test.rb +52 -0
  87. data/test/lib/vedeu/logging/mono_logger_test.rb +43 -0
  88. data/test/lib/vedeu/logging/timer_test.rb +44 -0
  89. data/test/lib/vedeu/{dsl/menu_test.rb → menus/dsl_test.rb} +6 -6
  90. data/test/lib/vedeu/menus/menu_test.rb +305 -0
  91. data/test/lib/vedeu/{null/menu_test.rb → menus/null_test.rb} +5 -5
  92. data/test/lib/vedeu/menus/repository_test.rb +17 -0
  93. data/test/lib/vedeu/models/cell_test.rb +54 -50
  94. data/test/lib/vedeu/models/escape_test.rb +49 -45
  95. data/test/lib/vedeu/models/page_test.rb +167 -160
  96. data/test/lib/vedeu/models/row_test.rb +71 -67
  97. data/test/lib/vedeu/models/views/html_char_test.rb +110 -0
  98. data/test/lib/vedeu/output/compressor_test.rb +44 -22
  99. data/test/lib/vedeu/output/renderers_test.rb +4 -2
  100. data/test/lib/vedeu/runtime/application_test.rb +36 -32
  101. data/test/lib/vedeu/runtime/bootstrap_test.rb +31 -26
  102. data/test/lib/vedeu/runtime/flags_test.rb +33 -29
  103. data/test/lib/vedeu/runtime/launcher_test.rb +4 -2
  104. data/test/lib/vedeu/runtime/main_loop_test.rb +28 -24
  105. data/test/lib/vedeu/runtime/traps_test.rb +8 -4
  106. data/test/test_helper.rb +4 -2
  107. metadata +66 -63
  108. data/lib/vedeu/input/editor/all.rb +0 -19
  109. data/lib/vedeu/input/input_translator.rb +0 -155
  110. data/lib/vedeu/log/debug.rb +0 -79
  111. data/lib/vedeu/log/lockless_log_device.rb +0 -61
  112. data/lib/vedeu/log/log.rb +0 -172
  113. data/lib/vedeu/log/mono_logger.rb +0 -21
  114. data/lib/vedeu/log/timer.rb +0 -63
  115. data/lib/vedeu/models/menu.rb +0 -217
  116. data/lib/vedeu/models/menus.rb +0 -14
  117. data/lib/vedeu/output/html_char.rb +0 -161
  118. data/test/lib/vedeu/input/input_translator_test.rb +0 -32
  119. data/test/lib/vedeu/log/debug_test.rb +0 -35
  120. data/test/lib/vedeu/log/lockless_log_device_test.rb +0 -29
  121. data/test/lib/vedeu/log/log_test.rb +0 -48
  122. data/test/lib/vedeu/log/mono_logger_test.rb +0 -31
  123. data/test/lib/vedeu/log/timer_test.rb +0 -40
  124. data/test/lib/vedeu/models/menu_test.rb +0 -301
  125. data/test/lib/vedeu/models/menus_test.rb +0 -13
  126. data/test/lib/vedeu/output/html_char_test.rb +0 -106
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.7
4
+ version: 0.6.8
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-09-14 00:00:00.000000000 Z
11
+ date: 2015-09-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -309,13 +309,22 @@ files:
309
309
  - lib/vedeu/dsl/interface.rb
310
310
  - lib/vedeu/dsl/keymap.rb
311
311
  - lib/vedeu/dsl/line.rb
312
- - lib/vedeu/dsl/menu.rb
313
312
  - lib/vedeu/dsl/presentation.rb
314
313
  - lib/vedeu/dsl/shared.rb
315
314
  - lib/vedeu/dsl/stream.rb
316
315
  - lib/vedeu/dsl/text.rb
317
316
  - lib/vedeu/dsl/use.rb
318
317
  - lib/vedeu/dsl/view.rb
318
+ - lib/vedeu/editor/all.rb
319
+ - lib/vedeu/editor/capture.rb
320
+ - lib/vedeu/editor/cropper.rb
321
+ - lib/vedeu/editor/cursor.rb
322
+ - lib/vedeu/editor/document.rb
323
+ - lib/vedeu/editor/documents.rb
324
+ - lib/vedeu/editor/editor.rb
325
+ - lib/vedeu/editor/insert.rb
326
+ - lib/vedeu/editor/line.rb
327
+ - lib/vedeu/editor/lines.rb
319
328
  - lib/vedeu/error.rb
320
329
  - lib/vedeu/esc/actions.rb
321
330
  - lib/vedeu/esc/borders.rb
@@ -338,29 +347,26 @@ files:
338
347
  - lib/vedeu/geometry/null.rb
339
348
  - lib/vedeu/geometry/position.rb
340
349
  - lib/vedeu/geometry/repository.rb
341
- - lib/vedeu/input/editor/all.rb
342
- - lib/vedeu/input/editor/capture.rb
343
- - lib/vedeu/input/editor/cropper.rb
344
- - lib/vedeu/input/editor/cursor.rb
345
- - lib/vedeu/input/editor/document.rb
346
- - lib/vedeu/input/editor/documents.rb
347
- - lib/vedeu/input/editor/editor.rb
348
- - lib/vedeu/input/editor/insert.rb
349
- - lib/vedeu/input/editor/line.rb
350
- - lib/vedeu/input/editor/lines.rb
350
+ - lib/vedeu/input/all.rb
351
351
  - lib/vedeu/input/input.rb
352
- - lib/vedeu/input/input_translator.rb
353
352
  - lib/vedeu/input/key.rb
354
353
  - lib/vedeu/input/keymap.rb
355
354
  - lib/vedeu/input/keymaps.rb
356
355
  - lib/vedeu/input/keys.rb
357
356
  - lib/vedeu/input/mapper.rb
357
+ - lib/vedeu/input/translator.rb
358
358
  - lib/vedeu/internal_api.rb
359
- - lib/vedeu/log/debug.rb
360
- - lib/vedeu/log/lockless_log_device.rb
361
- - lib/vedeu/log/log.rb
362
- - lib/vedeu/log/mono_logger.rb
363
- - lib/vedeu/log/timer.rb
359
+ - lib/vedeu/logging/all.rb
360
+ - lib/vedeu/logging/debug.rb
361
+ - lib/vedeu/logging/lockless_log_device.rb
362
+ - lib/vedeu/logging/log.rb
363
+ - lib/vedeu/logging/mono_logger.rb
364
+ - lib/vedeu/logging/timer.rb
365
+ - lib/vedeu/menus/all.rb
366
+ - lib/vedeu/menus/dsl.rb
367
+ - lib/vedeu/menus/menu.rb
368
+ - lib/vedeu/menus/null.rb
369
+ - lib/vedeu/menus/repository.rb
364
370
  - lib/vedeu/models/cell.rb
365
371
  - lib/vedeu/models/escape.rb
366
372
  - lib/vedeu/models/focus.rb
@@ -368,8 +374,6 @@ files:
368
374
  - lib/vedeu/models/groups.rb
369
375
  - lib/vedeu/models/interface.rb
370
376
  - lib/vedeu/models/interfaces.rb
371
- - lib/vedeu/models/menu.rb
372
- - lib/vedeu/models/menus.rb
373
377
  - lib/vedeu/models/page.rb
374
378
  - lib/vedeu/models/row.rb
375
379
  - lib/vedeu/models/toggleable.rb
@@ -380,12 +384,12 @@ files:
380
384
  - lib/vedeu/models/views/collections/streams.rb
381
385
  - lib/vedeu/models/views/collections/view_collection.rb
382
386
  - lib/vedeu/models/views/composition.rb
387
+ - lib/vedeu/models/views/html_char.rb
383
388
  - lib/vedeu/models/views/line.rb
384
389
  - lib/vedeu/models/views/stream.rb
385
390
  - lib/vedeu/models/views/view.rb
386
391
  - lib/vedeu/null/generic.rb
387
392
  - lib/vedeu/null/interface.rb
388
- - lib/vedeu/null/menu.rb
389
393
  - lib/vedeu/null/null.rb
390
394
  - lib/vedeu/null/view.rb
391
395
  - lib/vedeu/options.rb
@@ -393,7 +397,6 @@ files:
393
397
  - lib/vedeu/output/clear/named_interface.rb
394
398
  - lib/vedeu/output/compressor.rb
395
399
  - lib/vedeu/output/direct.rb
396
- - lib/vedeu/output/html_char.rb
397
400
  - lib/vedeu/output/output.rb
398
401
  - lib/vedeu/output/presentation.rb
399
402
  - lib/vedeu/output/presentation/colour.rb
@@ -492,13 +495,21 @@ files:
492
495
  - test/lib/vedeu/dsl/interface_test.rb
493
496
  - test/lib/vedeu/dsl/keymap_test.rb
494
497
  - test/lib/vedeu/dsl/line_test.rb
495
- - test/lib/vedeu/dsl/menu_test.rb
496
498
  - test/lib/vedeu/dsl/presentation_test.rb
497
499
  - test/lib/vedeu/dsl/shared_test.rb
498
500
  - test/lib/vedeu/dsl/stream_test.rb
499
501
  - test/lib/vedeu/dsl/text_test.rb
500
502
  - test/lib/vedeu/dsl/use_test.rb
501
503
  - test/lib/vedeu/dsl/view_test.rb
504
+ - test/lib/vedeu/editor/capture_test.rb
505
+ - test/lib/vedeu/editor/cropper_test.rb
506
+ - test/lib/vedeu/editor/cursor_test.rb
507
+ - test/lib/vedeu/editor/document_test.rb
508
+ - test/lib/vedeu/editor/documents_test.rb
509
+ - test/lib/vedeu/editor/editor_test.rb
510
+ - test/lib/vedeu/editor/insert_test.rb
511
+ - test/lib/vedeu/editor/line_test.rb
512
+ - test/lib/vedeu/editor/lines_test.rb
502
513
  - test/lib/vedeu/error_test.rb
503
514
  - test/lib/vedeu/esc/actions_test.rb
504
515
  - test/lib/vedeu/esc/borders_test.rb
@@ -519,28 +530,23 @@ files:
519
530
  - test/lib/vedeu/geometry/null_test.rb
520
531
  - test/lib/vedeu/geometry/position_test.rb
521
532
  - test/lib/vedeu/geometry/repository_test.rb
522
- - test/lib/vedeu/input/editor/capture_test.rb
523
- - test/lib/vedeu/input/editor/cropper_test.rb
524
- - test/lib/vedeu/input/editor/cursor_test.rb
525
- - test/lib/vedeu/input/editor/document_test.rb
526
- - test/lib/vedeu/input/editor/documents_test.rb
527
- - test/lib/vedeu/input/editor/editor_test.rb
528
- - test/lib/vedeu/input/editor/insert_test.rb
529
- - test/lib/vedeu/input/editor/line_test.rb
530
- - test/lib/vedeu/input/editor/lines_test.rb
531
533
  - test/lib/vedeu/input/input_test.rb
532
- - test/lib/vedeu/input/input_translator_test.rb
533
534
  - test/lib/vedeu/input/key_test.rb
534
535
  - test/lib/vedeu/input/keymap_test.rb
535
536
  - test/lib/vedeu/input/keymaps_test.rb
536
537
  - test/lib/vedeu/input/keys_test.rb
537
538
  - test/lib/vedeu/input/mapper_test.rb
539
+ - test/lib/vedeu/input/translator_test.rb
538
540
  - test/lib/vedeu/internal_api_test.rb
539
- - test/lib/vedeu/log/debug_test.rb
540
- - test/lib/vedeu/log/lockless_log_device_test.rb
541
- - test/lib/vedeu/log/log_test.rb
542
- - test/lib/vedeu/log/mono_logger_test.rb
543
- - test/lib/vedeu/log/timer_test.rb
541
+ - test/lib/vedeu/logging/debug_test.rb
542
+ - test/lib/vedeu/logging/lockless_log_device_test.rb
543
+ - test/lib/vedeu/logging/log_test.rb
544
+ - test/lib/vedeu/logging/mono_logger_test.rb
545
+ - test/lib/vedeu/logging/timer_test.rb
546
+ - test/lib/vedeu/menus/dsl_test.rb
547
+ - test/lib/vedeu/menus/menu_test.rb
548
+ - test/lib/vedeu/menus/null_test.rb
549
+ - test/lib/vedeu/menus/repository_test.rb
544
550
  - test/lib/vedeu/models/cell_test.rb
545
551
  - test/lib/vedeu/models/escape_test.rb
546
552
  - test/lib/vedeu/models/focus_test.rb
@@ -548,8 +554,6 @@ files:
548
554
  - test/lib/vedeu/models/groups_test.rb
549
555
  - test/lib/vedeu/models/interface_test.rb
550
556
  - test/lib/vedeu/models/interfaces_test.rb
551
- - test/lib/vedeu/models/menu_test.rb
552
- - test/lib/vedeu/models/menus_test.rb
553
557
  - test/lib/vedeu/models/page_test.rb
554
558
  - test/lib/vedeu/models/row_test.rb
555
559
  - test/lib/vedeu/models/toggleable_test.rb
@@ -559,12 +563,12 @@ files:
559
563
  - test/lib/vedeu/models/views/collections/streams_test.rb
560
564
  - test/lib/vedeu/models/views/collections/view_collection_test.rb
561
565
  - test/lib/vedeu/models/views/composition_test.rb
566
+ - test/lib/vedeu/models/views/html_char_test.rb
562
567
  - test/lib/vedeu/models/views/line_test.rb
563
568
  - test/lib/vedeu/models/views/stream_test.rb
564
569
  - test/lib/vedeu/models/views/view_test.rb
565
570
  - test/lib/vedeu/null/generic_test.rb
566
571
  - test/lib/vedeu/null/interface_test.rb
567
- - test/lib/vedeu/null/menu_test.rb
568
572
  - test/lib/vedeu/null/null_test.rb
569
573
  - test/lib/vedeu/null/view_test.rb
570
574
  - test/lib/vedeu/options_test.rb
@@ -572,7 +576,6 @@ files:
572
576
  - test/lib/vedeu/output/clear/named_interface_test.rb
573
577
  - test/lib/vedeu/output/compressor_test.rb
574
578
  - test/lib/vedeu/output/direct_test.rb
575
- - test/lib/vedeu/output/html_char_test.rb
576
579
  - test/lib/vedeu/output/output_test.rb
577
580
  - test/lib/vedeu/output/presentation/colour_test.rb
578
581
  - test/lib/vedeu/output/presentation/style_test.rb
@@ -718,13 +721,21 @@ test_files:
718
721
  - test/lib/vedeu/dsl/interface_test.rb
719
722
  - test/lib/vedeu/dsl/keymap_test.rb
720
723
  - test/lib/vedeu/dsl/line_test.rb
721
- - test/lib/vedeu/dsl/menu_test.rb
722
724
  - test/lib/vedeu/dsl/presentation_test.rb
723
725
  - test/lib/vedeu/dsl/shared_test.rb
724
726
  - test/lib/vedeu/dsl/stream_test.rb
725
727
  - test/lib/vedeu/dsl/text_test.rb
726
728
  - test/lib/vedeu/dsl/use_test.rb
727
729
  - test/lib/vedeu/dsl/view_test.rb
730
+ - test/lib/vedeu/editor/capture_test.rb
731
+ - test/lib/vedeu/editor/cropper_test.rb
732
+ - test/lib/vedeu/editor/cursor_test.rb
733
+ - test/lib/vedeu/editor/document_test.rb
734
+ - test/lib/vedeu/editor/documents_test.rb
735
+ - test/lib/vedeu/editor/editor_test.rb
736
+ - test/lib/vedeu/editor/insert_test.rb
737
+ - test/lib/vedeu/editor/line_test.rb
738
+ - test/lib/vedeu/editor/lines_test.rb
728
739
  - test/lib/vedeu/error_test.rb
729
740
  - test/lib/vedeu/esc/actions_test.rb
730
741
  - test/lib/vedeu/esc/borders_test.rb
@@ -745,28 +756,23 @@ test_files:
745
756
  - test/lib/vedeu/geometry/null_test.rb
746
757
  - test/lib/vedeu/geometry/position_test.rb
747
758
  - test/lib/vedeu/geometry/repository_test.rb
748
- - test/lib/vedeu/input/editor/capture_test.rb
749
- - test/lib/vedeu/input/editor/cropper_test.rb
750
- - test/lib/vedeu/input/editor/cursor_test.rb
751
- - test/lib/vedeu/input/editor/document_test.rb
752
- - test/lib/vedeu/input/editor/documents_test.rb
753
- - test/lib/vedeu/input/editor/editor_test.rb
754
- - test/lib/vedeu/input/editor/insert_test.rb
755
- - test/lib/vedeu/input/editor/line_test.rb
756
- - test/lib/vedeu/input/editor/lines_test.rb
757
759
  - test/lib/vedeu/input/input_test.rb
758
- - test/lib/vedeu/input/input_translator_test.rb
759
760
  - test/lib/vedeu/input/key_test.rb
760
761
  - test/lib/vedeu/input/keymap_test.rb
761
762
  - test/lib/vedeu/input/keymaps_test.rb
762
763
  - test/lib/vedeu/input/keys_test.rb
763
764
  - test/lib/vedeu/input/mapper_test.rb
765
+ - test/lib/vedeu/input/translator_test.rb
764
766
  - test/lib/vedeu/internal_api_test.rb
765
- - test/lib/vedeu/log/debug_test.rb
766
- - test/lib/vedeu/log/lockless_log_device_test.rb
767
- - test/lib/vedeu/log/log_test.rb
768
- - test/lib/vedeu/log/mono_logger_test.rb
769
- - test/lib/vedeu/log/timer_test.rb
767
+ - test/lib/vedeu/logging/debug_test.rb
768
+ - test/lib/vedeu/logging/lockless_log_device_test.rb
769
+ - test/lib/vedeu/logging/log_test.rb
770
+ - test/lib/vedeu/logging/mono_logger_test.rb
771
+ - test/lib/vedeu/logging/timer_test.rb
772
+ - test/lib/vedeu/menus/dsl_test.rb
773
+ - test/lib/vedeu/menus/menu_test.rb
774
+ - test/lib/vedeu/menus/null_test.rb
775
+ - test/lib/vedeu/menus/repository_test.rb
770
776
  - test/lib/vedeu/models/cell_test.rb
771
777
  - test/lib/vedeu/models/escape_test.rb
772
778
  - test/lib/vedeu/models/focus_test.rb
@@ -774,8 +780,6 @@ test_files:
774
780
  - test/lib/vedeu/models/groups_test.rb
775
781
  - test/lib/vedeu/models/interface_test.rb
776
782
  - test/lib/vedeu/models/interfaces_test.rb
777
- - test/lib/vedeu/models/menu_test.rb
778
- - test/lib/vedeu/models/menus_test.rb
779
783
  - test/lib/vedeu/models/page_test.rb
780
784
  - test/lib/vedeu/models/row_test.rb
781
785
  - test/lib/vedeu/models/toggleable_test.rb
@@ -785,12 +789,12 @@ test_files:
785
789
  - test/lib/vedeu/models/views/collections/streams_test.rb
786
790
  - test/lib/vedeu/models/views/collections/view_collection_test.rb
787
791
  - test/lib/vedeu/models/views/composition_test.rb
792
+ - test/lib/vedeu/models/views/html_char_test.rb
788
793
  - test/lib/vedeu/models/views/line_test.rb
789
794
  - test/lib/vedeu/models/views/stream_test.rb
790
795
  - test/lib/vedeu/models/views/view_test.rb
791
796
  - test/lib/vedeu/null/generic_test.rb
792
797
  - test/lib/vedeu/null/interface_test.rb
793
- - test/lib/vedeu/null/menu_test.rb
794
798
  - test/lib/vedeu/null/null_test.rb
795
799
  - test/lib/vedeu/null/view_test.rb
796
800
  - test/lib/vedeu/options_test.rb
@@ -798,7 +802,6 @@ test_files:
798
802
  - test/lib/vedeu/output/clear/named_interface_test.rb
799
803
  - test/lib/vedeu/output/compressor_test.rb
800
804
  - test/lib/vedeu/output/direct_test.rb
801
- - test/lib/vedeu/output/html_char_test.rb
802
805
  - test/lib/vedeu/output/output_test.rb
803
806
  - test/lib/vedeu/output/presentation/colour_test.rb
804
807
  - test/lib/vedeu/output/presentation/style_test.rb
@@ -1,19 +0,0 @@
1
- module Vedeu
2
-
3
- # Provide a mechanism to edit individual lines of the view.
4
- #
5
- module Editor
6
-
7
- end # Editor
8
-
9
- end # Vedeu
10
-
11
- require 'vedeu/input/editor/capture'
12
- require 'vedeu/input/editor/cropper'
13
- require 'vedeu/input/editor/editor'
14
- require 'vedeu/input/editor/insert'
15
- require 'vedeu/input/editor/line'
16
- require 'vedeu/input/editor/lines'
17
- require 'vedeu/input/editor/cursor'
18
- require 'vedeu/input/editor/document'
19
- require 'vedeu/input/editor/documents'
@@ -1,155 +0,0 @@
1
- module Vedeu
2
-
3
- # Translates escape sequences provided by the terminal into symbols which
4
- # Vedeu can use for various behaviours.
5
- #
6
- class InputTranslator
7
-
8
- # @param code [String]
9
- # @return [Symbol]
10
- def self.translate(code)
11
- new(code).translate
12
- end
13
-
14
- # Returns a new instance of Vedeu::InputTranslator.
15
- #
16
- # @param code [String]
17
- # @return [Vedeu::InputTranslator]
18
- def initialize(code)
19
- @code = code
20
- end
21
-
22
- # @return [Symbol]
23
- def translate
24
- symbols.fetch(code, code)
25
- end
26
-
27
- protected
28
-
29
- # @!attribute [r] code
30
- # @return [String]
31
- attr_reader :code
32
-
33
- private
34
-
35
- # @return [Hash<String => Symbol>]
36
- def symbols
37
- @symbols ||= f_keys.merge!(ctrl_letters).merge!(specials)
38
- end
39
-
40
- # @return [Hash<String => Symbol>]
41
- def ctrl_letters
42
- {
43
- "\u0001" => :ctrl_a,
44
- "\u0002" => :ctrl_b,
45
- "\u0003" => :ctrl_c,
46
- "\u2404" => :ctrl_c,
47
- "\u0004" => :ctrl_d,
48
- "\u2403" => :ctrl_d,
49
- "\u0005" => :ctrl_e,
50
- "\u0006" => :ctrl_f,
51
- "\u0007" => :ctrl_g,
52
- "\u0008" => :ctrl_h,
53
- # "\u0009" => :ctrl_i, # duplicates tab
54
- "\u0010" => :ctrl_j, # produces "\n"
55
- "\u0011" => :ctrl_k,
56
- "\u0012" => :ctrl_l,
57
- "\u0013" => :ctrl_m,
58
- "\u0014" => :ctrl_n,
59
- "\u0015" => :ctrl_o,
60
- "\u0016" => :ctrl_p,
61
- "\u0017" => :ctrl_q,
62
- "\u0018" => :ctrl_r,
63
- "\u2412" => :ctrl_r,
64
- "\u0019" => :ctrl_s,
65
- # "\u0020" => :ctrl_t, # duplicates spacebar
66
- "\u0021" => :ctrl_u,
67
- "\u0022" => :ctrl_v,
68
- "\u0023" => :ctrl_w,
69
- "\u0024" => :ctrl_x,
70
- "\u0025" => :ctrl_y,
71
- "\u0026" => :ctrl_z,
72
- }
73
- end
74
-
75
- # @return [Hash<String => Symbol>]
76
- def f_keys
77
- {
78
- "\eOP" => :f1,
79
- "\eOQ" => :f2,
80
- "\eOR" => :f3,
81
- "\eOS" => :f4,
82
-
83
- "\e[15~" => :f5,
84
- "\e[15;2~" => :shift_f5,
85
- "\e[15;5~" => :ctrl_f5,
86
-
87
- "\e[17~" => :f6,
88
- "\e[17;2~" => :shift_f6,
89
- "\e[17;5~" => :ctrl_f6,
90
-
91
- "\e[18~" => :f7,
92
- "\e[18;2~" => :shift_f7,
93
- "\e[18;5~" => :ctrl_f7,
94
-
95
- "\e[19~" => :f8,
96
- "\e[19;2~" => :shift_f8,
97
- "\e[19;5~" => :ctrl_f8,
98
-
99
- "\e[20~" => :f9,
100
- "\e[20;2~" => :shift_f9,
101
- "\e[20;5~" => :ctrl_f9,
102
-
103
- "\e[21~" => :f10,
104
- "\e[21;2~" => :shift_f10,
105
- "\e[21;5~" => :ctrl_f10,
106
-
107
- "\e[23~" => :f11,
108
- "\e[23;2~" => :shift_f11,
109
- "\e[23;5~" => :ctrl_f11,
110
-
111
- "\e[24~" => :f12,
112
- "\e[24;2~" => :shift_f12,
113
- "\e[24;5~" => :ctrl_f12,
114
- }
115
- end
116
-
117
- # @return [Hash<String => Symbol>]
118
- def specials
119
- {
120
- "\u007F" => :backspace,
121
- "\u2408" => :backspace,
122
- "\u23CE" => :carriage_return,
123
- "\e[3~" => :delete,
124
- "\u232B" => :delete,
125
- "\e[B" => :down,
126
- "\u2193" => :down,
127
- "\e[F" => :end,
128
- "\r" => :enter,
129
- "\n" => :enter,
130
- "\e" => :escape,
131
- "\u238B" => :escape,
132
- "\e[H" => :home,
133
- "\eOH" => :home,
134
- "\e[2~" => :insert,
135
- "\e[D" => :left,
136
- "\u2190" => :left,
137
- "\u240A" => :line_feed,
138
- "\e[5~" => :page_up,
139
- "\e[6~" => :page_down,
140
- "\e[1;2R" => :pause_break,
141
- "\e[1;2P" => :print_screen,
142
- "\e[C" => :right,
143
- "\u2192" => :right,
144
- "\e[1;2Q" => :scroll_lock,
145
- "\e[Z" => :shift_tab,
146
- "\t" => :tab,
147
- "\u21B9" => :tab,
148
- "\e[A" => :up,
149
- "\u2191" => :up,
150
- }
151
- end
152
-
153
- end # InputTranslator
154
-
155
- end # Vedeu
@@ -1,79 +0,0 @@
1
- module Vedeu
2
-
3
- # Provides a stack trace of a running client application upon exit in a file
4
- # for further analysis.
5
- #
6
- module Debug
7
-
8
- extend self
9
-
10
- # :nocov:
11
- # Helps to debug a running application by providing a stack trace of its
12
- # execution upon exiting.
13
- #
14
- # @param filename [String]
15
- # @return [void]
16
- # @yieldreturn [void] The section of the application to debug.
17
- def self.debug(filename = 'profile.html')
18
- return nil unless block_given?
19
-
20
- require 'ruby-prof'
21
-
22
- # RubyProf.measure_mode = RubyProf::WALL_TIME
23
- # RubyProf.measure_mode = RubyProf::PROCESS_TIME
24
- RubyProf.measure_mode = RubyProf::CPU_TIME
25
- # RubyProf.measure_mode = RubyProf::ALLOCATIONS
26
- # RubyProf.measure_mode = RubyProf::MEMORY
27
- # RubyProf.measure_mode = RubyProf::GC_TIME
28
- # RubyProf.measure_mode = RubyProf::GC_RUNS
29
-
30
- RubyProf.start
31
-
32
- work = yield
33
-
34
- result = RubyProf.stop
35
- result.eliminate_methods!([
36
- /^Array/,
37
- /^Hash/,
38
- /^String/,
39
- /^Fixnum/,
40
- ])
41
-
42
- File.open('/tmp/' + filename, 'w') do |file|
43
- # - Creates a HTML visualization of the Ruby stack
44
- RubyProf::CallStackPrinter.new(result).print(file)
45
-
46
- # Used with QTCacheGrind to analyse performance.
47
- # RubyProf::CallTreePrinter.new(result).print(file)
48
-
49
- # Creates a flat report in text format
50
- # RubyProf::FlatPrinter
51
-
52
- # - same as above but more verbose
53
- # RubyProf::FlatPrinterWithLineNumbers
54
-
55
- # - Creates a call graph report in text format
56
- # RubyProf::GraphPrinter
57
-
58
- # - Creates a call graph report in HTML (separate files per thread)
59
- # RubyProf::GraphHtmlPrinter
60
-
61
- # - Creates a call graph report in GraphViz's DOT format which can be
62
- # converted to an image
63
- # RubyProf::DotPrinter
64
-
65
- # - Creates a call tree report compatible with KCachegrind.
66
- # RubyProf::CallTreePrinter
67
-
68
- # - Uses the other printers to create several reports in one profiling
69
- # run
70
- # RubyProf::MultiPrinter
71
- end
72
-
73
- work
74
- end
75
- # :nocov:
76
-
77
- end # Debug
78
-
79
- end # Vedeu
@@ -1,61 +0,0 @@
1
- module Vedeu
2
-
3
- # Ensures we can always write to the log file by creating a lock-less
4
- # log device.
5
- #
6
- class LocklessLogDevice < Logger::LogDevice
7
-
8
- # Returns a new instance of Vedeu::LocklessLogDevice.
9
- #
10
- # @param log [void]
11
- # @return [Vedeu::LocklessLogDevice]
12
- def initialize(log = nil)
13
- @dev = nil
14
- @filename = nil
15
-
16
- if log.respond_to?(:write) && log.respond_to?(:close)
17
- @dev = log
18
-
19
- else
20
- @dev = open_logfile(log)
21
- @dev.sync = true
22
- @filename = log
23
-
24
- end
25
- end
26
-
27
- # @param message [String]
28
- # @return [void]
29
- def write(message)
30
- @dev.write(message)
31
-
32
- rescue StandardError => exception
33
- warn("log writing failed. #{exception}")
34
- end
35
-
36
- # @return [void]
37
- def close
38
- @dev.close
39
- rescue
40
- nil
41
- end
42
-
43
- private
44
-
45
- # @param log [String]
46
- # @return [void]
47
- def open_logfile(log)
48
- if FileTest.exist?(log)
49
- open(log, (File::WRONLY | File::APPEND))
50
-
51
- else
52
- logdev = open(log, (File::WRONLY | File::APPEND | File::CREAT))
53
- logdev.sync = true
54
- logdev
55
-
56
- end
57
- end
58
-
59
- end # LocklessLogDevice
60
-
61
- end # Vedeu