vedeu 0.0.30 → 0.0.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +4 -4
  3. data/lib/vedeu/configuration.rb +2 -2
  4. data/lib/vedeu/launcher.rb +2 -2
  5. data/lib/vedeu/models/command.rb +1 -1
  6. data/lib/vedeu/models/interface.rb +4 -0
  7. data/lib/vedeu/output/interface_renderer.rb +1 -1
  8. data/lib/vedeu/output/template.rb +23 -0
  9. data/lib/vedeu/output/text_adaptor.rb +1 -1
  10. data/lib/vedeu/process/process.rb +5 -1
  11. data/lib/vedeu/repository/command_repository.rb +3 -5
  12. data/lib/vedeu/repository/event_repository.rb +27 -0
  13. data/lib/vedeu/repository/interface_repository.rb +8 -6
  14. data/lib/vedeu/repository/storage.rb +2 -0
  15. data/lib/vedeu/support/esc.rb +2 -1
  16. data/lib/vedeu/support/geometry.rb +11 -23
  17. data/lib/vedeu/support/parser.rb +1 -1
  18. data/lib/vedeu/support/queue.rb +3 -1
  19. data/lib/vedeu.rb +18 -1
  20. data/test/example_app/bin/app +9 -0
  21. data/test/example_app/lib/app.rb +63 -0
  22. data/test/lib/vedeu/application_test.rb +6 -36
  23. data/test/lib/vedeu/configuration_test.rb +5 -31
  24. data/test/lib/vedeu/input/input_test.rb +4 -16
  25. data/test/lib/vedeu/launcher_test.rb +6 -15
  26. data/test/lib/vedeu/models/background_test.rb +5 -21
  27. data/test/lib/vedeu/models/colour_test.rb +18 -49
  28. data/test/lib/vedeu/models/command_test.rb +19 -83
  29. data/test/lib/vedeu/models/composition_test.rb +78 -175
  30. data/test/lib/vedeu/models/foreground_test.rb +4 -21
  31. data/test/lib/vedeu/models/interface_collection_test.rb +13 -45
  32. data/test/lib/vedeu/models/interface_test.rb +71 -195
  33. data/test/lib/vedeu/models/line_collection_test.rb +13 -52
  34. data/test/lib/vedeu/models/line_test.rb +17 -61
  35. data/test/lib/vedeu/models/presentation_test.rb +6 -19
  36. data/test/lib/vedeu/models/stream_collection_test.rb +10 -42
  37. data/test/lib/vedeu/models/stream_test.rb +16 -54
  38. data/test/lib/vedeu/models/style_collection_test.rb +1 -10
  39. data/test/lib/vedeu/output/interface_renderer_test.rb +7 -38
  40. data/test/lib/vedeu/output/output_test.rb +1 -18
  41. data/test/lib/vedeu/output/template.rb +20 -0
  42. data/test/lib/vedeu/output/text_adaptor_test.rb +9 -46
  43. data/test/lib/vedeu/process/process_test.rb +36 -38
  44. data/test/lib/vedeu/repository/command_repository_test.rb +16 -45
  45. data/test/lib/vedeu/repository/interface_repository_test.rb +36 -74
  46. data/test/lib/vedeu/repository/repository_test.rb +9 -33
  47. data/test/lib/vedeu/repository/storage_test.rb +7 -42
  48. data/test/lib/vedeu/support/esc_test.rb +46 -130
  49. data/test/lib/vedeu/support/event_repository_test.rb +31 -0
  50. data/test/lib/vedeu/support/exit_test.rb +1 -9
  51. data/test/lib/vedeu/support/geometry_test.rb +81 -105
  52. data/test/lib/vedeu/support/parser_test.rb +10 -54
  53. data/test/lib/vedeu/support/parsing/hash_parser_test.rb +18 -33
  54. data/test/lib/vedeu/support/parsing/json_parser_test.rb +4 -23
  55. data/test/lib/vedeu/support/queue_test.rb +33 -57
  56. data/test/lib/vedeu/support/terminal_test.rb +21 -52
  57. data/test/lib/vedeu/support/translator_test.rb +16 -33
  58. data/test/lib/vedeu/support/wordwrap_test.rb +29 -46
  59. data/test/lib/vedeu_test.rb +3 -5
  60. data/test/support/template.erb +3 -0
  61. data/test/test_helper.rb +1 -12
  62. data/vedeu.gemspec +8 -10
  63. metadata +26 -38
  64. data/lib/vedeu/support/events.rb +0 -21
  65. data/lib/vedeu/version.rb +0 -3
  66. data/test/lib/vedeu/support/events_test.rb +0 -45
  67. data/test/lib/vedeu/version_test.rb +0 -12
  68. data/test/support/output_1.json +0 -9
  69. data/test/support/output_1.rb +0 -14
data/vedeu.gemspec CHANGED
@@ -1,11 +1,10 @@
1
1
  # coding: utf-8
2
2
  lib = File.expand_path('../lib', __FILE__)
3
3
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'vedeu/version'
5
4
 
6
5
  Gem::Specification.new do |spec|
7
6
  spec.name = 'vedeu'
8
- spec.version = Vedeu::VERSION
7
+ spec.version = '0.0.31'
9
8
  spec.authors = ['Gavin Laking']
10
9
  spec.email = ['gavinlaking@gmail.com']
11
10
  spec.summary = %q{A terminal case of wonderland.}
@@ -17,17 +16,16 @@ Gem::Specification.new do |spec|
17
16
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
18
17
  spec.require_paths = ['lib']
19
18
 
20
- spec.add_development_dependency 'bundler', '~> 1.5'
19
+ spec.add_development_dependency 'bundler', '~> 1.6'
21
20
  spec.add_development_dependency 'guard', '2.6.1'
22
- spec.add_development_dependency 'guard-minitest', '2.3.0'
23
- spec.add_development_dependency 'minitest', '5.3.4'
24
- spec.add_development_dependency 'minitest-reporters', '1.0.4'
25
- spec.add_development_dependency 'mocha', '1.1.0'
21
+ spec.add_development_dependency 'guard-minitest', '2.3.1'
22
+ spec.add_development_dependency 'minitest', '5.4.0'
23
+ spec.add_development_dependency 'minitest-reporters', '1.0.5'
26
24
  spec.add_development_dependency 'pry', '0.10.0'
27
25
  spec.add_development_dependency 'rake', '10.3.2'
28
- spec.add_development_dependency 'ruby-prof', '0.14.2'
26
+ spec.add_development_dependency 'ruby-prof', '0.15.1'
29
27
  spec.add_development_dependency 'simplecov', '0.8.2'
30
28
 
31
- spec.add_dependency "oj", '2.9.8'
32
- spec.add_dependency "virtus", '1.0.2'
29
+ spec.add_dependency 'oj', '2.9.9'
30
+ spec.add_dependency 'virtus', '1.0.2'
33
31
  end
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.30
4
+ version: 0.0.31
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-07-10 00:00:00.000000000 Z
11
+ date: 2014-07-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: '1.5'
19
+ version: '1.6'
20
20
  type: :development
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: '1.5'
26
+ version: '1.6'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: guard
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -44,56 +44,42 @@ dependencies:
44
44
  requirements:
45
45
  - - '='
46
46
  - !ruby/object:Gem::Version
47
- version: 2.3.0
47
+ version: 2.3.1
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - '='
53
53
  - !ruby/object:Gem::Version
54
- version: 2.3.0
54
+ version: 2.3.1
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: minitest
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 5.3.4
61
+ version: 5.4.0
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.3.4
68
+ version: 5.4.0
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: minitest-reporters
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - '='
74
74
  - !ruby/object:Gem::Version
75
- version: 1.0.4
75
+ version: 1.0.5
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - '='
81
81
  - !ruby/object:Gem::Version
82
- version: 1.0.4
83
- - !ruby/object:Gem::Dependency
84
- name: mocha
85
- requirement: !ruby/object:Gem::Requirement
86
- requirements:
87
- - - '='
88
- - !ruby/object:Gem::Version
89
- version: 1.1.0
90
- type: :development
91
- prerelease: false
92
- version_requirements: !ruby/object:Gem::Requirement
93
- requirements:
94
- - - '='
95
- - !ruby/object:Gem::Version
96
- version: 1.1.0
82
+ version: 1.0.5
97
83
  - !ruby/object:Gem::Dependency
98
84
  name: pry
99
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +114,14 @@ dependencies:
128
114
  requirements:
129
115
  - - '='
130
116
  - !ruby/object:Gem::Version
131
- version: 0.14.2
117
+ version: 0.15.1
132
118
  type: :development
133
119
  prerelease: false
134
120
  version_requirements: !ruby/object:Gem::Requirement
135
121
  requirements:
136
122
  - - '='
137
123
  - !ruby/object:Gem::Version
138
- version: 0.14.2
124
+ version: 0.15.1
139
125
  - !ruby/object:Gem::Dependency
140
126
  name: simplecov
141
127
  requirement: !ruby/object:Gem::Requirement
@@ -156,14 +142,14 @@ dependencies:
156
142
  requirements:
157
143
  - - '='
158
144
  - !ruby/object:Gem::Version
159
- version: 2.9.8
145
+ version: 2.9.9
160
146
  type: :runtime
161
147
  prerelease: false
162
148
  version_requirements: !ruby/object:Gem::Requirement
163
149
  requirements:
164
150
  - - '='
165
151
  - !ruby/object:Gem::Version
166
- version: 2.9.8
152
+ version: 2.9.9
167
153
  - !ruby/object:Gem::Dependency
168
154
  name: virtus
169
155
  requirement: !ruby/object:Gem::Requirement
@@ -215,14 +201,15 @@ files:
215
201
  - lib/vedeu/models/style_collection.rb
216
202
  - lib/vedeu/output/interface_renderer.rb
217
203
  - lib/vedeu/output/output.rb
204
+ - lib/vedeu/output/template.rb
218
205
  - lib/vedeu/output/text_adaptor.rb
219
206
  - lib/vedeu/process/process.rb
220
207
  - lib/vedeu/repository/command_repository.rb
208
+ - lib/vedeu/repository/event_repository.rb
221
209
  - lib/vedeu/repository/interface_repository.rb
222
210
  - lib/vedeu/repository/repository.rb
223
211
  - lib/vedeu/repository/storage.rb
224
212
  - lib/vedeu/support/esc.rb
225
- - lib/vedeu/support/events.rb
226
213
  - lib/vedeu/support/exit.rb
227
214
  - lib/vedeu/support/geometry.rb
228
215
  - lib/vedeu/support/parser.rb
@@ -232,8 +219,9 @@ files:
232
219
  - lib/vedeu/support/terminal.rb
233
220
  - lib/vedeu/support/translator.rb
234
221
  - lib/vedeu/support/wordwrap.rb
235
- - lib/vedeu/version.rb
236
222
  - logs/.gitkeep
223
+ - test/example_app/bin/app
224
+ - test/example_app/lib/app.rb
237
225
  - test/lib/vedeu/application_test.rb
238
226
  - test/lib/vedeu/configuration_test.rb
239
227
  - test/lib/vedeu/input/input_test.rb
@@ -253,6 +241,7 @@ files:
253
241
  - test/lib/vedeu/models/style_collection_test.rb
254
242
  - test/lib/vedeu/output/interface_renderer_test.rb
255
243
  - test/lib/vedeu/output/output_test.rb
244
+ - test/lib/vedeu/output/template.rb
256
245
  - test/lib/vedeu/output/text_adaptor_test.rb
257
246
  - test/lib/vedeu/process/process_test.rb
258
247
  - test/lib/vedeu/repository/command_repository_test.rb
@@ -260,7 +249,7 @@ files:
260
249
  - test/lib/vedeu/repository/repository_test.rb
261
250
  - test/lib/vedeu/repository/storage_test.rb
262
251
  - test/lib/vedeu/support/esc_test.rb
263
- - test/lib/vedeu/support/events_test.rb
252
+ - test/lib/vedeu/support/event_repository_test.rb
264
253
  - test/lib/vedeu/support/exit_test.rb
265
254
  - test/lib/vedeu/support/geometry_test.rb
266
255
  - test/lib/vedeu/support/parser_test.rb
@@ -270,7 +259,6 @@ files:
270
259
  - test/lib/vedeu/support/terminal_test.rb
271
260
  - test/lib/vedeu/support/translator_test.rb
272
261
  - test/lib/vedeu/support/wordwrap_test.rb
273
- - test/lib/vedeu/version_test.rb
274
262
  - test/lib/vedeu_test.rb
275
263
  - test/support/colours.rb
276
264
  - test/support/dummy_command.rb
@@ -285,8 +273,7 @@ files:
285
273
  - test/support/json/int2_lin2_str1.json
286
274
  - test/support/json/int2_lin2_str3.json
287
275
  - test/support/json/int2_lin2_str3_styles.json
288
- - test/support/output_1.json
289
- - test/support/output_1.rb
276
+ - test/support/template.erb
290
277
  - test/test_helper.rb
291
278
  - vedeu.gemspec
292
279
  homepage: http://www.gavinlaking.name/
@@ -314,6 +301,8 @@ signing_key:
314
301
  specification_version: 4
315
302
  summary: A terminal case of wonderland.
316
303
  test_files:
304
+ - test/example_app/bin/app
305
+ - test/example_app/lib/app.rb
317
306
  - test/lib/vedeu/application_test.rb
318
307
  - test/lib/vedeu/configuration_test.rb
319
308
  - test/lib/vedeu/input/input_test.rb
@@ -333,6 +322,7 @@ test_files:
333
322
  - test/lib/vedeu/models/style_collection_test.rb
334
323
  - test/lib/vedeu/output/interface_renderer_test.rb
335
324
  - test/lib/vedeu/output/output_test.rb
325
+ - test/lib/vedeu/output/template.rb
336
326
  - test/lib/vedeu/output/text_adaptor_test.rb
337
327
  - test/lib/vedeu/process/process_test.rb
338
328
  - test/lib/vedeu/repository/command_repository_test.rb
@@ -340,7 +330,7 @@ test_files:
340
330
  - test/lib/vedeu/repository/repository_test.rb
341
331
  - test/lib/vedeu/repository/storage_test.rb
342
332
  - test/lib/vedeu/support/esc_test.rb
343
- - test/lib/vedeu/support/events_test.rb
333
+ - test/lib/vedeu/support/event_repository_test.rb
344
334
  - test/lib/vedeu/support/exit_test.rb
345
335
  - test/lib/vedeu/support/geometry_test.rb
346
336
  - test/lib/vedeu/support/parser_test.rb
@@ -350,7 +340,6 @@ test_files:
350
340
  - test/lib/vedeu/support/terminal_test.rb
351
341
  - test/lib/vedeu/support/translator_test.rb
352
342
  - test/lib/vedeu/support/wordwrap_test.rb
353
- - test/lib/vedeu/version_test.rb
354
343
  - test/lib/vedeu_test.rb
355
344
  - test/support/colours.rb
356
345
  - test/support/dummy_command.rb
@@ -365,7 +354,6 @@ test_files:
365
354
  - test/support/json/int2_lin2_str1.json
366
355
  - test/support/json/int2_lin2_str3.json
367
356
  - test/support/json/int2_lin2_str3_styles.json
368
- - test/support/output_1.json
369
- - test/support/output_1.rb
357
+ - test/support/template.erb
370
358
  - test/test_helper.rb
371
359
  has_rdoc:
@@ -1,21 +0,0 @@
1
- module Vedeu
2
- class Events
3
- def initialize
4
- @handlers = Hash.new { |h, k| h[k] = [] }
5
- end
6
-
7
- def on(event, &block)
8
- handlers[event] << block
9
- end
10
-
11
- def trigger(event, *args)
12
- handlers[event].each do |handler|
13
- handler.call(*args)
14
- end
15
- end
16
-
17
- private
18
-
19
- attr_accessor :handlers
20
- end
21
- end
data/lib/vedeu/version.rb DELETED
@@ -1,3 +0,0 @@
1
- module Vedeu
2
- VERSION = '0.0.30'
3
- end
@@ -1,45 +0,0 @@
1
- require_relative '../../../test_helper'
2
- require_relative '../../../../lib/vedeu/support/events'
3
-
4
- module Vedeu
5
- describe Events do
6
- let(:described_class) { Events }
7
- let(:described_instance) { described_class.new }
8
-
9
- describe '#initialize' do
10
- let(:subject) { described_instance }
11
-
12
- it 'returns an Events instance' do
13
- subject.must_be_instance_of(Events)
14
- end
15
-
16
- it 'sets an instance variable' do
17
- subject.instance_variable_get('@handlers')
18
- .must_be_instance_of(Hash)
19
- end
20
- end
21
-
22
- describe '#on' do
23
- let(:subject) { described_instance.on(event) { proc { |x, y| x + y } } }
24
- let(:event) { :some_event }
25
-
26
- it 'returns an Array' do
27
- subject.must_be_instance_of(Array)
28
- end
29
- end
30
-
31
- describe '#trigger' do
32
- let(:subject) { described_instance.trigger(event, args) }
33
- let(:event) { :some_event }
34
- let(:args) { :arg }
35
-
36
- before do
37
- described_instance.on(:some_event) { proc { |x| x } }
38
- end
39
-
40
- it 'returns an Array' do
41
- subject.must_be_instance_of(Array)
42
- end
43
- end
44
- end
45
- end
@@ -1,12 +0,0 @@
1
- require_relative '../../test_helper'
2
- require_relative '../../../lib/vedeu/version'
3
-
4
- module Vedeu
5
- describe VERSION do
6
- let(:described_class) { VERSION }
7
-
8
- it 'returns a String' do
9
- described_class.must_be_instance_of(String)
10
- end
11
- end
12
- end
@@ -1,9 +0,0 @@
1
- {
2
- ":interfaces":{
3
- ":name":"dummy",":lines":{
4
- ":streams":{
5
- ":text":"Some text..."
6
- }
7
- }
8
- }
9
- }
@@ -1,14 +0,0 @@
1
- {
2
- interface: {
3
- name: 'dummy',
4
- lines: [
5
- {
6
- streams: [
7
- {
8
- text: 'Some text...'
9
- }
10
- ]
11
- }
12
- ]
13
- }
14
- }