vedeu 0.8.17 → 0.8.18

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/Guardfile +1 -1
  3. data/docs/configuration/base_path.md +11 -0
  4. data/docs/configuration/colour.md +6 -0
  5. data/docs/configuration/colour_mode.md +13 -0
  6. data/docs/configuration/compression.md +22 -0
  7. data/docs/configuration/cooked.md +7 -0
  8. data/docs/configuration/debug.md +20 -0
  9. data/docs/configuration/drb_height.md +6 -0
  10. data/docs/configuration/drb_width.md +6 -0
  11. data/docs/configuration/fake.md +6 -0
  12. data/docs/configuration/height.md +12 -0
  13. data/docs/configuration/log.md +15 -0
  14. data/docs/configuration/log_except.md +11 -0
  15. data/docs/configuration/log_only.md +11 -0
  16. data/docs/configuration/mouse.md +11 -0
  17. data/docs/configuration/profile.md +22 -0
  18. data/docs/configuration/raw.md +7 -0
  19. data/docs/configuration/renderer.md +13 -0
  20. data/docs/configuration/root.md +9 -0
  21. data/docs/configuration/stderr.md +6 -0
  22. data/docs/configuration/stdin.md +6 -0
  23. data/docs/configuration/stdout.md +6 -0
  24. data/docs/configuration/terminal_mode.md +23 -0
  25. data/docs/configuration/threaded.md +3 -0
  26. data/docs/configuration/width.md +11 -0
  27. data/integrations/dsl_app_001.rb +1 -1
  28. data/integrations/dsl_app_002.rb +1 -1
  29. data/integrations/dsl_app_003.rb +1 -1
  30. data/integrations/dsl_app_004.rb +1 -1
  31. data/integrations/dsl_app_005.rb +1 -1
  32. data/integrations/dsl_app_006.rb +1 -1
  33. data/integrations/dsl_app_007.rb +1 -1
  34. data/integrations/dsl_app_008.rb +1 -1
  35. data/integrations/dsl_app_009.rb +1 -1
  36. data/integrations/dsl_app_010.rb +1 -1
  37. data/integrations/dsl_app_011.rb +1 -1
  38. data/integrations/dsl_app_012.rb +1 -1
  39. data/integrations/dsl_app_013.rb +1 -1
  40. data/integrations/dsl_app_014.rb +1 -1
  41. data/integrations/dsl_app_015.rb +1 -1
  42. data/integrations/dsl_app_016.rb +1 -1
  43. data/integrations/dsl_app_017.rb +1 -1
  44. data/integrations/dsl_app_018.rb +1 -1
  45. data/integrations/dsl_app_019.rb +1 -1
  46. data/integrations/dsl_app_020.rb +1 -1
  47. data/integrations/dsl_app_021.rb +1 -1
  48. data/integrations/dsl_app_022.rb +1 -1
  49. data/integrations/dsl_app_border_001.rb +1 -1
  50. data/integrations/dsl_app_border_002.rb +1 -1
  51. data/integrations/dsl_app_border_003.rb +1 -1
  52. data/integrations/dsl_app_border_004.rb +1 -1
  53. data/integrations/dsl_app_border_005.rb +1 -1
  54. data/lib/vedeu/application/application_view.rb +3 -3
  55. data/lib/vedeu/coercers/coercer.rb +17 -6
  56. data/lib/vedeu/coercers/colour.rb +2 -2
  57. data/lib/vedeu/coercers/editor_line.rb +1 -1
  58. data/lib/vedeu/colours/translator.rb +7 -4
  59. data/lib/vedeu/common.rb +1 -1
  60. data/lib/vedeu/configuration/api.rb +24 -279
  61. data/lib/vedeu/configuration/configuration.rb +53 -53
  62. data/lib/vedeu/distributed/all.rb +0 -1
  63. data/lib/vedeu/distributed/subprocess.rb +3 -4
  64. data/lib/vedeu/error.rb +11 -6
  65. data/lib/vedeu/events/trigger.rb +1 -1
  66. data/lib/vedeu/groups/group.rb +0 -1
  67. data/lib/vedeu/logging/log.rb +7 -8
  68. data/lib/vedeu/renderers/support/options.rb +2 -2
  69. data/lib/vedeu/support/point.rb +1 -1
  70. data/lib/vedeu/version.rb +1 -1
  71. data/test/lib/vedeu/coercers/coercer_test.rb +9 -3
  72. data/test/lib/vedeu/coercers/editor_line_test.rb +12 -5
  73. data/test/lib/vedeu/common_test.rb +6 -0
  74. data/test/lib/vedeu/configuration/configuration_test.rb +0 -6
  75. data/test/lib/vedeu/error_test.rb +19 -9
  76. data/test/lib/vedeu/repositories/assemblage_test.rb +2 -2
  77. data/test/lib/vedeu/repositories/collection_test.rb +5 -2
  78. data/test/lib/vedeu/repositories/model_test.rb +16 -2
  79. data/test/lib/vedeu/repositories/registerable_test.rb +7 -2
  80. data/test/lib/vedeu/support/point_test.rb +6 -0
  81. data/test/test_helper.rb +0 -1
  82. metadata +26 -7
  83. data/lib/vedeu/distributed/test_application.rb +0 -117
  84. data/test/lib/vedeu/distributed/test_application_test.rb +0 -95
  85. data/test/support/helpers/model_test_class.rb +0 -74
@@ -6,13 +6,16 @@ module Vedeu
6
6
 
7
7
  module Repositories
8
8
 
9
+ class CollectionTestClass
10
+ end # CollectionTestClass
11
+
9
12
  describe Collection do
10
13
 
11
14
  let(:described) { Vedeu::Repositories::Collection }
12
15
  let(:instance) { described.new(collection, parent, model_name) }
13
16
  let(:collection) { [] }
14
- let(:model_name) { 'elements' }
15
- let(:parent) { Vedeu::Repositories::ModelTestClass.new }
17
+ let(:model_name) { :vedeu_repositories_collection }
18
+ let(:parent) { Vedeu::Repositories::CollectionTestClass.new() }
16
19
 
17
20
  describe '#initialize' do
18
21
  it { instance.must_be_instance_of(described) }
@@ -6,6 +6,20 @@ module Vedeu
6
6
 
7
7
  module Repositories
8
8
 
9
+ class ModelTestClass
10
+
11
+ include Vedeu::Repositories::Model
12
+
13
+ def initialize(attributes)
14
+ @attributes = attributes
15
+ end
16
+
17
+ def store
18
+ self
19
+ end
20
+
21
+ end # ModelTestClass
22
+
9
23
  describe Model do
10
24
 
11
25
  let(:described) { Vedeu::Repositories::Model }
@@ -13,7 +27,7 @@ module Vedeu
13
27
  let(:included_instance) { included_described.new(attributes) }
14
28
  let(:attributes) {
15
29
  {
16
- name: 'hydrogen'
30
+ name: :vedeu_repositories_model
17
31
  }
18
32
  }
19
33
 
@@ -68,7 +82,7 @@ module Vedeu
68
82
  subject { included_instance.store }
69
83
 
70
84
  it 'returns the model' do
71
- subject.must_be_instance_of(Vedeu::Repositories::ModelTestClass)
85
+ subject.must_be_instance_of(included_described)
72
86
  end
73
87
  end
74
88
 
@@ -6,6 +6,9 @@ module Vedeu
6
6
 
7
7
  module Repositories
8
8
 
9
+ class ModelTestClass
10
+ end # ModelTestClass
11
+
9
12
  class RegisterableTestClass
10
13
 
11
14
  include Vedeu::Repositories::Registerable
@@ -13,7 +16,7 @@ module Vedeu
13
16
  null Vedeu::Repositories::ModelTestClass
14
17
  real Vedeu::Repositories::ModelTestClass
15
18
 
16
- end
19
+ end # RegisterableTestClass
17
20
 
18
21
  describe Registerable do
19
22
 
@@ -36,7 +39,9 @@ module Vedeu
36
39
 
37
40
  it { subject.must_respond_to(:null_model) }
38
41
  it { subject.must_respond_to(:null_attributes) }
39
- it { subject.null_model.must_equal(Vedeu::Repositories::ModelTestClass) }
42
+ it {
43
+ subject.null_model.must_equal(Vedeu::Repositories::ModelTestClass)
44
+ }
40
45
  it { subject.null_attributes.must_equal({}) }
41
46
  end
42
47
 
@@ -46,6 +46,12 @@ module Vedeu
46
46
  it { proc { subject }.must_raise(Vedeu::Error::InvalidSyntax) }
47
47
  end
48
48
 
49
+ context 'when :max is a Float::INFINITY' do
50
+ let(:max) { Float::INFINITY }
51
+
52
+ it { subject.must_be_instance_of(Vedeu::Point) }
53
+ end
54
+
49
55
  context 'when :min > :max' do
50
56
  let(:max) { 4 }
51
57
  let(:min) { 7 }
data/test/test_helper.rb CHANGED
@@ -95,7 +95,6 @@ end # MiniTest
95
95
 
96
96
  require 'mocha/setup'
97
97
  require 'vedeu'
98
- require 'support/helpers/model_test_class'
99
98
 
100
99
  if ENV['PERFORMANCE'].to_i == 1
101
100
  require 'minitest/reporters'
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.17
4
+ version: 0.8.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: 2016-02-26 00:00:00.000000000 Z
11
+ date: 2016-03-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: guard
@@ -244,13 +244,37 @@ files:
244
244
  - docs/colours_styles.md
245
245
  - docs/configuration.md
246
246
  - docs/configuration/background.md
247
+ - docs/configuration/base_path.md
248
+ - docs/configuration/colour.md
249
+ - docs/configuration/colour_mode.md
250
+ - docs/configuration/compression.md
251
+ - docs/configuration/cooked.md
252
+ - docs/configuration/debug.md
247
253
  - docs/configuration/drb.md
254
+ - docs/configuration/drb_height.md
248
255
  - docs/configuration/drb_host.md
249
256
  - docs/configuration/drb_port.md
257
+ - docs/configuration/drb_width.md
258
+ - docs/configuration/fake.md
250
259
  - docs/configuration/foreground.md
260
+ - docs/configuration/height.md
251
261
  - docs/configuration/interactive.md
262
+ - docs/configuration/log.md
263
+ - docs/configuration/log_except.md
264
+ - docs/configuration/log_only.md
265
+ - docs/configuration/mouse.md
266
+ - docs/configuration/profile.md
267
+ - docs/configuration/raw.md
268
+ - docs/configuration/renderer.md
269
+ - docs/configuration/root.md
252
270
  - docs/configuration/run_once.md
253
271
  - docs/configuration/standalone.md
272
+ - docs/configuration/stderr.md
273
+ - docs/configuration/stdin.md
274
+ - docs/configuration/stdout.md
275
+ - docs/configuration/terminal_mode.md
276
+ - docs/configuration/threaded.md
277
+ - docs/configuration/width.md
254
278
  - docs/cursors.md
255
279
  - docs/dsl.md
256
280
  - docs/dsl/borders.md
@@ -663,7 +687,6 @@ files:
663
687
  - lib/vedeu/distributed/templates/default_keymaps.vedeu
664
688
  - lib/vedeu/distributed/templates/default_menus.vedeu
665
689
  - lib/vedeu/distributed/templates/default_views.vedeu
666
- - lib/vedeu/distributed/test_application.rb
667
690
  - lib/vedeu/distributed/uri.rb
668
691
  - lib/vedeu/dsl/all.rb
669
692
  - lib/vedeu/dsl/border.rb
@@ -909,7 +932,6 @@ files:
909
932
  - test/lib/vedeu/distributed/client_test.rb
910
933
  - test/lib/vedeu/distributed/server_test.rb
911
934
  - test/lib/vedeu/distributed/subprocess_test.rb
912
- - test/lib/vedeu/distributed/test_application_test.rb
913
935
  - test/lib/vedeu/distributed/uri_test.rb
914
936
  - test/lib/vedeu/dsl/border_test.rb
915
937
  - test/lib/vedeu/dsl/cursors_test.rb
@@ -1067,7 +1089,6 @@ files:
1067
1089
  - test/support/examples/view_templates_app/prune.erb
1068
1090
  - test/support/examples/view_templates_app/view_templates_app.rb
1069
1091
  - test/support/examples/view_templates_app/wrap.erb
1070
- - test/support/helpers/model_test_class.rb
1071
1092
  - test/support/stats.sh
1072
1093
  - test/support/templates/html_renderer.vedeu
1073
1094
  - test/support/ttyrec.rb
@@ -1173,7 +1194,6 @@ test_files:
1173
1194
  - test/lib/vedeu/distributed/client_test.rb
1174
1195
  - test/lib/vedeu/distributed/server_test.rb
1175
1196
  - test/lib/vedeu/distributed/subprocess_test.rb
1176
- - test/lib/vedeu/distributed/test_application_test.rb
1177
1197
  - test/lib/vedeu/distributed/uri_test.rb
1178
1198
  - test/lib/vedeu/dsl/border_test.rb
1179
1199
  - test/lib/vedeu/dsl/cursors_test.rb
@@ -1331,7 +1351,6 @@ test_files:
1331
1351
  - test/support/examples/view_templates_app/prune.erb
1332
1352
  - test/support/examples/view_templates_app/view_templates_app.rb
1333
1353
  - test/support/examples/view_templates_app/wrap.erb
1334
- - test/support/helpers/model_test_class.rb
1335
1354
  - test/support/stats.sh
1336
1355
  - test/support/templates/html_renderer.vedeu
1337
1356
  - test/support/ttyrec.rb
@@ -1,117 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Vedeu
4
-
5
- # Create a test application as a string.
6
- #
7
- # @example
8
- # test_app = TestApplication.build do |app|
9
- # app.borders = ''
10
- # app.configuration = ''
11
- # app.events = ''
12
- # app.geometries = ''
13
- # app.interfaces = ''
14
- # app.keymaps = ''
15
- # app.menus = ''
16
- # app.views = ''
17
- # end
18
- #
19
- class TestApplication
20
-
21
- # @!attribute [rw] borders
22
- # @return [String]
23
- attr_accessor :borders
24
-
25
- # @!attribute [rw] configuration
26
- # @return [String]
27
- attr_accessor :configuration
28
-
29
- # @!attribute [rw] events
30
- # @return [String]
31
- attr_accessor :events
32
-
33
- # @!attribute [rw] geometries
34
- # @return [String]
35
- attr_accessor :geometries
36
-
37
- # @!attribute [rw] interfaces
38
- # @return [String]
39
- attr_accessor :interfaces
40
-
41
- # @!attribute [rw] keymaps
42
- # @return [String]
43
- attr_accessor :keymaps
44
-
45
- # @!attribute [rw] menus
46
- # @return [String]
47
- attr_accessor :menus
48
-
49
- # @!attribute [rw] views
50
- # @return [String]
51
- attr_accessor :views
52
-
53
- # @param (see #initialize)
54
- def self.build(attributes = {}, &block)
55
- new(attributes).build(&block)
56
- end
57
-
58
- # Returns a new instance of Vedeu::TestApplication.
59
- #
60
- # @param attributes [Hash<Symbol => String>]
61
- # @option attributes borders [String]
62
- # @option attributes configuration [String]
63
- # @option attributes events [String]
64
- # @option attributes geometries [String]
65
- # @option attributes interfaces [String]
66
- # @option attributes keymaps [String]
67
- # @option attributes menus [String]
68
- # @option attributes views [String]
69
- # @return [Vedeu::TestApplication]
70
- def initialize(attributes = {})
71
- defaults.merge!(attributes).each do |key, value|
72
- instance_variable_set("@#{key}", value)
73
- end
74
- end
75
-
76
- # @param block [Proc]
77
- # @return [String]
78
- def build(&block)
79
- instance_eval(&block) if block_given?
80
-
81
- Vedeu::Templating::Template.parse(self, template)
82
- end
83
-
84
- # @return [String]
85
- def lib_dir
86
- File.dirname(__FILE__) + '/../../../lib'
87
- end
88
-
89
- private
90
-
91
- # @return [String]
92
- def template
93
- File.dirname(__FILE__) + '/templates/default_application.vedeu'
94
- end
95
-
96
- # @macro defaults_method
97
- def defaults
98
- {
99
- borders: read('default_borders.vedeu'),
100
- configuration: read('default_configuration.vedeu'),
101
- events: read('default_events.vedeu'),
102
- geometries: read('default_geometries.vedeu'),
103
- interfaces: read('default_interfaces.vedeu'),
104
- keymaps: read('default_keymaps.vedeu'),
105
- menus: read('default_menus.vedeu'),
106
- views: read('default_views.vedeu'),
107
- }
108
- end
109
-
110
- # @return [String]
111
- def read(filename)
112
- File.read(File.dirname(__FILE__) + '/templates/' + filename)
113
- end
114
-
115
- end # TestApplication
116
-
117
- end # Vedeu
@@ -1,95 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- module Vedeu
6
-
7
- describe TestApplication do
8
-
9
- let(:described) { Vedeu::TestApplication }
10
- let(:instance) { described.new(attributes) }
11
- let(:attributes) { {} }
12
-
13
- describe '#initialize' do
14
- it { instance.must_be_instance_of(described) }
15
- end
16
-
17
- describe '#borders' do
18
- it { instance.must_respond_to(:borders) }
19
- end
20
-
21
- describe '#borders=' do
22
- it { instance.must_respond_to(:borders=) }
23
- end
24
-
25
- describe '#configuration' do
26
- it { instance.must_respond_to(:configuration) }
27
- end
28
-
29
- describe '#configuration=' do
30
- it { instance.must_respond_to(:configuration=) }
31
- end
32
-
33
- describe '#events' do
34
- it { instance.must_respond_to(:events) }
35
- end
36
-
37
- describe '#events=' do
38
- it { instance.must_respond_to(:events=) }
39
- end
40
-
41
- describe '#geometries' do
42
- it { instance.must_respond_to(:geometries) }
43
- end
44
-
45
- describe '#geometries=' do
46
- it { instance.must_respond_to(:geometries=) }
47
- end
48
-
49
- describe '#interfaces' do
50
- it { instance.must_respond_to(:interfaces) }
51
- end
52
-
53
- describe '#interfaces=' do
54
- it { instance.must_respond_to(:interfaces=) }
55
- end
56
-
57
- describe '#keymaps' do
58
- it { instance.must_respond_to(:keymaps) }
59
- end
60
-
61
- describe '#keymaps=' do
62
- it { instance.must_respond_to(:keymaps=) }
63
- end
64
-
65
- describe '#menus' do
66
- it { instance.must_respond_to(:menus) }
67
- end
68
-
69
- describe '#menus=' do
70
- it { instance.must_respond_to(:menus=) }
71
- end
72
-
73
- describe '#views' do
74
- it { instance.must_respond_to(:views) }
75
- end
76
-
77
- describe '#views=' do
78
- it { instance.must_respond_to(:views=) }
79
- end
80
-
81
- describe '.build' do
82
- subject { described.build(attributes) { } }
83
-
84
- it { subject.must_be_instance_of(String) }
85
- end
86
-
87
- describe '#lib_dir' do
88
- subject { instance.lib_dir }
89
-
90
- it { subject.must_be_instance_of(String) }
91
- end
92
-
93
- end # TestApplication
94
-
95
- end # Vedeu
@@ -1,74 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module Vedeu
4
-
5
- module Repositories
6
-
7
- module DSL
8
-
9
- class ModelTestClass
10
-
11
- include Vedeu::DSL
12
- include Vedeu::DSL::Presentation
13
-
14
- protected
15
-
16
- attr_reader :model
17
-
18
- end # DSL
19
-
20
- end # ModelTestClass
21
-
22
- module RepositoryTestModule
23
-
24
- extend self
25
-
26
- def by_name(name)
27
- model
28
- end
29
-
30
- # The real repository stores the model and returns it.
31
- def store(model)
32
- model
33
- end
34
-
35
- private
36
-
37
- # A storage solution that uses memory to persist models.
38
- def in_memory
39
- {}
40
- end
41
-
42
- end # RepositoryTestModule
43
-
44
- class ModelTestClass
45
-
46
- include Vedeu::Repositories::Model
47
- include Vedeu::Presentation
48
-
49
- attr_accessor :background, :colour, :name, :style
50
-
51
- def initialize(attributes = {})
52
- defaults.merge!(attributes).each do |key, value|
53
- instance_variable_set("@#{key}", value)
54
- end
55
- end
56
-
57
- private
58
-
59
- # @macro defaults_method
60
- def defaults
61
- {
62
- client: nil,
63
- colour: {},
64
- name: '',
65
- repository: Vedeu::Repositories::RepositoryTestModule,
66
- style: [],
67
- }
68
- end
69
-
70
- end # ModelTestClass
71
-
72
- end # Repositories
73
-
74
- end # Vedeu