vedeu 0.0.17 → 0.0.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -5
  3. data/lib/vedeu.rb +6 -6
  4. data/lib/vedeu/application.rb +1 -1
  5. data/lib/vedeu/{process → input}/input.rb +0 -0
  6. data/lib/vedeu/output/background.rb +6 -2
  7. data/lib/vedeu/output/base.rb +8 -0
  8. data/lib/vedeu/output/compositor.rb +1 -1
  9. data/lib/vedeu/output/cursor.rb +49 -53
  10. data/lib/vedeu/output/esc.rb +40 -40
  11. data/lib/vedeu/output/foreground.rb +6 -2
  12. data/lib/vedeu/output/output.rb +19 -0
  13. data/lib/vedeu/process/process.rb +1 -1
  14. data/lib/vedeu/repository/interface.rb +12 -5
  15. data/lib/vedeu/repository/interface_repository.rb +8 -8
  16. data/lib/vedeu/{process → support}/event_loop.rb +0 -0
  17. data/lib/vedeu/{process → support}/exit.rb +0 -0
  18. data/lib/vedeu/{process → support}/queue.rb +4 -0
  19. data/lib/vedeu/support/terminal.rb +2 -0
  20. data/lib/vedeu/version.rb +1 -1
  21. data/test/lib/vedeu/application_test.rb +1 -1
  22. data/test/lib/vedeu/{process → input}/input_test.rb +0 -0
  23. data/test/lib/vedeu/output/background_test.rb +1 -1
  24. data/test/lib/vedeu/output/colour_test.rb +2 -2
  25. data/test/lib/vedeu/output/compositor_test.rb +50 -35
  26. data/test/lib/vedeu/output/cursor_test.rb +0 -12
  27. data/test/lib/vedeu/output/foreground_test.rb +1 -1
  28. data/test/lib/vedeu/output/output_test.rb +26 -0
  29. data/test/lib/vedeu/process/process_test.rb +7 -3
  30. data/test/lib/vedeu/repository/interface_repository_test.rb +4 -10
  31. data/test/lib/vedeu/repository/interface_test.rb +4 -6
  32. data/test/lib/vedeu/{process → support}/event_loop_test.rb +0 -0
  33. data/test/lib/vedeu/{process → support}/exit_test.rb +0 -0
  34. data/test/lib/vedeu/{process → support}/queue_test.rb +25 -6
  35. data/test/lib/vedeu/support/terminal_test.rb +35 -43
  36. metadata +17 -20
  37. data/lib/vedeu/output/renderer.rb +0 -21
  38. data/lib/vedeu/process/output.rb +0 -25
  39. data/test/lib/vedeu/output/renderer_test.rb +0 -37
  40. data/test/lib/vedeu/process/output_test.rb +0 -41
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.0.17
4
+ version: 0.0.18
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-06-16 00:00:00.000000000 Z
11
+ date: 2014-06-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -210,6 +210,7 @@ files:
210
210
  - features/support/env.rb
211
211
  - lib/vedeu.rb
212
212
  - lib/vedeu/application.rb
213
+ - lib/vedeu/input/input.rb
213
214
  - lib/vedeu/launcher.rb
214
215
  - lib/vedeu/output/background.rb
215
216
  - lib/vedeu/output/base.rb
@@ -221,17 +222,12 @@ files:
221
222
  - lib/vedeu/output/esc.rb
222
223
  - lib/vedeu/output/foreground.rb
223
224
  - lib/vedeu/output/geometry.rb
225
+ - lib/vedeu/output/output.rb
224
226
  - lib/vedeu/output/position.rb
225
- - lib/vedeu/output/renderer.rb
226
227
  - lib/vedeu/output/style.rb
227
228
  - lib/vedeu/output/translator.rb
228
229
  - lib/vedeu/output/wordwrap.rb
229
- - lib/vedeu/process/event_loop.rb
230
- - lib/vedeu/process/exit.rb
231
- - lib/vedeu/process/input.rb
232
- - lib/vedeu/process/output.rb
233
230
  - lib/vedeu/process/process.rb
234
- - lib/vedeu/process/queue.rb
235
231
  - lib/vedeu/repository/command.rb
236
232
  - lib/vedeu/repository/command_repository.rb
237
233
  - lib/vedeu/repository/dummy_command.rb
@@ -240,9 +236,13 @@ files:
240
236
  - lib/vedeu/repository/interface_repository.rb
241
237
  - lib/vedeu/repository/repository.rb
242
238
  - lib/vedeu/repository/storage.rb
239
+ - lib/vedeu/support/event_loop.rb
240
+ - lib/vedeu/support/exit.rb
241
+ - lib/vedeu/support/queue.rb
243
242
  - lib/vedeu/support/terminal.rb
244
243
  - lib/vedeu/version.rb
245
244
  - test/lib/vedeu/application_test.rb
245
+ - test/lib/vedeu/input/input_test.rb
246
246
  - test/lib/vedeu/launcher_test.rb
247
247
  - test/lib/vedeu/output/background_test.rb
248
248
  - test/lib/vedeu/output/base_test.rb
@@ -254,17 +254,12 @@ files:
254
254
  - test/lib/vedeu/output/esc_test.rb
255
255
  - test/lib/vedeu/output/foreground_test.rb
256
256
  - test/lib/vedeu/output/geometry_test.rb
257
+ - test/lib/vedeu/output/output_test.rb
257
258
  - test/lib/vedeu/output/position_test.rb
258
- - test/lib/vedeu/output/renderer_test.rb
259
259
  - test/lib/vedeu/output/style_test.rb
260
260
  - test/lib/vedeu/output/translator_test.rb
261
261
  - test/lib/vedeu/output/wordwrap_test.rb
262
- - test/lib/vedeu/process/event_loop_test.rb
263
- - test/lib/vedeu/process/exit_test.rb
264
- - test/lib/vedeu/process/input_test.rb
265
- - test/lib/vedeu/process/output_test.rb
266
262
  - test/lib/vedeu/process/process_test.rb
267
- - test/lib/vedeu/process/queue_test.rb
268
263
  - test/lib/vedeu/repository/command_repository_test.rb
269
264
  - test/lib/vedeu/repository/command_test.rb
270
265
  - test/lib/vedeu/repository/dummy_command_test.rb
@@ -273,6 +268,9 @@ files:
273
268
  - test/lib/vedeu/repository/interface_test.rb
274
269
  - test/lib/vedeu/repository/repository_test.rb
275
270
  - test/lib/vedeu/repository/storage_test.rb
271
+ - test/lib/vedeu/support/event_loop_test.rb
272
+ - test/lib/vedeu/support/exit_test.rb
273
+ - test/lib/vedeu/support/queue_test.rb
276
274
  - test/lib/vedeu/support/terminal_test.rb
277
275
  - test/lib/vedeu/version_test.rb
278
276
  - test/lib/vedeu_test.rb
@@ -308,6 +306,7 @@ test_files:
308
306
  - features/step_definitions/vedeu_steps.rb
309
307
  - features/support/env.rb
310
308
  - test/lib/vedeu/application_test.rb
309
+ - test/lib/vedeu/input/input_test.rb
311
310
  - test/lib/vedeu/launcher_test.rb
312
311
  - test/lib/vedeu/output/background_test.rb
313
312
  - test/lib/vedeu/output/base_test.rb
@@ -319,17 +318,12 @@ test_files:
319
318
  - test/lib/vedeu/output/esc_test.rb
320
319
  - test/lib/vedeu/output/foreground_test.rb
321
320
  - test/lib/vedeu/output/geometry_test.rb
321
+ - test/lib/vedeu/output/output_test.rb
322
322
  - test/lib/vedeu/output/position_test.rb
323
- - test/lib/vedeu/output/renderer_test.rb
324
323
  - test/lib/vedeu/output/style_test.rb
325
324
  - test/lib/vedeu/output/translator_test.rb
326
325
  - test/lib/vedeu/output/wordwrap_test.rb
327
- - test/lib/vedeu/process/event_loop_test.rb
328
- - test/lib/vedeu/process/exit_test.rb
329
- - test/lib/vedeu/process/input_test.rb
330
- - test/lib/vedeu/process/output_test.rb
331
326
  - test/lib/vedeu/process/process_test.rb
332
- - test/lib/vedeu/process/queue_test.rb
333
327
  - test/lib/vedeu/repository/command_repository_test.rb
334
328
  - test/lib/vedeu/repository/command_test.rb
335
329
  - test/lib/vedeu/repository/dummy_command_test.rb
@@ -338,6 +332,9 @@ test_files:
338
332
  - test/lib/vedeu/repository/interface_test.rb
339
333
  - test/lib/vedeu/repository/repository_test.rb
340
334
  - test/lib/vedeu/repository/storage_test.rb
335
+ - test/lib/vedeu/support/event_loop_test.rb
336
+ - test/lib/vedeu/support/exit_test.rb
337
+ - test/lib/vedeu/support/queue_test.rb
341
338
  - test/lib/vedeu/support/terminal_test.rb
342
339
  - test/lib/vedeu/version_test.rb
343
340
  - test/lib/vedeu_test.rb
@@ -1,21 +0,0 @@
1
- module Vedeu
2
- class Renderer
3
- class << self
4
- def write(composition)
5
- new(composition).write
6
- end
7
- end
8
-
9
- def initialize(composition)
10
- @composition = composition
11
- end
12
-
13
- def write
14
- composition.map { |stream| Terminal.output(stream) }
15
- end
16
-
17
- private
18
-
19
- attr_reader :composition
20
- end
21
- end
@@ -1,25 +0,0 @@
1
- module Vedeu
2
- class Output
3
- class << self
4
- def render
5
- new.render
6
- end
7
- end
8
-
9
- def initialize; end
10
-
11
- def render
12
- Compositor.arrange(result) unless empty?
13
- end
14
-
15
- private
16
-
17
- def empty?
18
- result.nil? || result.empty?
19
- end
20
-
21
- def result
22
- @result ||= Queue.dequeue
23
- end
24
- end
25
- end
@@ -1,37 +0,0 @@
1
- require_relative '../../../test_helper'
2
-
3
- module Vedeu
4
- describe Renderer do
5
- let(:described_class) { Renderer }
6
- let(:described_instance) { described_class.new(composition) }
7
- let(:composition) { [] }
8
-
9
- it 'returns a Renderer instance' do
10
- described_instance.must_be_instance_of(Renderer)
11
- end
12
-
13
- describe '.write' do
14
- let(:subject) { described_class.write(composition) }
15
-
16
- it 'returns an Array' do
17
- subject.must_be_instance_of(Array)
18
- end
19
-
20
- it 'returns an empty array' do
21
- subject.must_equal([])
22
- end
23
-
24
- context 'capturing i/o' do
25
- let(:captured) { capture_io { subject }.join }
26
-
27
- it 'returns a String' do
28
- captured.must_be_instance_of(String)
29
- end
30
-
31
- it 'returns an empty string' do
32
- captured.must_equal("")
33
- end
34
- end
35
- end
36
- end
37
- end
@@ -1,41 +0,0 @@
1
- require_relative '../../../test_helper'
2
-
3
- module Vedeu
4
- describe Output do
5
- let(:described_class) { Output }
6
- let(:subject) { described_class.new }
7
- let(:result) {}
8
-
9
- before do
10
- Interface.create({ name: 'dummy' })
11
- Compositor.stubs(:arrange).returns([])
12
- Queue.stubs(:dequeue).returns(result)
13
- end
14
-
15
- it 'returns an Output instance' do
16
- subject.must_be_instance_of(Output)
17
- end
18
-
19
- describe '.render' do
20
- let(:subject) { described_class.render }
21
-
22
- it 'returns a NilClass' do
23
- subject.must_be_instance_of(NilClass)
24
- end
25
-
26
- context 'when the result is empty' do
27
- it 'returns a NilClass' do
28
- subject.must_be_instance_of(NilClass)
29
- end
30
- end
31
-
32
- context 'when the result is not empty' do
33
- let(:result) { { 'dummy' => [['test...']] } }
34
-
35
- it 'returns an Array' do
36
- subject.must_be_instance_of(Array)
37
- end
38
- end
39
- end
40
- end
41
- end