vedeu 0.4.15 → 0.4.16

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/.gitignore +1 -0
  3. data/examples/borders_app.rb +0 -2
  4. data/examples/colours_app.rb +0 -2
  5. data/examples/cursor_app.rb +0 -2
  6. data/examples/drb_app.rb +0 -2
  7. data/examples/focus_app.rb +0 -2
  8. data/examples/geometry_app.rb +0 -2
  9. data/examples/hello_world.rb +0 -2
  10. data/examples/lines_app.rb +0 -2
  11. data/examples/material_colours_app.rb +0 -2
  12. data/lib/vedeu/bindings.rb +2 -1
  13. data/lib/vedeu/buffers/buffer.rb +18 -10
  14. data/lib/vedeu/debug.rb +2 -1
  15. data/lib/vedeu/distributed/server.rb +14 -8
  16. data/lib/vedeu/dsl/composition.rb +3 -10
  17. data/lib/vedeu/dsl/line.rb +14 -11
  18. data/lib/vedeu/dsl/shared/colour.rb +2 -3
  19. data/lib/vedeu/geometry/coordinate.rb +0 -4
  20. data/lib/vedeu/geometry/position.rb +2 -1
  21. data/lib/vedeu/main_loop.rb +1 -1
  22. data/lib/vedeu/models/all.rb +2 -0
  23. data/lib/vedeu/models/char.rb +4 -6
  24. data/lib/vedeu/models/composition.rb +4 -2
  25. data/lib/vedeu/models/interface.rb +4 -18
  26. data/lib/vedeu/models/line.rb +4 -3
  27. data/lib/vedeu/models/null_interface.rb +15 -0
  28. data/lib/vedeu/models/stream.rb +4 -3
  29. data/lib/vedeu/output/border.rb +9 -12
  30. data/lib/vedeu/output/clear.rb +2 -2
  31. data/lib/vedeu/output/colour.rb +30 -8
  32. data/lib/vedeu/output/esc.rb +2 -1
  33. data/lib/vedeu/output/presentation.rb +37 -20
  34. data/lib/vedeu/output/renderers/all.rb +1 -0
  35. data/lib/vedeu/output/renderers/escape_sequence_renderer.rb +40 -0
  36. data/lib/vedeu/output/renderers/file_renderer.rb +9 -5
  37. data/lib/vedeu/output/renderers/html_renderer.rb +1 -1
  38. data/lib/vedeu/output/text.rb +1 -15
  39. data/lib/vedeu/output/viewport.rb +1 -1
  40. data/lib/vedeu/repositories/repositories/borders.rb +11 -11
  41. data/lib/vedeu/repositories/repositories/buffers.rb +11 -11
  42. data/lib/vedeu/repositories/repositories/cursors.rb +15 -15
  43. data/lib/vedeu/repositories/repositories/events_repository.rb +11 -11
  44. data/lib/vedeu/repositories/repositories/geometries.rb +11 -11
  45. data/lib/vedeu/repositories/repositories/groups.rb +11 -11
  46. data/lib/vedeu/repositories/repositories/interfaces_repository.rb +23 -10
  47. data/lib/vedeu/repositories/repositories/keymaps.rb +11 -11
  48. data/lib/vedeu/repositories/repositories/menus.rb +11 -11
  49. data/test/lib/vedeu/buffers/buffer_test.rb +4 -6
  50. data/test/lib/vedeu/distributed/server_test.rb +101 -3
  51. data/test/lib/vedeu/dsl/view_test.rb +6 -0
  52. data/test/lib/vedeu/input/input_test.rb +1 -1
  53. data/test/lib/vedeu/models/char_test.rb +18 -2
  54. data/test/lib/vedeu/models/composition_test.rb +0 -2
  55. data/test/lib/vedeu/models/interface_test.rb +12 -17
  56. data/test/lib/vedeu/models/line_test.rb +0 -2
  57. data/test/lib/vedeu/models/null_interface_test.rb +9 -0
  58. data/test/lib/vedeu/models/stream_test.rb +0 -2
  59. data/test/lib/vedeu/output/border_test.rb +2 -4
  60. data/test/lib/vedeu/output/clear_test.rb +17 -0
  61. data/test/lib/vedeu/output/colour_test.rb +139 -0
  62. data/test/lib/vedeu/output/output_test.rb +15 -13
  63. data/test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb +46 -0
  64. data/test/lib/vedeu/output/renderers/file_renderer_test.rb +27 -4
  65. data/test/lib/vedeu/output/renderers/html_renderer_test.rb +14 -3
  66. data/test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb +8 -0
  67. data/test/test_helper.rb +3 -2
  68. data/vedeu.gemspec +4 -4
  69. metadata +18 -10
@@ -5,18 +5,41 @@ module Vedeu
5
5
  describe FileRenderer do
6
6
 
7
7
  let(:described) { Vedeu::FileRenderer }
8
- let(:instance) { described.new(output) }
8
+ let(:instance) { described.new(output, options) }
9
9
  let(:output) {}
10
+ let(:options) {
11
+ {
12
+ timestamp: timestamp
13
+ }
14
+ }
15
+ let(:timestamp) { true }
10
16
 
11
17
  describe '#initialize' do
12
18
  it { instance.must_be_instance_of(Vedeu::FileRenderer) }
13
- it { instance.instance_variable_get('@output').must_equal([output]) }
19
+ it { instance.instance_variable_get('@output').must_equal(output) }
20
+ it { instance.instance_variable_get('@options').must_equal(options) }
14
21
  end
15
22
 
16
23
  describe '.render' do
17
- subject { described.render }
24
+ let(:_time) { Time.new(2015, 4, 12, 20, 05) }
18
25
 
19
- # it { subject.must_be_instance_of(Fixnum) }
26
+ before { File.stubs(:open) }
27
+
28
+ subject { described.render(output, options) }
29
+
30
+ it { subject.must_be_instance_of(String) }
31
+
32
+ # context 'when the timestamp option is true' do
33
+ # before { Time.stubs(:now).returns(_time) }
34
+
35
+ # it { File.expects(:open).with('/tmp/out_1428865500.0', 'w'); subject }
36
+ # end
37
+
38
+ # context 'when the timestamp option is false' do
39
+ # let(:timestamp) { false }
40
+
41
+ # it { File.expects(:open).with('/tmp/out', 'w'); subject }
42
+ # end
20
43
  end
21
44
 
22
45
  end # FileRenderer
@@ -13,8 +13,10 @@ module Vedeu
13
13
  it { instance.instance_variable_get('@output').must_equal(output) }
14
14
  end
15
15
 
16
- describe '#render' do
17
- subject { instance.render }
16
+ describe '.render' do
17
+ before { File.stubs(:open) }
18
+
19
+ subject { described.render(output) }
18
20
 
19
21
  it { subject.must_be_instance_of(String) }
20
22
  end
@@ -27,13 +29,22 @@ module Vedeu
27
29
  context 'when a path is given' do
28
30
  let(:path) { '/tmp/test_vedeu_html_renderer.html' }
29
31
 
30
- # it { subject.must_equal('') }
32
+ it do
33
+ File.expects(:open)
34
+ subject
35
+ end
31
36
  end
32
37
 
33
38
  context 'when a path is not given' do
34
39
  let(:path) {}
40
+ let(:_time) { Time.new(2015, 4, 12, 16, 55) }
35
41
 
42
+ before { Time.stubs(:now).returns(_time) }
36
43
 
44
+ it do
45
+ File.expects(:open)#.with('/tmp/vedeu_html_1428854100.html', 'w')
46
+ subject
47
+ end
37
48
  end
38
49
  end
39
50
 
@@ -0,0 +1,8 @@
1
+ require 'test_helper'
2
+
3
+ module Vedeu
4
+
5
+ describe InterfacesRepository do
6
+ end # InterfacesRepository
7
+
8
+ end # Vedeu
data/test/test_helper.rb CHANGED
@@ -9,17 +9,18 @@ require 'minitest/hell'
9
9
  SimpleCov.start do
10
10
  command_name 'MiniTest::Spec'
11
11
  add_filter '/test/'
12
- add_group 'api', 'vedeu/api'
13
12
  add_group 'buffers', 'vedeu/buffers'
14
13
  add_group 'configuration', 'vedeu/configuration'
15
14
  add_group 'cursor', 'vedeu/cursor'
15
+ add_group 'distributed', 'vedeu/distributed'
16
16
  add_group 'dsl', 'vedeu/dsl'
17
17
  add_group 'events', 'vedeu/events'
18
+ add_group 'geometry', 'vedeu/geometry'
18
19
  add_group 'input', 'vedeu/input'
19
20
  add_group 'models', 'vedeu/models'
20
21
  add_group 'output', 'vedeu/output'
21
- add_group 'presentation', 'vedeu/presentation'
22
22
  add_group 'repositories', 'vedeu/repositories'
23
+ add_group 'storage', 'vedeu/storage'
23
24
  add_group 'support', 'vedeu/support'
24
25
  end unless ENV['no_simplecov']
25
26
 
data/vedeu.gemspec CHANGED
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'vedeu'
7
- spec.version = '0.4.15'
7
+ spec.version = '0.4.16'
8
8
  spec.authors = ['Gavin Laking']
9
9
  spec.email = ['gavinlaking@gmail.com']
10
10
  spec.summary = 'A terminal case of wonderland.'
@@ -19,11 +19,11 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ['lib']
20
20
 
21
21
  spec.add_development_dependency 'aruba', '0.6.2'
22
- spec.add_development_dependency 'bundler', '~> 1.7'
22
+ spec.add_development_dependency 'bundler', '~> 1.8'
23
23
  spec.add_development_dependency 'cucumber', '2.0.0'
24
24
  spec.add_development_dependency 'guard', '2.12.5'
25
25
  spec.add_development_dependency 'guard-bundler', '2.1.0'
26
- spec.add_development_dependency 'guard-cucumber', '1.5.4'
26
+ spec.add_development_dependency 'guard-cucumber', '1.6.0'
27
27
  spec.add_development_dependency 'guard-minitest', '2.4.4'
28
28
  spec.add_development_dependency 'inch', '0.5.10'
29
29
  spec.add_development_dependency 'minitest', '5.5.1'
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
32
32
  spec.add_development_dependency 'pry', '0.10.1'
33
33
  spec.add_development_dependency 'pry-byebug', '3.1.0'
34
34
  spec.add_development_dependency 'rake', '10.4.2'
35
- spec.add_development_dependency 'rubocop'
35
+ spec.add_development_dependency 'rubocop', '0.30.0'
36
36
  spec.add_development_dependency 'ruby-prof', '0.15.6'
37
37
  spec.add_development_dependency 'simplecov', '0.9.2'
38
38
  spec.add_development_dependency 'yard', '0.8.7.6'
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.4.15
4
+ version: 0.4.16
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-04-12 00:00:00.000000000 Z
11
+ date: 2015-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.7'
33
+ version: '1.8'
34
34
  type: :development
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.7'
40
+ version: '1.8'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: cucumber
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -86,14 +86,14 @@ dependencies:
86
86
  requirements:
87
87
  - - '='
88
88
  - !ruby/object:Gem::Version
89
- version: 1.5.4
89
+ version: 1.6.0
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - '='
95
95
  - !ruby/object:Gem::Version
96
- version: 1.5.4
96
+ version: 1.6.0
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: guard-minitest
99
99
  requirement: !ruby/object:Gem::Requirement
@@ -210,16 +210,16 @@ dependencies:
210
210
  name: rubocop
211
211
  requirement: !ruby/object:Gem::Requirement
212
212
  requirements:
213
- - - ">="
213
+ - - '='
214
214
  - !ruby/object:Gem::Version
215
- version: '0'
215
+ version: 0.30.0
216
216
  type: :development
217
217
  prerelease: false
218
218
  version_requirements: !ruby/object:Gem::Requirement
219
219
  requirements:
220
- - - ">="
220
+ - - '='
221
221
  - !ruby/object:Gem::Version
222
- version: '0'
222
+ version: 0.30.0
223
223
  - !ruby/object:Gem::Dependency
224
224
  name: ruby-prof
225
225
  requirement: !ruby/object:Gem::Requirement
@@ -396,6 +396,7 @@ files:
396
396
  - lib/vedeu/models/line.rb
397
397
  - lib/vedeu/models/menu.rb
398
398
  - lib/vedeu/models/null.rb
399
+ - lib/vedeu/models/null_interface.rb
399
400
  - lib/vedeu/models/stream.rb
400
401
  - lib/vedeu/output/all.rb
401
402
  - lib/vedeu/output/background.rb
@@ -411,6 +412,7 @@ files:
411
412
  - lib/vedeu/output/presentation.rb
412
413
  - lib/vedeu/output/refresh.rb
413
414
  - lib/vedeu/output/renderers/all.rb
415
+ - lib/vedeu/output/renderers/escape_sequence_renderer.rb
414
416
  - lib/vedeu/output/renderers/file_renderer.rb
415
417
  - lib/vedeu/output/renderers/html_renderer.rb
416
418
  - lib/vedeu/output/renderers/json_renderer.rb
@@ -521,6 +523,7 @@ files:
521
523
  - test/lib/vedeu/models/interface_test.rb
522
524
  - test/lib/vedeu/models/line_test.rb
523
525
  - test/lib/vedeu/models/menu_test.rb
526
+ - test/lib/vedeu/models/null_interface_test.rb
524
527
  - test/lib/vedeu/models/null_test.rb
525
528
  - test/lib/vedeu/models/stream_test.rb
526
529
  - test/lib/vedeu/output/background_test.rb
@@ -536,6 +539,7 @@ files:
536
539
  - test/lib/vedeu/output/presentation_test.rb
537
540
  - test/lib/vedeu/output/refresh_test.rb
538
541
  - test/lib/vedeu/output/renderers/all_test.rb
542
+ - test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb
539
543
  - test/lib/vedeu/output/renderers/file_renderer_test.rb
540
544
  - test/lib/vedeu/output/renderers/html_renderer_test.rb
541
545
  - test/lib/vedeu/output/renderers/json_renderer_test.rb
@@ -567,6 +571,7 @@ files:
567
571
  - test/lib/vedeu/repositories/repositories/geometries_test.rb
568
572
  - test/lib/vedeu/repositories/repositories/groups_test.rb
569
573
  - test/lib/vedeu/repositories/repositories/interfaces_repositories_test.rb
574
+ - test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb
570
575
  - test/lib/vedeu/repositories/repositories/keymaps_test.rb
571
576
  - test/lib/vedeu/repositories/repositories/menus_test.rb
572
577
  - test/lib/vedeu/repositories/repository_test.rb
@@ -677,6 +682,7 @@ test_files:
677
682
  - test/lib/vedeu/models/interface_test.rb
678
683
  - test/lib/vedeu/models/line_test.rb
679
684
  - test/lib/vedeu/models/menu_test.rb
685
+ - test/lib/vedeu/models/null_interface_test.rb
680
686
  - test/lib/vedeu/models/null_test.rb
681
687
  - test/lib/vedeu/models/stream_test.rb
682
688
  - test/lib/vedeu/output/background_test.rb
@@ -692,6 +698,7 @@ test_files:
692
698
  - test/lib/vedeu/output/presentation_test.rb
693
699
  - test/lib/vedeu/output/refresh_test.rb
694
700
  - test/lib/vedeu/output/renderers/all_test.rb
701
+ - test/lib/vedeu/output/renderers/escape_sequence_renderer_test.rb
695
702
  - test/lib/vedeu/output/renderers/file_renderer_test.rb
696
703
  - test/lib/vedeu/output/renderers/html_renderer_test.rb
697
704
  - test/lib/vedeu/output/renderers/json_renderer_test.rb
@@ -723,6 +730,7 @@ test_files:
723
730
  - test/lib/vedeu/repositories/repositories/geometries_test.rb
724
731
  - test/lib/vedeu/repositories/repositories/groups_test.rb
725
732
  - test/lib/vedeu/repositories/repositories/interfaces_repositories_test.rb
733
+ - test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb
726
734
  - test/lib/vedeu/repositories/repositories/keymaps_test.rb
727
735
  - test/lib/vedeu/repositories/repositories/menus_test.rb
728
736
  - test/lib/vedeu/repositories/repository_test.rb