vedeu 0.6.6 → 0.6.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +0 -30
  3. data/lib/vedeu/all.rb +0 -1
  4. data/lib/vedeu/api.rb +5 -139
  5. data/lib/vedeu/application/application_controller.rb +12 -10
  6. data/lib/vedeu/application/application_helper.rb +3 -3
  7. data/lib/vedeu/application/application_view.rb +7 -6
  8. data/lib/vedeu/application/controller.rb +16 -10
  9. data/lib/vedeu/bindings/application.rb +6 -3
  10. data/lib/vedeu/bindings/bindings.rb +7 -6
  11. data/lib/vedeu/bindings/document.rb +18 -18
  12. data/lib/vedeu/bindings/drb.rb +12 -8
  13. data/lib/vedeu/bindings/focus.rb +12 -9
  14. data/lib/vedeu/bindings/menus.rb +12 -11
  15. data/lib/vedeu/bindings/movement.rb +23 -22
  16. data/lib/vedeu/bindings/refresh.rb +13 -10
  17. data/lib/vedeu/bindings/visibility.rb +10 -8
  18. data/lib/vedeu/borders/all.rb +26 -0
  19. data/lib/vedeu/borders/dsl.rb +1 -23
  20. data/lib/vedeu/buffers/all.rb +12 -0
  21. data/lib/vedeu/buffers/buffer.rb +1 -10
  22. data/lib/vedeu/buffers/refresh.rb +57 -0
  23. data/lib/vedeu/buffers/virtual_buffer.rb +1 -1
  24. data/lib/vedeu/cursors/all.rb +9 -0
  25. data/lib/vedeu/cursors/cursor.rb +16 -0
  26. data/lib/vedeu/dsl/interface.rb +4 -4
  27. data/lib/vedeu/events/aliases.rb +28 -9
  28. data/lib/vedeu/events/collection.rb +1 -0
  29. data/lib/vedeu/events/trigger.rb +5 -3
  30. data/lib/vedeu/geometry/all.rb +7 -0
  31. data/lib/vedeu/geometry/position.rb +2 -2
  32. data/lib/vedeu/input/editor/editor.rb +1 -1
  33. data/lib/vedeu/log/log.rb +6 -0
  34. data/lib/vedeu/log/timer.rb +2 -2
  35. data/lib/vedeu/models/focus.rb +3 -0
  36. data/lib/vedeu/models/group.rb +13 -0
  37. data/lib/vedeu/models/interface.rb +17 -1
  38. data/lib/vedeu/models/toggleable.rb +2 -1
  39. data/lib/vedeu/models/views/collections/chars.rb +1 -0
  40. data/lib/vedeu/models/views/collections/lines.rb +1 -0
  41. data/lib/vedeu/models/views/collections/streams.rb +1 -0
  42. data/lib/vedeu/models/views/collections/view_collection.rb +1 -0
  43. data/lib/vedeu/models/views/line.rb +2 -2
  44. data/lib/vedeu/null/generic.rb +27 -4
  45. data/lib/vedeu/null/interface.rb +1 -32
  46. data/lib/vedeu/null/menu.rb +1 -16
  47. data/lib/vedeu/null/view.rb +1 -33
  48. data/lib/vedeu/options.rb +3 -0
  49. data/lib/vedeu/output/clear/named_group.rb +5 -0
  50. data/lib/vedeu/output/clear/named_interface.rb +5 -0
  51. data/lib/vedeu/output/direct.rb +2 -2
  52. data/lib/vedeu/output/viewport.rb +1 -1
  53. data/lib/vedeu/refresh/refresh_group.rb +1 -1
  54. data/lib/vedeu/runtime/application.rb +3 -0
  55. data/lib/vedeu/terminal/terminal.rb +3 -0
  56. data/lib/vedeu/version.rb +1 -1
  57. data/test/lib/vedeu/buffers/refresh_test.rb +54 -0
  58. data/test/lib/vedeu/null/generic_test.rb +18 -0
  59. data/test/lib/vedeu/null/interface_test.rb +4 -30
  60. data/test/lib/vedeu/null/menu_test.rb +1 -18
  61. data/test/lib/vedeu/null/view_test.rb +6 -31
  62. data/{examples → test/support}/colour_support.sh +0 -0
  63. data/{examples → test/support/examples}/borders_app.rb +0 -0
  64. data/{examples → test/support/examples}/configuration_app.rb +0 -0
  65. data/{examples → test/support/examples}/drb_app.rb +0 -0
  66. data/{examples → test/support/examples}/editor_app.rb +0 -0
  67. data/{examples → test/support/examples}/focus_app.rb +0 -0
  68. data/{examples → test/support/examples}/hello_world.rb +0 -0
  69. data/{examples → test/support/examples}/material_colours_app.rb +0 -0
  70. data/{examples → test/support/examples}/material_colours_app_20150721.svg +0 -0
  71. data/{examples → test/support/examples}/typed_commands/command.erb +0 -0
  72. data/{examples → test/support/examples}/typed_commands/output.erb +0 -0
  73. data/{examples → test/support/examples}/typed_commands/status.erb +0 -0
  74. data/{examples → test/support/examples}/typed_commands/typed_commands_app.rb +0 -0
  75. data/{examples → test/support/examples}/view_templates_app/default.erb +0 -0
  76. data/{examples → test/support/examples}/view_templates_app/prune.erb +0 -0
  77. data/{examples → test/support/examples}/view_templates_app/view_templates_app.rb +0 -0
  78. data/{examples → test/support/examples}/view_templates_app/wrap.erb +0 -0
  79. metadata +38 -21
  80. data/lib/vedeu/refresh/refresh_buffer.rb +0 -53
  81. data/test/lib/vedeu/refresh/refresh_buffer_test.rb +0 -50
@@ -16,6 +16,8 @@ module Vedeu
16
16
  let(:_name) { 'null_generic' }
17
17
 
18
18
  describe 'alias methods' do
19
+ it { instance.must_respond_to(:name) }
20
+ it { instance.must_respond_to(:attributes) }
19
21
  it { instance.must_respond_to(:visible?) }
20
22
  end
21
23
 
@@ -31,9 +33,24 @@ module Vedeu
31
33
 
32
34
  it { subject.must_be_instance_of(NilClass) }
33
35
  it { instance.must_respond_to(:add) }
36
+ it { instance.must_respond_to(:bottom_item) }
34
37
  it { instance.must_respond_to(:colour) }
38
+ it { instance.must_respond_to(:current_item) }
39
+ it { instance.must_respond_to(:deselect_item) }
40
+ it { instance.must_respond_to(:hide) }
41
+ it { instance.must_respond_to(:item) }
42
+ it { instance.must_respond_to(:items) }
43
+ it { instance.must_respond_to(:next_item) }
35
44
  it { instance.must_respond_to(:parent) }
45
+ it { instance.must_respond_to(:prev_item) }
46
+ it { instance.must_respond_to(:select_item) }
47
+ it { instance.must_respond_to(:selected_item) }
48
+ it { instance.must_respond_to(:show) }
36
49
  it { instance.must_respond_to(:style) }
50
+ it { instance.must_respond_to(:toggle) }
51
+ it { instance.must_respond_to(:top_item) }
52
+ it { instance.must_respond_to(:view) }
53
+ it { instance.must_respond_to(:zindex) }
37
54
  end
38
55
 
39
56
  describe '#null?' do
@@ -52,6 +69,7 @@ module Vedeu
52
69
  subject { instance.visible }
53
70
 
54
71
  it { subject.must_be_instance_of(FalseClass) }
72
+ it { instance.must_respond_to(:visible?) }
55
73
  end
56
74
 
57
75
  describe '#visible=' do
@@ -6,14 +6,14 @@ module Vedeu
6
6
 
7
7
  describe Interface do
8
8
 
9
- let(:described) { Vedeu::Null::Interface }
10
- let(:instance) { described.new(attributes) }
11
- let(:attributes){
9
+ let(:described) { Vedeu::Null::Interface }
10
+ let(:instance) { described.new(attributes) }
11
+ let(:_name) { 'null_interface' }
12
+ let(:attributes) {
12
13
  {
13
14
  name: _name
14
15
  }
15
16
  }
16
- let(:_name) { 'null_interface' }
17
17
 
18
18
  describe '#initialize' do
19
19
  it { instance.must_be_instance_of(described) }
@@ -23,32 +23,6 @@ module Vedeu
23
23
  it { instance.instance_variable_get('@name').must_equal(_name) }
24
24
  end
25
25
 
26
- describe 'accessors' do
27
- it { instance.must_respond_to(:name) }
28
- it { instance.must_respond_to(:attributes) }
29
- it { instance.must_respond_to(:visible) }
30
- it { instance.must_respond_to(:visible=) }
31
- it { instance.must_respond_to(:visible?) }
32
- end
33
-
34
- describe '#null' do
35
- it { instance.null.must_be_instance_of(NilClass) }
36
-
37
- it { instance.must_respond_to(:hide) }
38
- it { instance.must_respond_to(:parent) }
39
- it { instance.must_respond_to(:show) }
40
- it { instance.must_respond_to(:toggle) }
41
- it { instance.must_respond_to(:zindex) }
42
- end
43
-
44
- describe '#null?' do
45
- it { instance.null?.must_be_instance_of(TrueClass) }
46
- end
47
-
48
- describe '#store' do
49
- it { instance.store.must_be_instance_of(Vedeu::Null::Interface) }
50
- end
51
-
52
26
  end # Interface
53
27
 
54
28
  end # Null
@@ -8,12 +8,12 @@ module Vedeu
8
8
 
9
9
  let(:described) { Vedeu::Null::Menu }
10
10
  let(:instance) { described.new(attributes) }
11
+ let(:_name) { 'null_menu' }
11
12
  let(:attributes) {
12
13
  {
13
14
  name: _name
14
15
  }
15
16
  }
16
- let(:_name) { 'null_geometry' }
17
17
 
18
18
  describe '#initialize' do
19
19
  it { instance.must_be_instance_of(described) }
@@ -23,23 +23,6 @@ module Vedeu
23
23
  it { instance.instance_variable_get('@name').must_equal(_name) }
24
24
  end
25
25
 
26
- describe 'alias methods' do
27
- it { instance.must_respond_to(:bottom_item) }
28
- it { instance.must_respond_to(:current_item) }
29
- it { instance.must_respond_to(:deselect_item) }
30
- it { instance.must_respond_to(:items) }
31
- it { instance.must_respond_to(:next_item) }
32
- it { instance.must_respond_to(:prev_item) }
33
- it { instance.must_respond_to(:select_item) }
34
- it { instance.must_respond_to(:selected_item) }
35
- it { instance.must_respond_to(:top_item) }
36
- it { instance.must_respond_to(:view) }
37
- end
38
-
39
- describe '#item' do
40
- it { instance.item.must_equal(nil) }
41
- end
42
-
43
26
  end # Menu
44
27
 
45
28
  end # Null
@@ -8,45 +8,20 @@ module Vedeu
8
8
 
9
9
  let(:described) { Vedeu::Null::View }
10
10
  let(:instance) { described.new(attributes) }
11
+ let(:_name) { 'vedeu_null_view' }
12
+ let(:visible) { false }
11
13
  let(:attributes) {
12
14
  {
13
- name: 'vedeu_null_view',
14
- visible: true,
15
+ name: _name,
16
+ visible: visible,
15
17
  }
16
18
  }
17
19
 
18
20
  describe '#initialize' do
19
21
  it { instance.must_be_instance_of(described) }
20
22
  it { instance.instance_variable_get('@attributes').must_equal(attributes) }
21
- it { instance.instance_variable_get('@name').must_equal('vedeu_null_view') }
22
- it { instance.instance_variable_get('@visible').must_equal(false) }
23
- end
24
-
25
- describe 'accessors' do
26
- it { instance.must_respond_to(:name) }
27
- it { instance.must_respond_to(:attributes) }
28
- it { instance.must_respond_to(:visible) }
29
- it { instance.must_respond_to(:visible=) }
30
- it { instance.must_respond_to(:visible?) }
31
- end
32
-
33
- describe '#null' do
34
- it { instance.null.must_equal(nil) }
35
-
36
- it { instance.must_respond_to(:parent) }
37
- it { instance.must_respond_to(:zindex) }
38
- end
39
-
40
- describe '#null?' do
41
- it { instance.null?.must_equal(true) }
42
- end
43
-
44
- describe '#store' do
45
- it { instance.store.must_equal(instance) }
46
- end
47
-
48
- describe '#visible?' do
49
- it { instance.visible?.must_equal(false) }
23
+ it { instance.instance_variable_get('@name').must_equal(_name) }
24
+ it { instance.instance_variable_get('@visible').must_equal(visible) }
50
25
  end
51
26
 
52
27
  end # View
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.6
4
+ version: 0.6.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
@@ -241,23 +241,6 @@ files:
241
241
  - docs/events.md
242
242
  - docs/getting_started.md
243
243
  - docs/object_graph.md
244
- - examples/borders_app.rb
245
- - examples/colour_support.sh
246
- - examples/configuration_app.rb
247
- - examples/drb_app.rb
248
- - examples/editor_app.rb
249
- - examples/focus_app.rb
250
- - examples/hello_world.rb
251
- - examples/material_colours_app.rb
252
- - examples/material_colours_app_20150721.svg
253
- - examples/typed_commands/command.erb
254
- - examples/typed_commands/output.erb
255
- - examples/typed_commands/status.erb
256
- - examples/typed_commands/typed_commands_app.rb
257
- - examples/view_templates_app/default.erb
258
- - examples/view_templates_app/prune.erb
259
- - examples/view_templates_app/view_templates_app.rb
260
- - examples/view_templates_app/wrap.erb
261
244
  - lib/vedeu.rb
262
245
  - lib/vedeu/all.rb
263
246
  - lib/vedeu/api.rb
@@ -286,6 +269,7 @@ files:
286
269
  - lib/vedeu/buffers/all.rb
287
270
  - lib/vedeu/buffers/buffer.rb
288
271
  - lib/vedeu/buffers/null.rb
272
+ - lib/vedeu/buffers/refresh.rb
289
273
  - lib/vedeu/buffers/repository.rb
290
274
  - lib/vedeu/buffers/virtual_buffer.rb
291
275
  - lib/vedeu/buffers/virtual_buffers.rb
@@ -431,7 +415,6 @@ files:
431
415
  - lib/vedeu/plugins/plugin.rb
432
416
  - lib/vedeu/plugins/plugins.rb
433
417
  - lib/vedeu/refresh/refresh.rb
434
- - lib/vedeu/refresh/refresh_buffer.rb
435
418
  - lib/vedeu/refresh/refresh_group.rb
436
419
  - lib/vedeu/repositories/collection.rb
437
420
  - lib/vedeu/repositories/model.rb
@@ -480,6 +463,7 @@ files:
480
463
  - test/lib/vedeu/borders/repository_test.rb
481
464
  - test/lib/vedeu/buffers/buffer_test.rb
482
465
  - test/lib/vedeu/buffers/null_test.rb
466
+ - test/lib/vedeu/buffers/refresh_test.rb
483
467
  - test/lib/vedeu/buffers/repository_test.rb
484
468
  - test/lib/vedeu/buffers/virtual_buffer_test.rb
485
469
  - test/lib/vedeu/buffers/virtual_buffers_test.rb
@@ -608,7 +592,6 @@ files:
608
592
  - test/lib/vedeu/output/wordwrap_test.rb
609
593
  - test/lib/vedeu/plugins/plugin_test.rb
610
594
  - test/lib/vedeu/plugins/plugins_test.rb
611
- - test/lib/vedeu/refresh/refresh_buffer_test.rb
612
595
  - test/lib/vedeu/refresh/refresh_group_test.rb
613
596
  - test/lib/vedeu/refresh/refresh_test.rb
614
597
  - test/lib/vedeu/repositories/collection_test.rb
@@ -635,7 +618,24 @@ files:
635
618
  - test/lib/vedeu_test.rb
636
619
  - test/support/all_seeds.sh
637
620
  - test/support/average_duration_reporter.rb
621
+ - test/support/colour_support.sh
638
622
  - test/support/coverage.rb
623
+ - test/support/examples/borders_app.rb
624
+ - test/support/examples/configuration_app.rb
625
+ - test/support/examples/drb_app.rb
626
+ - test/support/examples/editor_app.rb
627
+ - test/support/examples/focus_app.rb
628
+ - test/support/examples/hello_world.rb
629
+ - test/support/examples/material_colours_app.rb
630
+ - test/support/examples/material_colours_app_20150721.svg
631
+ - test/support/examples/typed_commands/command.erb
632
+ - test/support/examples/typed_commands/output.erb
633
+ - test/support/examples/typed_commands/status.erb
634
+ - test/support/examples/typed_commands/typed_commands_app.rb
635
+ - test/support/examples/view_templates_app/default.erb
636
+ - test/support/examples/view_templates_app/prune.erb
637
+ - test/support/examples/view_templates_app/view_templates_app.rb
638
+ - test/support/examples/view_templates_app/wrap.erb
639
639
  - test/support/helpers/model_test_class.rb
640
640
  - test/support/stats.sh
641
641
  - test/test_helper.rb
@@ -689,6 +689,7 @@ test_files:
689
689
  - test/lib/vedeu/borders/repository_test.rb
690
690
  - test/lib/vedeu/buffers/buffer_test.rb
691
691
  - test/lib/vedeu/buffers/null_test.rb
692
+ - test/lib/vedeu/buffers/refresh_test.rb
692
693
  - test/lib/vedeu/buffers/repository_test.rb
693
694
  - test/lib/vedeu/buffers/virtual_buffer_test.rb
694
695
  - test/lib/vedeu/buffers/virtual_buffers_test.rb
@@ -817,7 +818,6 @@ test_files:
817
818
  - test/lib/vedeu/output/wordwrap_test.rb
818
819
  - test/lib/vedeu/plugins/plugin_test.rb
819
820
  - test/lib/vedeu/plugins/plugins_test.rb
820
- - test/lib/vedeu/refresh/refresh_buffer_test.rb
821
821
  - test/lib/vedeu/refresh/refresh_group_test.rb
822
822
  - test/lib/vedeu/refresh/refresh_test.rb
823
823
  - test/lib/vedeu/repositories/collection_test.rb
@@ -844,7 +844,24 @@ test_files:
844
844
  - test/lib/vedeu_test.rb
845
845
  - test/support/all_seeds.sh
846
846
  - test/support/average_duration_reporter.rb
847
+ - test/support/colour_support.sh
847
848
  - test/support/coverage.rb
849
+ - test/support/examples/borders_app.rb
850
+ - test/support/examples/configuration_app.rb
851
+ - test/support/examples/drb_app.rb
852
+ - test/support/examples/editor_app.rb
853
+ - test/support/examples/focus_app.rb
854
+ - test/support/examples/hello_world.rb
855
+ - test/support/examples/material_colours_app.rb
856
+ - test/support/examples/material_colours_app_20150721.svg
857
+ - test/support/examples/typed_commands/command.erb
858
+ - test/support/examples/typed_commands/output.erb
859
+ - test/support/examples/typed_commands/status.erb
860
+ - test/support/examples/typed_commands/typed_commands_app.rb
861
+ - test/support/examples/view_templates_app/default.erb
862
+ - test/support/examples/view_templates_app/prune.erb
863
+ - test/support/examples/view_templates_app/view_templates_app.rb
864
+ - test/support/examples/view_templates_app/wrap.erb
848
865
  - test/support/helpers/model_test_class.rb
849
866
  - test/support/stats.sh
850
867
  - test/test_helper.rb
@@ -1,53 +0,0 @@
1
- module Vedeu
2
-
3
- # Refreshes the given named interface.
4
- #
5
- # @example
6
- # Vedeu.trigger(:_refresh_, name)
7
- #
8
- class RefreshBuffer
9
-
10
- include Vedeu::Common
11
-
12
- # @param name [String] The name of the interface to be refreshed using the
13
- # named buffer.
14
- # @return [Array|Vedeu::Error::ModelNotFound]
15
- def self.by_name(name)
16
- new(name).by_name
17
- end
18
-
19
- # Return a new instance of Vedeu::RefreshBuffer.
20
- #
21
- # @param name [String]
22
- # @return [Vedeu::RefreshBuffer]
23
- def initialize(name)
24
- @name = name
25
- end
26
-
27
- # @return [void]
28
- def by_name
29
- Vedeu.timer("Refresh Buffer: '#{buffer_name}'") do
30
- Vedeu.buffers.by_name(buffer_name).render
31
- end
32
- end
33
-
34
- protected
35
-
36
- # # @!attribute [r] name
37
- # @return [String]
38
- attr_reader :name
39
-
40
- private
41
-
42
- # @raise [Vedeu::Error::MissingRequired] When the name is empty or nil.
43
- # @return [String]
44
- def buffer_name
45
- return name if present?(name)
46
-
47
- fail Vedeu::Error::MissingRequired,
48
- 'Cannot refresh interface with an empty interface name.'
49
- end
50
-
51
- end # RefreshBuffer
52
-
53
- end # Vedeu
@@ -1,50 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- describe RefreshBuffer do
6
-
7
- let(:described) { Vedeu::RefreshBuffer }
8
- let(:instance) { described.new(_name) }
9
- let(:_name) { 'Vedeu::RefreshBuffer' }
10
-
11
- describe '#initialize' do
12
- it { instance.must_be_instance_of(described) }
13
- it { instance.instance_variable_get('@name').must_equal(_name) }
14
- end
15
-
16
- describe '.by_name' do
17
- subject { described.by_name(_name) }
18
-
19
- context 'when the name is not present' do
20
- let(:_name) { '' }
21
-
22
- it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) }
23
- end
24
-
25
- # describe '.by_name' do
26
- # let(:_name) { 'aluminium' }
27
- # let(:buffer) { Vedeu::Buffers::Null.new(name: _name) }
28
- #
29
- # subject { described.by_name(_name) }
30
- #
31
- # it {
32
- # Vedeu.buffers.expects(:by_name).with(_name).returns(buffer)
33
- # buffer.expects(:render)
34
- # subject
35
- # }
36
- # end
37
-
38
- context 'when the name is present' do
39
- # @todo Add more tests.
40
- # it { skip }
41
- end
42
- end
43
-
44
- describe '#by_name' do
45
- it { instance.must_respond_to(:by_name) }
46
- end
47
-
48
- end # RefreshBuffer
49
-
50
- end # Vedeu