vedeu 0.6.61 → 0.6.62

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/benchmarks/array_vs_range.rb +1 -1
  3. data/docs/events/drb.md +2 -2
  4. data/docs/events/visibility.md +1 -1
  5. data/lib/vedeu/buffers/all.rb +1 -0
  6. data/lib/vedeu/buffers/empty.rb +2 -2
  7. data/lib/vedeu/{terminal/buffer.rb → buffers/terminal.rb} +12 -16
  8. data/lib/vedeu/cursors/cursor.rb +4 -8
  9. data/lib/vedeu/cursors/refresh.rb +5 -0
  10. data/lib/vedeu/editor/all.rb +1 -0
  11. data/lib/vedeu/editor/collection.rb +26 -0
  12. data/lib/vedeu/editor/document.rb +0 -8
  13. data/lib/vedeu/editor/line.rb +17 -47
  14. data/lib/vedeu/editor/lines.rb +22 -51
  15. data/lib/vedeu/geometries/geometry.rb +0 -6
  16. data/lib/vedeu/groups/group.rb +0 -6
  17. data/lib/vedeu/input/capture.rb +1 -1
  18. data/lib/vedeu/interfaces/clear.rb +1 -1
  19. data/lib/vedeu/logging/log.rb +5 -2
  20. data/lib/vedeu/models/focus.rb +4 -13
  21. data/lib/vedeu/output/compressor.rb +8 -4
  22. data/lib/vedeu/output/output.rb +3 -3
  23. data/lib/vedeu/output/renderers/all.rb +2 -2
  24. data/lib/vedeu/output/renderers/html.rb +1 -1
  25. data/lib/vedeu/output/renderers/json.rb +1 -1
  26. data/lib/vedeu/repositories/all.rb +1 -0
  27. data/lib/vedeu/repositories/assemblage.rb +57 -0
  28. data/lib/vedeu/repositories/collection.rb +1 -40
  29. data/lib/vedeu/repositories/model.rb +17 -0
  30. data/lib/vedeu/runtime/launcher.rb +5 -8
  31. data/lib/vedeu/terminal/all.rb +0 -1
  32. data/lib/vedeu/version.rb +1 -1
  33. data/test/lib/vedeu/{terminal/buffer_test.rb → buffers/terminal_test.rb} +24 -50
  34. data/test/lib/vedeu/cursors/cursor_test.rb +0 -6
  35. data/test/lib/vedeu/editor/collection_test.rb +38 -0
  36. data/test/lib/vedeu/editor/document_test.rb +0 -16
  37. data/test/lib/vedeu/editor/line_test.rb +17 -75
  38. data/test/lib/vedeu/editor/lines_test.rb +21 -88
  39. data/test/lib/vedeu/geometries/geometry_test.rb +0 -6
  40. data/test/lib/vedeu/groups/group_test.rb +0 -6
  41. data/test/lib/vedeu/input/mouse_test.rb +1 -1
  42. data/test/lib/vedeu/logging/log_test.rb +3 -3
  43. data/test/lib/vedeu/models/focus_test.rb +62 -56
  44. data/test/lib/vedeu/output/output_test.rb +2 -2
  45. data/test/lib/vedeu/output/renderers/html_test.rb +2 -2
  46. data/test/lib/vedeu/output/renderers/json_test.rb +1 -1
  47. data/test/lib/vedeu/repositories/assemblage_test.rb +96 -0
  48. data/test/lib/vedeu/repositories/collection_test.rb +0 -54
  49. data/test/lib/vedeu/repositories/model_test.rb +15 -0
  50. data/vedeu.gemspec +1 -1
  51. metadata +13 -7
@@ -0,0 +1,96 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ module Repositories
6
+
7
+ class CollectionTestClass
8
+
9
+ include Vedeu::Repositories::Assemblage
10
+
11
+ attr_accessor :collection
12
+
13
+ def initialize(collection)
14
+ @collection = collection
15
+ end
16
+
17
+ end # CollectionTestClass
18
+
19
+ describe Assemblage do
20
+
21
+ let(:described) { Vedeu::Repositories::Assemblage }
22
+ let(:instance) { Vedeu::Repositories::CollectionTestClass.new(collection) }
23
+ let(:collection) { 'Some text...'.chars }
24
+
25
+ describe '#[]' do
26
+ let(:collection) { [:hydrogen, :helium, :lithium, :beryllium] }
27
+
28
+ subject { instance[index] }
29
+
30
+ context 'when the index is a range' do
31
+ let(:index) { 1..2 }
32
+
33
+ it { subject.must_be_instance_of(Array) }
34
+ it { subject.must_equal([:helium, :lithium]) }
35
+ end
36
+
37
+ context 'when the index is an integer' do
38
+ let(:index) { 3 }
39
+
40
+ it { subject.must_be_instance_of(Symbol) }
41
+ it { subject.must_equal(:beryllium) }
42
+ end
43
+ end
44
+
45
+ describe '#empty?' do
46
+ subject { instance.empty? }
47
+
48
+ context 'when the collection is empty' do
49
+ let(:collection) { [] }
50
+
51
+ it { subject.must_equal(true) }
52
+ end
53
+
54
+ context 'when the collection is not empty' do
55
+ it { subject.must_equal(false) }
56
+ end
57
+ end
58
+
59
+ describe '#eql?' do
60
+ let(:other) { instance }
61
+
62
+ subject { instance.eql?(other) }
63
+
64
+ it { subject.must_equal(true) }
65
+
66
+ context 'when different to other' do
67
+ let(:some_collection) {
68
+ Vedeu::Repositories::CollectionTestClass.new('Some text...'.chars)
69
+ }
70
+ let(:other_collection) {
71
+ Vedeu::Repositories::CollectionTestClass.new('Other text...'.chars)
72
+ }
73
+
74
+ it { (some_collection == other_collection).must_equal(false) }
75
+ end
76
+ end
77
+
78
+ describe '#size' do
79
+ subject { instance.size }
80
+
81
+ context 'when the collection is empty' do
82
+ let(:collection) { [] }
83
+
84
+ it { subject.must_equal(0) }
85
+ end
86
+
87
+ context 'when the collection is not empty' do
88
+ it { subject.must_equal(12) }
89
+ end
90
+ end
91
+
92
+ end # Assemblage
93
+
94
+ end # Repositories
95
+
96
+ end # Vedeu
@@ -37,16 +37,6 @@ module Vedeu
37
37
  # it { skip }
38
38
  end
39
39
 
40
- describe '#[]' do
41
- let(:collection) { [:hydrogen, :helium, :lithium, :beryllium] }
42
- let(:_value) { 1..2 }
43
-
44
- subject { instance[_value] }
45
-
46
- it { subject.must_be_instance_of(Array) }
47
- it { subject.must_equal([:helium, :lithium]) }
48
- end
49
-
50
40
  describe '#add' do
51
41
  subject { instance.add(:hydrogen) }
52
42
 
@@ -70,50 +60,6 @@ module Vedeu
70
60
  end
71
61
  end
72
62
 
73
- describe '#empty?' do
74
- subject { instance.empty? }
75
-
76
- context 'when the collection is empty' do
77
- it { subject.must_be_instance_of(TrueClass) }
78
- end
79
-
80
- context 'when the collection is not empty' do
81
- before { instance.add(:hydrogen) }
82
-
83
- it { subject.must_be_instance_of(FalseClass) }
84
- end
85
- end
86
-
87
- describe '#eql?' do
88
- let(:other) { instance }
89
-
90
- subject { instance.eql?(other) }
91
-
92
- it { subject.must_equal(true) }
93
-
94
- context 'when different to other' do
95
- let(:other) { described.new([:different]) }
96
-
97
- it { subject.must_equal(false) }
98
- end
99
- end
100
-
101
- describe '#size' do
102
- subject { instance.size }
103
-
104
- it { subject.must_be_instance_of(Fixnum) }
105
-
106
- context 'when the collection is empty' do
107
- it { subject.must_equal(0) }
108
- end
109
-
110
- context 'when the collection is not empty' do
111
- before { instance.add(:hydrogen) }
112
-
113
- it { subject.must_equal(1) }
114
- end
115
- end
116
-
117
63
  describe '#to_s' do
118
64
  subject { instance.to_s }
119
65
 
@@ -49,6 +49,21 @@ module Vedeu
49
49
  # it { skip }
50
50
  end
51
51
 
52
+ describe '.store' do
53
+ let(:klass) {}
54
+
55
+ context 'when a block is given' do
56
+ subject { described.store(klass) }
57
+ end
58
+
59
+ context 'when a block is not given' do
60
+ subject { described.store(klass) { :some_proc } }
61
+ end
62
+
63
+ # @todo Add more tests.
64
+ # it { skip }
65
+ end
66
+
52
67
  describe '#store' do
53
68
  subject { instance.store }
54
69
 
data/vedeu.gemspec CHANGED
@@ -23,7 +23,7 @@ Gem::Specification.new do |spec|
23
23
  spec.add_development_dependency 'guard', '2.13.0'
24
24
  spec.add_development_dependency 'guard-minitest', '2.4.4'
25
25
  spec.add_development_dependency 'guard-rubocop', '1.2.0'
26
- spec.add_development_dependency 'minitest', '5.8.2'
26
+ spec.add_development_dependency 'minitest', '5.8.3'
27
27
  spec.add_development_dependency 'minitest-reporters', '1.1.5'
28
28
  spec.add_development_dependency 'mocha', '1.1.0'
29
29
  spec.add_development_dependency 'pry', '0.10.3'
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.61
4
+ version: 0.6.62
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-11-20 00:00:00.000000000 Z
11
+ date: 2015-11-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 5.8.2
61
+ version: 5.8.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 5.8.2
68
+ version: 5.8.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest-reporters
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -341,6 +341,7 @@ files:
341
341
  - lib/vedeu/buffers/null.rb
342
342
  - lib/vedeu/buffers/refresh.rb
343
343
  - lib/vedeu/buffers/repository.rb
344
+ - lib/vedeu/buffers/terminal.rb
344
345
  - lib/vedeu/buffers/view.rb
345
346
  - lib/vedeu/colours/all.rb
346
347
  - lib/vedeu/colours/background.rb
@@ -386,6 +387,7 @@ files:
386
387
  - lib/vedeu/dsl/use.rb
387
388
  - lib/vedeu/dsl/view.rb
388
389
  - lib/vedeu/editor/all.rb
390
+ - lib/vedeu/editor/collection.rb
389
391
  - lib/vedeu/editor/cropper.rb
390
392
  - lib/vedeu/editor/cursor.rb
391
393
  - lib/vedeu/editor/delete.rb
@@ -500,6 +502,7 @@ files:
500
502
  - lib/vedeu/plugins/plugin.rb
501
503
  - lib/vedeu/plugins/plugins.rb
502
504
  - lib/vedeu/repositories/all.rb
505
+ - lib/vedeu/repositories/assemblage.rb
503
506
  - lib/vedeu/repositories/collection.rb
504
507
  - lib/vedeu/repositories/defaults.rb
505
508
  - lib/vedeu/repositories/model.rb
@@ -522,7 +525,6 @@ files:
522
525
  - lib/vedeu/templating/template.rb
523
526
  - lib/vedeu/templating/view_template.rb
524
527
  - lib/vedeu/terminal/all.rb
525
- - lib/vedeu/terminal/buffer.rb
526
528
  - lib/vedeu/terminal/mode.rb
527
529
  - lib/vedeu/terminal/terminal.rb
528
530
  - lib/vedeu/version.rb
@@ -543,6 +545,7 @@ files:
543
545
  - test/lib/vedeu/buffers/null_test.rb
544
546
  - test/lib/vedeu/buffers/refresh_test.rb
545
547
  - test/lib/vedeu/buffers/repository_test.rb
548
+ - test/lib/vedeu/buffers/terminal_test.rb
546
549
  - test/lib/vedeu/buffers/view_test.rb
547
550
  - test/lib/vedeu/colours/background_test.rb
548
551
  - test/lib/vedeu/colours/backgrounds_test.rb
@@ -573,6 +576,7 @@ files:
573
576
  - test/lib/vedeu/dsl/text_test.rb
574
577
  - test/lib/vedeu/dsl/use_test.rb
575
578
  - test/lib/vedeu/dsl/view_test.rb
579
+ - test/lib/vedeu/editor/collection_test.rb
576
580
  - test/lib/vedeu/editor/cropper_test.rb
577
581
  - test/lib/vedeu/editor/cursor_test.rb
578
582
  - test/lib/vedeu/editor/delete_test.rb
@@ -671,6 +675,7 @@ files:
671
675
  - test/lib/vedeu/output/wordwrap_test.rb
672
676
  - test/lib/vedeu/plugins/plugin_test.rb
673
677
  - test/lib/vedeu/plugins/plugins_test.rb
678
+ - test/lib/vedeu/repositories/assemblage_test.rb
674
679
  - test/lib/vedeu/repositories/collection_test.rb
675
680
  - test/lib/vedeu/repositories/defaults_test.rb
676
681
  - test/lib/vedeu/repositories/model_test.rb
@@ -690,7 +695,6 @@ files:
690
695
  - test/lib/vedeu/templating/helpers_test.rb
691
696
  - test/lib/vedeu/templating/template_test.rb
692
697
  - test/lib/vedeu/templating/view_template_test.rb
693
- - test/lib/vedeu/terminal/buffer_test.rb
694
698
  - test/lib/vedeu/terminal/mode_test.rb
695
699
  - test/lib/vedeu/terminal/terminal_test.rb
696
700
  - test/lib/vedeu_test.rb
@@ -754,6 +758,7 @@ test_files:
754
758
  - test/lib/vedeu/buffers/null_test.rb
755
759
  - test/lib/vedeu/buffers/refresh_test.rb
756
760
  - test/lib/vedeu/buffers/repository_test.rb
761
+ - test/lib/vedeu/buffers/terminal_test.rb
757
762
  - test/lib/vedeu/buffers/view_test.rb
758
763
  - test/lib/vedeu/colours/background_test.rb
759
764
  - test/lib/vedeu/colours/backgrounds_test.rb
@@ -784,6 +789,7 @@ test_files:
784
789
  - test/lib/vedeu/dsl/text_test.rb
785
790
  - test/lib/vedeu/dsl/use_test.rb
786
791
  - test/lib/vedeu/dsl/view_test.rb
792
+ - test/lib/vedeu/editor/collection_test.rb
787
793
  - test/lib/vedeu/editor/cropper_test.rb
788
794
  - test/lib/vedeu/editor/cursor_test.rb
789
795
  - test/lib/vedeu/editor/delete_test.rb
@@ -882,6 +888,7 @@ test_files:
882
888
  - test/lib/vedeu/output/wordwrap_test.rb
883
889
  - test/lib/vedeu/plugins/plugin_test.rb
884
890
  - test/lib/vedeu/plugins/plugins_test.rb
891
+ - test/lib/vedeu/repositories/assemblage_test.rb
885
892
  - test/lib/vedeu/repositories/collection_test.rb
886
893
  - test/lib/vedeu/repositories/defaults_test.rb
887
894
  - test/lib/vedeu/repositories/model_test.rb
@@ -901,7 +908,6 @@ test_files:
901
908
  - test/lib/vedeu/templating/helpers_test.rb
902
909
  - test/lib/vedeu/templating/template_test.rb
903
910
  - test/lib/vedeu/templating/view_template_test.rb
904
- - test/lib/vedeu/terminal/buffer_test.rb
905
911
  - test/lib/vedeu/terminal/mode_test.rb
906
912
  - test/lib/vedeu/terminal/terminal_test.rb
907
913
  - test/lib/vedeu_test.rb