vedeu 0.8.9 → 0.8.10

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. checksums.yaml +4 -4
  2. data/.codeclimate.yml +1 -0
  3. data/docs/configuration/drb.md +6 -0
  4. data/docs/configuration/drb_host.md +6 -0
  5. data/docs/configuration/drb_port.md +6 -0
  6. data/docs/configuration/interactive.md +21 -0
  7. data/docs/configuration/run_once.md +8 -0
  8. data/docs/configuration/standalone.md +20 -0
  9. data/docs/dsl.md +1 -1
  10. data/lib/vedeu.rb +15 -5
  11. data/lib/vedeu/application/controller.rb +5 -6
  12. data/lib/vedeu/borders/border.rb +1 -5
  13. data/lib/vedeu/borders/title.rb +6 -1
  14. data/lib/vedeu/buffers/buffer.rb +1 -3
  15. data/lib/vedeu/buffers/empty.rb +1 -3
  16. data/lib/vedeu/buffers/refresh.rb +1 -1
  17. data/lib/vedeu/buffers/view.rb +1 -1
  18. data/lib/vedeu/cells/border.rb +1 -1
  19. data/lib/vedeu/cells/borders/edges/bottom_horizontal.rb +1 -1
  20. data/lib/vedeu/cells/borders/edges/left_vertical.rb +1 -1
  21. data/lib/vedeu/cells/borders/edges/right_vertical.rb +1 -1
  22. data/lib/vedeu/cells/borders/edges/top_horizontal.rb +1 -1
  23. data/lib/vedeu/cells/borders/horizontal.rb +1 -1
  24. data/lib/vedeu/cells/borders/vertical.rb +1 -1
  25. data/lib/vedeu/cells/borders/vertices/bottom_left.rb +1 -1
  26. data/lib/vedeu/cells/borders/vertices/bottom_right.rb +1 -1
  27. data/lib/vedeu/cells/borders/vertices/top_left.rb +1 -1
  28. data/lib/vedeu/cells/borders/vertices/top_right.rb +1 -1
  29. data/lib/vedeu/cells/cursor.rb +1 -1
  30. data/lib/vedeu/cells/empty.rb +1 -1
  31. data/lib/vedeu/coercers/coercer.rb +8 -0
  32. data/lib/vedeu/coercers/colour.rb +6 -4
  33. data/lib/vedeu/coercers/editor_line.rb +4 -1
  34. data/lib/vedeu/coercers/editor_lines.rb +18 -3
  35. data/lib/vedeu/coercers/lines.rb +2 -1
  36. data/lib/vedeu/coercers/page.rb +2 -6
  37. data/lib/vedeu/coercers/position.rb +1 -3
  38. data/lib/vedeu/coercers/row.rb +0 -1
  39. data/lib/vedeu/colours/colour.rb +1 -2
  40. data/lib/vedeu/configuration/api.rb +6 -69
  41. data/lib/vedeu/configuration/configuration.rb +1 -4
  42. data/lib/vedeu/cursors/coordinate.rb +1 -3
  43. data/lib/vedeu/cursors/cursor.rb +4 -7
  44. data/lib/vedeu/cursors/reposition.rb +1 -1
  45. data/lib/vedeu/distributed/test_application.rb +1 -3
  46. data/lib/vedeu/dsl/border.rb +3 -4
  47. data/lib/vedeu/dsl/geometry.rb +6 -7
  48. data/lib/vedeu/dsl/helpers/align.rb +1 -1
  49. data/lib/vedeu/dsl/helpers/attributes.rb +2 -2
  50. data/lib/vedeu/dsl/helpers/truncate.rb +1 -2
  51. data/lib/vedeu/dsl/helpers/wordwrap.rb +1 -3
  52. data/lib/vedeu/dsl/presentation.rb +18 -0
  53. data/lib/vedeu/editor/cursor.rb +1 -3
  54. data/lib/vedeu/editor/document.rb +1 -3
  55. data/lib/vedeu/editor/line.rb +4 -12
  56. data/lib/vedeu/editor/lines.rb +3 -29
  57. data/lib/vedeu/events/event.rb +1 -3
  58. data/lib/vedeu/geometries/area/dimension.rb +1 -3
  59. data/lib/vedeu/geometries/area/x_dimension.rb +1 -1
  60. data/lib/vedeu/geometries/area/y_dimension.rb +1 -1
  61. data/lib/vedeu/geometries/geometry.rb +1 -4
  62. data/lib/vedeu/geometries/move.rb +1 -1
  63. data/lib/vedeu/groups/group.rb +4 -7
  64. data/lib/vedeu/input/keymap.rb +1 -3
  65. data/lib/vedeu/input/keys.rb +2 -0
  66. data/lib/vedeu/input/mapper.rb +2 -0
  67. data/lib/vedeu/input/mouse.rb +2 -0
  68. data/lib/vedeu/input/read.rb +1 -7
  69. data/lib/vedeu/interfaces/clear.rb +1 -1
  70. data/lib/vedeu/interfaces/interface.rb +11 -6
  71. data/lib/vedeu/logging/lockless_log_device.rb +18 -2
  72. data/lib/vedeu/logging/timer.rb +17 -9
  73. data/lib/vedeu/menus/menu.rb +1 -3
  74. data/lib/vedeu/models/toggleable.rb +5 -6
  75. data/lib/vedeu/output/all.rb +3 -0
  76. data/lib/vedeu/output/compressor.rb +1 -1
  77. data/lib/vedeu/output/output.rb +2 -3
  78. data/lib/vedeu/output/refresh.rb +1 -1
  79. data/lib/vedeu/output/write.rb +3 -2
  80. data/lib/vedeu/renderers/options.rb +1 -3
  81. data/lib/vedeu/repositories/defaults.rb +1 -1
  82. data/lib/vedeu/repositories/model.rb +5 -6
  83. data/lib/vedeu/repositories/registerable.rb +6 -8
  84. data/lib/vedeu/runtime/flags.rb +2 -2
  85. data/lib/vedeu/support/y_coordinate.rb +1 -1
  86. data/lib/vedeu/version.rb +1 -1
  87. data/lib/vedeu/views/composition.rb +1 -3
  88. data/lib/vedeu/views/default_attributes.rb +2 -4
  89. data/lib/vedeu/views/value.rb +6 -8
  90. data/lib/vedeu/views/view.rb +9 -3
  91. data/test/lib/vedeu/application/application_helper_test.rb +3 -2
  92. data/test/lib/vedeu/application/controller_test.rb +10 -11
  93. data/test/lib/vedeu/application/helper_test.rb +3 -2
  94. data/test/lib/vedeu/application/view_test.rb +4 -3
  95. data/test/lib/vedeu/coercers/editor_line_test.rb +21 -0
  96. data/test/lib/vedeu/coercers/editor_lines_test.rb +41 -0
  97. data/test/lib/vedeu/coercers/page_test.rb +1 -1
  98. data/test/lib/vedeu/cursors/dsl_test.rb +11 -10
  99. data/test/lib/vedeu/dsl/dsl_test.rb +3 -2
  100. data/test/lib/vedeu/dsl/elements_test.rb +19 -21
  101. data/test/lib/vedeu/dsl/presentation_test.rb +42 -0
  102. data/test/lib/vedeu/editor/collection_test.rb +5 -4
  103. data/test/lib/vedeu/editor/line_test.rb +4 -27
  104. data/test/lib/vedeu/editor/lines_test.rb +4 -54
  105. data/test/lib/vedeu/logging/timer_test.rb +11 -1
  106. data/test/lib/vedeu/models/toggleable_test.rb +27 -25
  107. data/test/lib/vedeu/output/compressor_cache_test.rb +0 -3
  108. data/test/lib/vedeu/presentation/colour_test.rb +13 -12
  109. data/test/lib/vedeu/presentation/presentation_test.rb +4 -2
  110. data/test/lib/vedeu/presentation/styles_test.rb +5 -3
  111. data/test/lib/vedeu/renderers/options_test.rb +10 -12
  112. data/test/lib/vedeu/repositories/assemblage_test.rb +11 -10
  113. data/test/lib/vedeu/repositories/collection_test.rb +1 -1
  114. data/test/lib/vedeu/repositories/defaults_test.rb +9 -7
  115. data/test/lib/vedeu/repositories/model_test.rb +10 -9
  116. data/test/lib/vedeu/repositories/registerable_test.rb +19 -18
  117. data/test/lib/vedeu/repositories/repository_test.rb +7 -7
  118. data/test/lib/vedeu/repositories/store_test.rb +14 -13
  119. data/test/lib/vedeu/templating/helpers_test.rb +9 -8
  120. data/test/lib/vedeu/views/default_attributes_test.rb +17 -17
  121. data/test/lib/vedeu/views/value_test.rb +0 -1
  122. data/test/support/helpers/model_test_class.rb +1 -2
  123. metadata +8 -2
@@ -124,7 +124,7 @@ module Vedeu
124
124
  context 'when there something in focus' do
125
125
  before { Vedeu.stubs(:focus).returns('zinc') }
126
126
 
127
- it { subject.must_be_instance_of(Vedeu::Repositories::TestModel) }
127
+ it { subject.must_be_instance_of(model) }
128
128
  end
129
129
  end
130
130
 
@@ -169,7 +169,7 @@ module Vedeu
169
169
  end
170
170
 
171
171
  describe '#find_or_create' do
172
- let(:model_instance) { Vedeu::Repositories::TestModel.new('niobium') }
172
+ let(:model_instance) { model.new('niobium') }
173
173
 
174
174
  before { Vedeu.stubs(:log) }
175
175
 
@@ -187,7 +187,7 @@ module Vedeu
187
187
  let(:model_name) { 'zinc'}
188
188
 
189
189
  it 'creates and stores a new instance of the model' do
190
- subject.must_be_instance_of(Vedeu::Repositories::TestModel)
190
+ subject.must_be_instance_of(model)
191
191
  end
192
192
  end
193
193
  end
@@ -232,7 +232,7 @@ module Vedeu
232
232
  context 'when the model is not registered' do
233
233
  before {
234
234
  instance.reset
235
- instance.store(Vedeu::Repositories::TestModel.new('zinc'))
235
+ instance.store(model.new('zinc'))
236
236
  }
237
237
 
238
238
  it { subject.must_be_instance_of(FalseClass) }
@@ -241,8 +241,8 @@ module Vedeu
241
241
  context 'when the model is registered' do
242
242
  before {
243
243
  instance.reset
244
- instance.store(Vedeu::Repositories::TestModel.new('gadolinium'))
245
- instance.store(Vedeu::Repositories::TestModel.new('francium'))
244
+ instance.store(model.new('gadolinium'))
245
+ instance.store(model.new('francium'))
246
246
  }
247
247
 
248
248
  it 'returns the storage with the model removed' do
@@ -269,7 +269,7 @@ module Vedeu
269
269
  context 'when a name attributes is provided' do
270
270
  let(:model_name) { 'hydrogen' }
271
271
 
272
- it { subject.must_be_instance_of(Vedeu::Repositories::TestModel) }
272
+ it { subject.must_be_instance_of(model) }
273
273
  end
274
274
  end
275
275
 
@@ -25,27 +25,28 @@ module Vedeu
25
25
 
26
26
  describe Store do
27
27
 
28
- let(:described) { Vedeu::Repositories::Store }
29
- let(:instance) { Vedeu::Repositories::StoreTestClass.new(model, storage) }
30
- let(:model) {}
31
- let(:storage) {}
28
+ let(:described) { Vedeu::Repositories::Store }
29
+ let(:included_described) { Vedeu::Repositories::StoreTestClass }
30
+ let(:included_instance) { included_described.new(model, storage) }
31
+ let(:model) {}
32
+ let(:storage) {}
32
33
 
33
34
  describe '#all' do
34
- it { instance.must_respond_to(:all) }
35
+ it { included_instance.must_respond_to(:all) }
35
36
  end
36
37
 
37
38
  describe '#clear' do
38
- it { instance.must_respond_to(:clear) }
39
+ it { included_instance.must_respond_to(:clear) }
39
40
  end
40
41
 
41
42
  describe '#each' do
42
- subject { instance.each }
43
+ subject { included_instance.each }
43
44
 
44
45
  it { subject.must_be_instance_of(Enumerator) }
45
46
  end
46
47
 
47
48
  describe '#empty?' do
48
- subject { instance.empty? }
49
+ subject { included_instance.empty? }
49
50
 
50
51
  context 'when empty' do
51
52
  it { subject.must_equal(true) }
@@ -61,7 +62,7 @@ module Vedeu
61
62
  describe '#exists?' do
62
63
  let(:_name) {}
63
64
 
64
- subject { instance.exists?(_name) }
65
+ subject { included_instance.exists?(_name) }
65
66
 
66
67
  context 'when the store is empty' do
67
68
  let(:_name) { :vedeu_repositories_store }
@@ -95,11 +96,11 @@ module Vedeu
95
96
  end
96
97
 
97
98
  describe '#registered?' do
98
- it { instance.must_respond_to(:registered?) }
99
+ it { included_instance.must_respond_to(:registered?) }
99
100
  end
100
101
 
101
102
  describe '#registered' do
102
- subject { instance.registered }
103
+ subject { included_instance.registered }
103
104
 
104
105
  it { subject.must_be_instance_of(Array) }
105
106
 
@@ -139,7 +140,7 @@ module Vedeu
139
140
  end
140
141
 
141
142
  describe '#size' do
142
- subject { instance.size }
143
+ subject { included_instance.size }
143
144
 
144
145
  context 'when empty' do
145
146
  it { subject.must_equal(0) }
@@ -153,7 +154,7 @@ module Vedeu
153
154
  end
154
155
 
155
156
  describe '#all' do
156
- it { instance.must_respond_to(:all) }
157
+ it { included_instance.must_respond_to(:all) }
157
158
  end
158
159
 
159
160
  end # Store
@@ -14,8 +14,9 @@ module Vedeu
14
14
 
15
15
  describe Helpers do
16
16
 
17
- let(:described) { Vedeu::Templating::Helpers }
18
- let(:instance) { Vedeu::Templating::HelpersTestClass.new }
17
+ let(:described) { Vedeu::Templating::Helpers }
18
+ let(:included_described) { Vedeu::Templating::HelpersTestClass }
19
+ let(:included_instance) { included_described.new }
19
20
 
20
21
  describe '#background' do
21
22
  # let(:expected) {
@@ -26,19 +27,19 @@ module Vedeu
26
27
  # "w4tjb4NO3gG3z2TbI=}}"
27
28
  # }
28
29
 
29
- subject { instance.background('#000000') { 'background text' } }
30
+ subject { included_instance.background('#000000') { 'background text' } }
30
31
 
31
32
  # it { subject.must_equal(expected) }
32
33
  end
33
34
 
34
35
  describe '#bg' do
35
- it { instance.must_respond_to(:bg) }
36
+ it { included_instance.must_respond_to(:bg) }
36
37
  end
37
38
 
38
39
  describe '#colour' do
39
40
  let(:attributes) { {} }
40
41
 
41
- subject { instance.colour(attributes) { 'colour text' } }
42
+ subject { included_instance.colour(attributes) { 'colour text' } }
42
43
 
43
44
  context 'with no attributes' do
44
45
  it { subject.must_be_instance_of(String) }
@@ -115,13 +116,13 @@ module Vedeu
115
116
  # "Bh/MMXxlpNtQ==}}"
116
117
  # }
117
118
 
118
- subject { instance.foreground('#000000') { 'foreground text' } }
119
+ subject { included_instance.foreground('#000000') { 'foreground text' } }
119
120
 
120
121
  # it { subject.must_equal(expected) }
121
122
  end
122
123
 
123
124
  describe '#fg' do
124
- it { instance.must_respond_to(:fg) }
125
+ it { included_instance.must_respond_to(:fg) }
125
126
  end
126
127
 
127
128
  # describe '#style' do
@@ -133,7 +134,7 @@ module Vedeu
133
134
  # "/CoCWuDT6NxbwBBzVXlA==}}"
134
135
  # }
135
136
 
136
- # subject { instance.style(:bold) { 'style text' } }
137
+ # subject { included_instance.style(:bold) { 'style text' } }
137
138
 
138
139
  # it { subject.must_equal(expected) }
139
140
  # end
@@ -26,56 +26,56 @@ module Vedeu
26
26
  let(:described) { Vedeu::Views::DefaultAttributes }
27
27
  let(:instance) {}
28
28
 
29
- let(:including_described) { Vedeu::Views::DefaultAttributesTest }
30
- let(:including_instance) { including_described.new }
31
- let(:model) {}
29
+ let(:included_described) { Vedeu::Views::DefaultAttributesTest }
30
+ let(:included_instance) { included_described.new }
31
+ let(:model) {}
32
32
 
33
33
  describe '#align' do
34
- it { including_instance.must_respond_to(:align) }
34
+ it { included_instance.must_respond_to(:align) }
35
35
  end
36
36
 
37
37
  describe '#client' do
38
- it { including_instance.must_respond_to(:client) }
38
+ it { included_instance.must_respond_to(:client) }
39
39
  end
40
40
 
41
41
  describe '#colour' do
42
- it { including_instance.must_respond_to(:colour) }
42
+ it { included_instance.must_respond_to(:colour) }
43
43
  end
44
44
 
45
45
  describe '#name' do
46
- it { including_instance.must_respond_to(:name) }
46
+ it { included_instance.must_respond_to(:name) }
47
47
  end
48
48
 
49
49
  describe '#pad' do
50
- it { including_instance.must_respond_to(:pad) }
50
+ it { included_instance.must_respond_to(:pad) }
51
51
  end
52
52
 
53
53
  describe '#parent' do
54
- it { including_instance.must_respond_to(:parent) }
54
+ it { included_instance.must_respond_to(:parent) }
55
55
  end
56
56
 
57
57
  describe '#style' do
58
- it { including_instance.must_respond_to(:style) }
58
+ it { included_instance.must_respond_to(:style) }
59
59
  end
60
60
 
61
61
  describe '#truncate' do
62
- it { including_instance.must_respond_to(:truncate) }
62
+ it { included_instance.must_respond_to(:truncate) }
63
63
  end
64
64
 
65
65
  describe '#truncate?' do
66
- it { including_instance.must_respond_to(:truncate?) }
66
+ it { included_instance.must_respond_to(:truncate?) }
67
67
  end
68
68
 
69
69
  describe '#width' do
70
- it { including_instance.must_respond_to(:width) }
70
+ it { included_instance.must_respond_to(:width) }
71
71
  end
72
72
 
73
73
  describe '#wordwrap' do
74
- it { including_instance.must_respond_to(:wordwrap) }
74
+ it { included_instance.must_respond_to(:wordwrap) }
75
75
  end
76
76
 
77
77
  describe '#wordwrap?' do
78
- it { including_instance.must_respond_to(:wordwrap?) }
78
+ it { included_instance.must_respond_to(:wordwrap?) }
79
79
  end
80
80
 
81
81
  describe '#attributes' do
@@ -90,11 +90,11 @@ module Vedeu
90
90
  style: nil,
91
91
  truncate: false,
92
92
  width: nil,
93
- wordwrap: false,
93
+ wordwrap: true,
94
94
  }
95
95
  }
96
96
 
97
- subject { including_instance.attributes }
97
+ subject { included_instance.attributes }
98
98
 
99
99
  it { subject.must_be_instance_of(Hash) }
100
100
  it { subject.must_equal(expected) }
@@ -15,7 +15,6 @@ module Vedeu
15
15
  describe Value do
16
16
 
17
17
  let(:described) { Vedeu::Views::Value }
18
-
19
18
  let(:included_described) { Vedeu::Views::ValueTestClass }
20
19
  let(:included_instance) { included_described.new }
21
20
 
@@ -56,8 +56,7 @@ module Vedeu
56
56
 
57
57
  private
58
58
 
59
- # Returns the default options/attributes for this class.
60
- #
59
+ # @macro defaults_method
61
60
  def defaults
62
61
  {
63
62
  client: nil,
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-26 00:00:00.000000000 Z
11
+ date: 2016-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -243,6 +243,12 @@ files:
243
243
  - docs/chars.md
244
244
  - docs/colours_styles.md
245
245
  - docs/configuration.md
246
+ - docs/configuration/drb.md
247
+ - docs/configuration/drb_host.md
248
+ - docs/configuration/drb_port.md
249
+ - docs/configuration/interactive.md
250
+ - docs/configuration/run_once.md
251
+ - docs/configuration/standalone.md
246
252
  - docs/cursors.md
247
253
  - docs/dsl.md
248
254
  - docs/dsl/borders.md