vedeu 0.6.63 → 0.6.64

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 62cdfdd3391cb52b378f21160f57a5f0b1bd7792
4
- data.tar.gz: 1253650d2091f8d085a6ba99cfb6e035aae658e8
3
+ metadata.gz: 998283356866d82e0bd3b67de95edd9fbe89fd5f
4
+ data.tar.gz: 2dd548c709f2b1cda90bc46befe65f666fd28dfd
5
5
  SHA512:
6
- metadata.gz: 2cfc8ed0ff83a941c2692d1d68ea36cfd9e4022b6796efefd9b254942cc947dd29b9267090c9ddb625948edbff56074c9a7268c9339dd30ca3ab86121c52ef06
7
- data.tar.gz: 3a6780083ee0f2b053aaa8dd3450173c53b0020e7909753141b8d8d6660258a6d413d91747670e2c5efca3a76fbaec2be319e851f2b5860094352edcc0b5c560
6
+ metadata.gz: e53be9215177a8cf0aeeab573ca9f0f2a6ef871480b5bd4a1cc5795af184a7efd2c88c8a2188c12ceb9a04e742f3c54e8ed85c89bc733355bd83dceae478bba8
7
+ data.tar.gz: a4e513ce13024657f52396d7ad249de4f0329e1c9f6b7939bf910b5856ed2f83c9a6a4b88dfc483e2c0ee93463314e57718dff54be5406f61e7bd548eb5953a6
data/.yardopts CHANGED
@@ -1,6 +1,8 @@
1
1
  --private
2
2
  --protected
3
3
  --embed-mixins
4
+ --tag api_method:"API Method"
5
+ --tag api_event:"API Event"
4
6
  -
5
7
  docs/api.md
6
8
  docs/borders.md
data/docs/api.md CHANGED
@@ -43,18 +43,6 @@ See {file:docs/configuration.md}
43
43
 
44
44
  See {file:docs/events.md}
45
45
 
46
- ## Borders
47
-
48
- ### Vedeu.border
49
-
50
- ## Geometry
51
-
52
- ### Vedeu.geometry
53
-
54
- ## Groups
55
-
56
- ### Vedeu.group
57
-
58
46
  ## Input
59
47
 
60
48
  ### Vedeu.keypress
@@ -144,36 +132,377 @@ See {file:docs/events.md}
144
132
  ## Renderers
145
133
 
146
134
  ### Vedeu.renderer
147
- ### Vedeu.renderers
148
135
 
149
- ## Repositories
150
136
 
151
- These are collections which you can access:
137
+ # API Methods
138
+
139
+ ### Vedeu.add_command
140
+
141
+ @todo Add more documentation.
142
+
143
+ ### Vedeu.add_keypress
144
+
145
+ @todo Add more documentation.
146
+
147
+ ### Vedeu.all_commands
148
+
149
+ @todo Add more documentation.
150
+
151
+ ### Vedeu.all_keypresses
152
+
153
+ @todo Add more documentation.
152
154
 
153
155
  ### Vedeu.background_colours
154
- ### Vedeu.foreground_colours
156
+
157
+ Repository method. Access registered background colours.
158
+
159
+ Vedeu.background_colours # => [Vedeu::Colours::Backgrounds]
160
+
161
+ Vedeu.background_colours.all # => [Hash<String => String>]
162
+
163
+
164
+ ### Vedeu.bind
165
+
166
+ @todo Add more documentation.
167
+
168
+ ### Vedeu.bind_alias
169
+
170
+ @todo Add more documentation.
171
+
172
+ ### Vedeu.border
173
+
174
+ @todo Add more documentation.
175
+
155
176
  ### Vedeu.borders
177
+
178
+ Repository method. Access registered borders.
179
+
180
+ Vedeu.borders # [Vedeu::Borders::Repository]
181
+
182
+ Vedeu.borders.all # [Array<Vedeu::Borders::Border>]
183
+
184
+ ### Vedeu.bound?
185
+
186
+ @todo Add more documentation.
187
+
188
+ ### Vedeu.buffer_update
189
+
190
+ @todo Add more documentation.
191
+
192
+ ### Vedeu.buffer_write
193
+
194
+ @todo Add more documentation.
195
+
156
196
  ### Vedeu.buffers
197
+
198
+ Repository method. Access registered borders.
199
+
200
+ Vedeu.buffers # [Vedeu::Buffers::Repository]
201
+
202
+ Vedeu.buffers.all # [Array<Vedeu::Buffers::Buffer>]
203
+
204
+ ### Vedeu.clear
205
+
206
+ @todo Add more documentation.
207
+
208
+ ### Vedeu.clear_by_group
209
+
210
+ @todo Add more documentation.
211
+
212
+ ### Vedeu.clear_by_name
213
+
214
+ @todo Add more documentation.
215
+
216
+ ### Vedeu.clear_content_by_name
217
+
218
+ @todo Add more documentation.
219
+
220
+ ### Vedeu.clock_time
221
+
222
+ @todo Add more documentation.
223
+
224
+ ### Vedeu.configuration
225
+
226
+ @todo Add more documentation.
227
+
228
+ ### Vedeu.configure
229
+
230
+ @todo Add more documentation.
231
+
232
+ ### Vedeu.cursor
233
+
234
+ @todo Add more documentation.
235
+
157
236
  ### Vedeu.cursors
237
+
238
+ Repository method. Access registered cursors.
239
+
240
+ Vedeu.cursors # [Vedeu::Cursors::Repository]
241
+
242
+ Vedeu.cursors.all # [Array<Vedeu::Cursors::Cursor>]
243
+
244
+ ### Vedeu.direct_write
245
+
246
+ @todo Add more documentation.
247
+
248
+ ### Vedeu.documents
249
+
250
+ @todo Add more documentation.
251
+
252
+ ### Vedeu.drb_restart
253
+
254
+ @todo Add more documentation.
255
+
256
+ ### Vedeu.drb_start
257
+
258
+ @todo Add more documentation.
259
+
260
+ ### Vedeu.drb_status
261
+
262
+ @todo Add more documentation.
263
+
264
+ ### Vedeu.drb_stop
265
+
266
+ @todo Add more documentation.
267
+
158
268
  ### Vedeu.events
159
- ### Vedeu.geometries
160
- ### Vedeu.groups
161
- ### Vedeu.interfaces
162
- ### Vedeu.keymaps
163
- ### Vedeu.menus
164
269
 
165
- ## Miscellany
270
+ Repository method. Access registered events.
271
+
272
+ Vedeu.events # [Vedeu::Events::Repository]
273
+
274
+ Vedeu.events.all # [Array<Vedeu::Events::Collection>]
275
+
276
+ ### Vedeu.exit
277
+
278
+ @todo Add more documentation.
166
279
 
167
- ### Vedeu.cursor
168
280
  ### Vedeu.focus
281
+
282
+ @todo Add more documentation.
283
+
169
284
  ### Vedeu.focus_by_name
170
- ### Vedeu.focussed?
285
+
286
+ @todo Add more documentation.
287
+
171
288
  ### Vedeu.focus_next
289
+
290
+ @todo Add more documentation.
291
+
172
292
  ### Vedeu.focus_previous
293
+
294
+ @todo Add more documentation.
295
+
296
+ ### Vedeu.focussed?
297
+
298
+ @todo Add more documentation.
299
+
300
+ ### Vedeu.foreground_colours
301
+
302
+ Show all the registered foreground colours.
303
+
304
+ Vedeu.foreground_colours.all # => [Hash<String => String>]
305
+
306
+ Vedeu.foreground_colours # => [Vedeu::Colours::Foregrounds]
307
+
308
+ ### Vedeu.geometries
309
+
310
+ Repository method. Access registered interface/view geometry.
311
+
312
+ Vedeu.geometries # [Vedeu::Geometries::Repository]
313
+
314
+ Vedeu.geometries.all # [Array<Vedeu::Geometries::Geometry>]
315
+
316
+ ### Vedeu.geometry
317
+
318
+ @todo Add more documentation.
319
+
320
+ ### Vedeu.goto
321
+
322
+ @todo Add more documentation.
323
+
324
+ ### Vedeu.group
325
+
326
+ @todo Add more documentation.
327
+
328
+ ### Vedeu.groups
329
+
330
+ Repository method. Access registered groups.
331
+
332
+ Vedeu.groups # [Vedeu::Groups::Repository]
333
+
334
+ Vedeu.groups.all # [Array<Vedeu::Groups::Group>]
335
+
173
336
  ### Vedeu.height
337
+
338
+ @todo Add more documentation.
339
+
340
+ ### Vedeu.hide_cursor
341
+
342
+ @todo Add more documentation.
343
+
344
+ ### Vedeu.hide_group
345
+
346
+ @todo Add more documentation.
347
+
348
+ ### Vedeu.hide_interface
349
+
350
+ @todo Add more documentation.
351
+
352
+ ### Vedeu.interface
353
+
354
+ @todo Add more documentation.
355
+
356
+ ### Vedeu.interfaces
357
+
358
+ Repository method. Access registered interfaces.
359
+
360
+ Vedeu.interfaces # [Vedeu::Interfaces::Repository]
361
+
362
+ Vedeu.interfaces.all # [Array<Vedeu::Interfaces::Interface>]
363
+
364
+ ### Vedeu.keymap
365
+
366
+ @todo Add more documentation.
367
+
368
+ ### Vedeu.keymaps
369
+
370
+ Repository method. Access registered keymaps.
371
+
372
+ Vedeu.keymaps # [Vedeu::Input::Repository]
373
+
374
+ Vedeu.keymaps.all # [Array<Vedeu::Input::Keymap>]
375
+
376
+ ### Vedeu.keypress
377
+
378
+ @todo Add more documentation.
379
+
380
+ ### Vedeu.keys
381
+
382
+ @todo Add more documentation.
383
+
384
+ ### Vedeu.last_command
385
+
386
+ @todo Add more documentation.
387
+
388
+ ### Vedeu.last_keypress
389
+
390
+ @todo Add more documentation.
391
+
174
392
  ### Vedeu.log
175
- ### Vedeu.log_stdout
393
+
394
+ @todo Add more documentation.
395
+
176
396
  ### Vedeu.log_stderr
397
+
398
+ @todo Add more documentation.
399
+
400
+ ### Vedeu.log_stdout
401
+
402
+ @todo Add more documentation.
403
+
404
+ ### Vedeu.menu
405
+
406
+ @todo Add more documentation.
407
+
408
+ ### Vedeu.menus
409
+
410
+ Repository method. Access registered menus.
411
+
412
+ Vedeu.menus # [Vedeu::Menus::Repository]
413
+
414
+ Vedeu.menus.all # [Array<Vedeu::Menus::Menu>]
415
+
416
+ ### Vedeu.profile
417
+
418
+ @todo Add more documentation.
419
+
420
+ ### Vedeu.ready!
421
+
422
+ @todo Add more documentation.
423
+
424
+ ### Vedeu.ready?
425
+
426
+ @todo Add more documentation.
427
+
428
+ ### Vedeu.refresh
429
+
430
+ @todo Add more documentation.
431
+
432
+ ### Vedeu.render
433
+
434
+ @todo Add more documentation.
435
+
436
+ ### Vedeu.render_output
437
+
438
+ @todo Add more documentation.
439
+
440
+ ### Vedeu.renderer
441
+
442
+ @todo Add more documentation.
443
+
444
+ ### Vedeu.renderers
445
+
446
+ Repository method. Access registered renderers.
447
+
448
+ Vedeu.renderers # [Vedeu::Renderers]
449
+
450
+ ### Vedeu.renders
451
+
452
+ @todo Add more documentation.
453
+
454
+ ### Vedeu.renders
455
+
456
+ @todo Add more documentation.
457
+
177
458
  ### Vedeu.resize
459
+
460
+ @todo Add more documentation.
461
+
462
+ ### Vedeu.show_cursor
463
+
464
+ @todo Add more documentation.
465
+
466
+ ### Vedeu.show_group
467
+
468
+ @todo Add more documentation.
469
+
470
+ ### Vedeu.show_interface
471
+
472
+ @todo Add more documentation.
473
+
178
474
  ### Vedeu.timer
475
+
476
+ @todo Add more documentation.
477
+
478
+ ### Vedeu.toggle_cursor
479
+
480
+ @todo Add more documentation.
481
+
482
+ ### Vedeu.toggle_group
483
+
484
+ @todo Add more documentation.
485
+
486
+ ### Vedeu.toggle_interface
487
+
488
+ @todo Add more documentation.
489
+
490
+ ### Vedeu.trigger
491
+
492
+ @todo Add more documentation.
493
+
494
+ ### Vedeu.unbind
495
+
496
+ @todo Add more documentation.
497
+
498
+ ### Vedeu.view
499
+
500
+ @todo Add more documentation.
501
+
502
+ ### Vedeu.views
503
+
504
+ @todo Add more documentation.
505
+
179
506
  ### Vedeu.width
507
+
508
+ @todo Add more documentation.
data/docs/group.md CHANGED
@@ -11,3 +11,43 @@ Groups.
11
11
  multiple groups.
12
12
  - They can be visible or invisible, this affects all of the members of
13
13
  the group.
14
+
15
+ ## API
16
+
17
+ ### All groups
18
+
19
+ This repository contains all the registered groups for a client
20
+ application. They can be listed via:
21
+
22
+ Vedeu.groups.all
23
+
24
+ ### An individual group
25
+
26
+ You can access an individual group by name:
27
+
28
+ Vedeu.groups.find(:name)
29
+
30
+ # or...
31
+
32
+ Vedeu.groups.by_name(:name)
33
+
34
+ ### Hiding a group
35
+
36
+ You can hide a group, and all of its interfaces/views:
37
+
38
+ Vedeu.trigger(:_hide_group_, :name)
39
+
40
+ # or...
41
+
42
+ Vedeu.hide_group(:name)
43
+
44
+ ### Showing a group
45
+
46
+ You can show a group, and all of its interfaces/views:
47
+
48
+ Vedeu.trigger(:_show_group_, :name)
49
+
50
+ # or...
51
+
52
+ Vedeu.show_group(:name)
53
+
@@ -10,10 +10,10 @@ module Vedeu
10
10
  #
11
11
  class Caption < Title
12
12
 
13
- # Overwrite the border from {#build_horizontal} on the bottom
14
- # border to include the caption if given.
13
+ # Overwrite the border from
14
+ # {Vedeu::Borders::Border#build_horizontal} on the bottom border
15
+ # to include the caption if given.
15
16
  #
16
- # @param [Array<Vedeu::Views::Char>]
17
17
  # @return [Array<Vedeu::Views::Char>]
18
18
  def render
19
19
  return chars if empty?
@@ -41,10 +41,10 @@ module Vedeu
41
41
  end
42
42
  alias_method :==, :eql?
43
43
 
44
- # Overwrite the border from {#build_horizontal} on the top
45
- # border to include the title if given.
44
+ # Overwrite the border from
45
+ # {Vedeu::Borders::Border#build_horizontal} on the top border to
46
+ # include the title if given.
46
47
  #
47
- # @param [Array<Vedeu::Views::Char>]
48
48
  # @return [Array<Vedeu::Views::Char>]
49
49
  def render
50
50
  return chars if empty?
@@ -10,6 +10,7 @@ module Vedeu
10
10
  # @!attribute [r] storage
11
11
  # @return [Hash<String => String>]
12
12
  attr_reader :storage
13
+ alias_method :all, :storage
13
14
 
14
15
  # Returns a new instance of Vedeu::Colours::Repository.
15
16
  #
@@ -185,17 +185,17 @@ module Vedeu
185
185
  #
186
186
  # @return [String]
187
187
  def rgb
188
- if Vedeu::Configuration.colour_mode == 16_777_216
189
- if registered?(colour)
190
- retrieve(colour)
188
+ if registered?(colour)
189
+ retrieve(colour)
191
190
 
192
- else
191
+ else
192
+ if Vedeu::Configuration.colour_mode == 16_777_216
193
193
  register(colour, format(rgb_prefix, *css_to_rgb))
194
194
 
195
- end
195
+ else
196
+ register(colour, numbered)
196
197
 
197
- else
198
- numbered
198
+ end
199
199
 
200
200
  end
201
201
  end
@@ -97,7 +97,7 @@ module Vedeu
97
97
 
98
98
  # @return [Vedeu::Geometries::Geometry]
99
99
  def geometry
100
- Vedeu.geometries.by_name(name)
100
+ @geometry ||= Vedeu.geometries.by_name(name)
101
101
  end
102
102
 
103
103
  # Moves the geometry left by the offset.
@@ -11,5 +11,4 @@ end # Vedeu
11
11
 
12
12
  require 'vedeu/menus/dsl'
13
13
  require 'vedeu/menus/menu'
14
- require 'vedeu/menus/null'
15
14
  require 'vedeu/menus/repository'
@@ -9,7 +9,7 @@ module Vedeu
9
9
  singleton_class.send(:alias_method, :menus, :repository)
10
10
 
11
11
  real Vedeu::Menus::Menu
12
- null Vedeu::Menus::Null
12
+ null Vedeu::Menus::Menu
13
13
 
14
14
  end # Repository
15
15
 
data/lib/vedeu/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  module Vedeu
2
2
 
3
3
  # The current version of Vedeu.
4
- VERSION = '0.6.63'.freeze
4
+ VERSION = '0.6.64'.freeze
5
5
 
6
6
  end
@@ -15,38 +15,38 @@ module Vedeu
15
15
  width: width,
16
16
  }
17
17
  }
18
- let(:height) { 10 }
18
+ let(:height) { 3 }
19
19
  let(:_name) {}
20
- let(:width) { 30 }
20
+ let(:width) { 9 }
21
21
 
22
22
  before do
23
- Vedeu.stubs(:height).returns(12)
24
- Vedeu.stubs(:width).returns(36)
23
+ Vedeu.stubs(:height).returns(4)
24
+ Vedeu.stubs(:width).returns(12)
25
25
  end
26
26
 
27
27
  describe '#initialize' do
28
28
  it { instance.must_be_instance_of(described) }
29
29
 
30
30
  context 'when the height is given' do
31
- it { instance.instance_variable_get('@height').must_equal(10) }
31
+ it { instance.instance_variable_get('@height').must_equal(3) }
32
32
  end
33
33
 
34
34
  context 'when the height not is given' do
35
35
  let(:height) {}
36
36
 
37
- it { instance.instance_variable_get('@height').must_equal(12) }
37
+ it { instance.instance_variable_get('@height').must_equal(4) }
38
38
  end
39
39
 
40
40
  it { instance.instance_variable_get('@name').must_equal(_name) }
41
41
 
42
42
  context 'when the width is given' do
43
- it { instance.instance_variable_get('@width').must_equal(30) }
43
+ it { instance.instance_variable_get('@width').must_equal(9) }
44
44
  end
45
45
 
46
46
  context 'when the width not is given' do
47
47
  let(:width) {}
48
48
 
49
- it { instance.instance_variable_get('@width').must_equal(36) }
49
+ it { instance.instance_variable_get('@width').must_equal(12) }
50
50
  end
51
51
  end
52
52
 
@@ -63,8 +63,8 @@ module Vedeu
63
63
  it { subject.first.must_be_instance_of(Array) }
64
64
  it { subject.first.first.must_be_instance_of(Vedeu::Models::Cell) }
65
65
 
66
- it { subject.size.must_equal(10) }
67
- it { subject.first.size.must_equal(30) }
66
+ it { subject.size.must_equal(3) }
67
+ it { subject.first.size.must_equal(9) }
68
68
  it { subject.first.first.position.must_equal(position) }
69
69
  end
70
70
 
@@ -41,6 +41,12 @@ module Vedeu
41
41
  end
42
42
 
43
43
  describe '#refresh' do
44
+ let(:output) {
45
+ Vedeu::Buffers::View.new(name: 'Vedeu::Buffers::Terminal')
46
+ }
47
+
48
+ before { Vedeu::Models::Page.stubs(:coerce).returns(output) }
49
+
44
50
  subject { described.refresh }
45
51
 
46
52
  it {
@@ -22,6 +22,15 @@ module Vedeu
22
22
  Vedeu::Geometries::Geometry.new(name: _name, x: 2, xn: 8, y: 2, yn: 8)
23
23
  }
24
24
 
25
+ before do
26
+ Vedeu.stubs(:trigger).with(:_movement_refresh_, _name)
27
+ Vedeu.stubs(:trigger).with(:_cursor_down_, _name)
28
+ Vedeu.stubs(:trigger).with(:_cursor_left_, _name)
29
+ Vedeu.stubs(:trigger).with(:_cursor_origin_, _name)
30
+ Vedeu.stubs(:trigger).with(:_cursor_right_, _name)
31
+ Vedeu.stubs(:trigger).with(:_cursor_up_, _name)
32
+ end
33
+
25
34
  describe '#initialize' do
26
35
  it { instance.must_be_instance_of(described) }
27
36
 
@@ -61,7 +70,6 @@ module Vedeu
61
70
  describe '.move' do
62
71
  before do
63
72
  Vedeu.geometries.stubs(:by_name).with(_name).returns(geometry)
64
- Vedeu.stubs(:trigger)
65
73
  Vedeu.stubs(:height).returns(10)
66
74
  Vedeu.stubs(:width).returns(10)
67
75
  end
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.63
4
+ version: 0.6.64
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
@@ -460,7 +460,6 @@ files:
460
460
  - lib/vedeu/menus/all.rb
461
461
  - lib/vedeu/menus/dsl.rb
462
462
  - lib/vedeu/menus/menu.rb
463
- - lib/vedeu/menus/null.rb
464
463
  - lib/vedeu/menus/repository.rb
465
464
  - lib/vedeu/models/all.rb
466
465
  - lib/vedeu/models/cell.rb
@@ -641,7 +640,6 @@ files:
641
640
  - test/lib/vedeu/logging/timer_test.rb
642
641
  - test/lib/vedeu/menus/dsl_test.rb
643
642
  - test/lib/vedeu/menus/menu_test.rb
644
- - test/lib/vedeu/menus/null_test.rb
645
643
  - test/lib/vedeu/menus/repository_test.rb
646
644
  - test/lib/vedeu/models/cell_test.rb
647
645
  - test/lib/vedeu/models/escape_test.rb
@@ -854,7 +852,6 @@ test_files:
854
852
  - test/lib/vedeu/logging/timer_test.rb
855
853
  - test/lib/vedeu/menus/dsl_test.rb
856
854
  - test/lib/vedeu/menus/menu_test.rb
857
- - test/lib/vedeu/menus/null_test.rb
858
855
  - test/lib/vedeu/menus/repository_test.rb
859
856
  - test/lib/vedeu/models/cell_test.rb
860
857
  - test/lib/vedeu/models/escape_test.rb
@@ -1,25 +0,0 @@
1
- module Vedeu
2
-
3
- module Menus
4
-
5
- # Provides a non-existent model to swallow messages.
6
- #
7
- # @api private
8
- #
9
- class Null < Vedeu::Null::Generic
10
-
11
- # Returns an instance of the Vedeu::Menus::Null class.
12
- #
13
- # @param attributes [Hash<Symbol => void>]
14
- # @option attributes name [String|Symbol|NilClass]
15
- # @return [Vedeu::Menus::Null]
16
- def initialize(attributes = {})
17
- @attributes = attributes
18
- @name = @attributes[:name]
19
- end
20
-
21
- end # Null
22
-
23
- end # Menus
24
-
25
- end # Vedeu
@@ -1,30 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Menus
6
-
7
- describe Null do
8
-
9
- let(:described) { Vedeu::Menus::Null }
10
- let(:instance) { described.new(attributes) }
11
- let(:_name) { 'null_menu' }
12
- let(:attributes) {
13
- {
14
- name: _name
15
- }
16
- }
17
-
18
- describe '#initialize' do
19
- it { instance.must_be_instance_of(described) }
20
- it {
21
- instance.instance_variable_get('@attributes').must_equal(attributes)
22
- }
23
- it { instance.instance_variable_get('@name').must_equal(_name) }
24
- end
25
-
26
- end # Null
27
-
28
- end # Menus
29
-
30
- end # Vedeu