vedeu 0.4.50 → 0.4.51

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/Guardfile +0 -5
  3. data/examples/material_colours_app.rb +1 -1
  4. data/examples/panel_app.rb +1 -1
  5. data/lib/vedeu/cli/generator/templates/application/config/configuration.erb +7 -2
  6. data/lib/vedeu/configuration/configuration.rb +1 -1
  7. data/lib/vedeu/output/border.rb +0 -6
  8. data/lib/vedeu/output/clear/named_interface.rb +2 -2
  9. data/lib/vedeu/output/output.rb +12 -12
  10. data/lib/vedeu/output/render_border.rb +1 -1
  11. data/lib/vedeu/output/renderers/all.rb +10 -5
  12. data/lib/vedeu/output/renderers/escape_sequence.rb +21 -23
  13. data/lib/vedeu/output/renderers/file.rb +16 -27
  14. data/lib/vedeu/output/renderers/html.rb +36 -42
  15. data/lib/vedeu/output/renderers/json.rb +22 -5
  16. data/lib/vedeu/output/renderers/null.rb +28 -3
  17. data/lib/vedeu/output/renderers/terminal.rb +23 -19
  18. data/lib/vedeu/output/renderers/text.rb +18 -20
  19. data/lib/vedeu/output/virtual_terminal.rb +1 -1
  20. data/lib/vedeu/support/template.rb +1 -1
  21. data/lib/vedeu/version.rb +1 -1
  22. data/test/lib/vedeu/application/application_controller_test.rb +2 -0
  23. data/test/lib/vedeu/application/application_helper_test.rb +2 -0
  24. data/test/lib/vedeu/application/controller_test.rb +1 -1
  25. data/test/lib/vedeu/application/helper_test.rb +2 -0
  26. data/test/lib/vedeu/application/view_test.rb +2 -0
  27. data/test/lib/vedeu/buffers/buffer_test.rb +1 -1
  28. data/test/lib/vedeu/buffers/display_buffer_test.rb +2 -0
  29. data/test/lib/vedeu/cli/generator/application_test.rb +2 -0
  30. data/test/lib/vedeu/cli/generator/helpers_test.rb +1 -0
  31. data/test/lib/vedeu/configuration/api_test.rb +3 -0
  32. data/test/lib/vedeu/cursor/move_test.rb +5 -0
  33. data/test/lib/vedeu/distributed/client_test.rb +4 -0
  34. data/test/lib/vedeu/distributed/server_test.rb +9 -0
  35. data/test/lib/vedeu/dsl/use_test.rb +4 -0
  36. data/test/lib/vedeu/launcher_test.rb +2 -0
  37. data/test/lib/vedeu/main_loop_test.rb +2 -0
  38. data/test/lib/vedeu/null/interface_test.rb +1 -0
  39. data/test/lib/vedeu/output/border_test.rb +0 -8
  40. data/test/lib/vedeu/output/output_test.rb +12 -11
  41. data/test/lib/vedeu/output/refresh_test.rb +1 -0
  42. data/test/lib/vedeu/output/render_border_test.rb +1 -0
  43. data/test/lib/vedeu/output/renderers/all_test.rb +4 -8
  44. data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +5 -4
  45. data/test/lib/vedeu/output/renderers/file_test.rb +14 -19
  46. data/test/lib/vedeu/output/renderers/html_test.rb +55 -56
  47. data/test/lib/vedeu/output/renderers/json_test.rb +4 -5
  48. data/test/lib/vedeu/output/renderers/null_test.rb +9 -3
  49. data/test/lib/vedeu/output/renderers/terminal_test.rb +5 -4
  50. data/test/lib/vedeu/output/renderers/text_test.rb +5 -4
  51. data/test/lib/vedeu/output/text_test.rb +2 -0
  52. data/test/lib/vedeu/output/virtual_terminal_test.rb +10 -28
  53. data/test/lib/vedeu/repositories/collection_test.rb +1 -0
  54. data/test/lib/vedeu/repositories/model_test.rb +3 -0
  55. data/test/lib/vedeu/repositories/repository_test.rb +1 -0
  56. data/test/lib/vedeu/support/visibility_test.rb +1 -0
  57. data/test/lib/vedeu/traps_test.rb +1 -0
  58. data/test/lib/vedeu_test.rb +1 -0
  59. data/vedeu.gemspec +0 -2
  60. metadata +2 -30
@@ -7,22 +7,39 @@ module Vedeu
7
7
  # @api private
8
8
  class JSON < Vedeu::Renderers::File
9
9
 
10
+ # Returns a new instance of Vedeu::Renderers::JSON.
11
+ #
12
+ # @param options [Hash]
13
+ # @return [Vedeu::Renderers::JSON]
14
+ def initialize(options = {})
15
+ @options = options || {}
16
+ end
17
+
18
+ # @param output [Array<Array<Vedeu::Char>>]
19
+ # @return [String]
20
+ def render(output)
21
+ super(parsed(output))
22
+ end
23
+
10
24
  private
11
25
 
26
+ # @param output [Array<Array<Vedeu::Char>>]
12
27
  # @return [String]
13
- def parsed
28
+ def parsed(output)
14
29
  return '' if output.nil? || output.empty?
15
30
 
16
- ::JSON.pretty_generate(as_hash)
31
+ ::JSON.pretty_generate(as_hash(output))
17
32
  end
18
33
 
34
+ # @param output [Array<Array<Vedeu::Char>>]
19
35
  # @return [Array]
20
- def as_hash
21
- sorted.map(&:to_hash)
36
+ def as_hash(output)
37
+ sorted(output).map(&:to_hash)
22
38
  end
23
39
 
40
+ # @param output [Array<Array<Vedeu::Char>>]
24
41
  # @return [Array]
25
- def sorted
42
+ def sorted(output)
26
43
  Array(output).flatten.sort { |a, b| a.position <=> b.position }
27
44
  end
28
45
 
@@ -7,9 +7,34 @@ module Vedeu
7
7
  # @api private
8
8
  class Null
9
9
 
10
- # @return [NilClass]
11
- def self.render(*)
12
- nil
10
+ # Returns a new instance of Vedeu::Renderers::Null.
11
+ #
12
+ # @param options [Hash]
13
+ # @return [Vedeu::Renderers::Null]
14
+ def initialize(options = {})
15
+ @options = options || {}
16
+ end
17
+
18
+ # @param output [Array<Array<Vedeu::Char>>]
19
+ # @return [String]
20
+ def render(output)
21
+ output
22
+ end
23
+
24
+ private
25
+
26
+ # Combines the options provided at instantiation with the default values.
27
+ #
28
+ # @return [Hash<Symbol => void>]
29
+ def options
30
+ defaults.merge!(@options)
31
+ end
32
+
33
+ # The default values for a new instance of this class.
34
+ #
35
+ # @return [Hash<Symbol => void>]
36
+ def defaults
37
+ {}
13
38
  end
14
39
 
15
40
  end # Null
@@ -8,40 +8,44 @@ module Vedeu
8
8
  # @api private
9
9
  class Terminal
10
10
 
11
- # @param output [Array<Array<Vedeu::Char>>]
12
- # @return [String]
13
- def self.render(*output)
14
- new(*output).render
15
- end
16
-
17
11
  # Returns a new instance of Vedeu::Renderers::Terminal.
18
12
  #
19
- # @param output [Array<Array<Vedeu::Char>>]
13
+ # @param options [Hash]
20
14
  # @return [Vedeu::Renderers::Terminal]
21
- def initialize(*output)
22
- @output = output
15
+ def initialize(options = {})
16
+ @options = options || {}
23
17
  end
24
18
 
19
+ # @param output [Array<Array<Vedeu::Char>>]
25
20
  # @return [Array<String>]
26
- def render
27
- Vedeu::Terminal.output(parsed)
21
+ def render(output)
22
+ Vedeu::Terminal.output(parsed(output))
28
23
  end
29
24
 
30
- protected
31
-
32
- # @!attribute [r] output
33
- # @return [Array<Array<Vedeu::Char>>]
34
- attr_reader :output
35
-
36
25
  private
37
26
 
38
- # @return [String]
39
- def parsed
27
+ # @param output [Array<Array<Vedeu::Char>>]
28
+ # @return [Array<Array<Vedeu::Char>>]
29
+ def parsed(output)
40
30
  Vedeu.timer('Compression') do
41
31
  Vedeu::Compressor.render(output)
42
32
  end
43
33
  end
44
34
 
35
+ # Combines the options provided at instantiation with the default values.
36
+ #
37
+ # @return [Hash<Symbol => void>]
38
+ def options
39
+ defaults.merge!(@options)
40
+ end
41
+
42
+ # The default values for a new instance of this class.
43
+ #
44
+ # @return [Hash<Symbol => void>]
45
+ def defaults
46
+ {}
47
+ end
48
+
45
49
  end # Terminal
46
50
 
47
51
  end # Renderers
@@ -8,36 +8,34 @@ module Vedeu
8
8
  # @api private
9
9
  class Text
10
10
 
11
- # @param output [Array<Array<Vedeu::Char>>]
12
- # @return [String]
13
- def self.render(*output)
14
- new(*output).render
15
- end
16
-
17
11
  # Returns a new instance of Vedeu::Renderers::Text.
18
12
  #
19
- # @param output [Array<Array<Vedeu::Char>>]
13
+ # @param options [Hash]
20
14
  # @return [Vedeu::Renderers::Text]
21
- def initialize(*output)
22
- @output = output
15
+ def initialize(options = {})
16
+ @options = options || {}
23
17
  end
24
18
 
19
+ # @param output [Array<Array<Vedeu::Char>>]
25
20
  # @return [String]
26
- def render
27
- parsed
21
+ def render(output)
22
+ Vedeu::Compressor.render(output)
28
23
  end
29
24
 
30
- protected
31
-
32
- # @!attribute [r] output
33
- # @return [Array<Array<Vedeu::Char>>]
34
- attr_reader :output
35
-
36
25
  private
37
26
 
38
- # @return [String]
39
- def parsed
40
- Vedeu::Compressor.render(output)
27
+ # Combines the options provided at instantiation with the default values.
28
+ #
29
+ # @return [Hash<Symbol => void>]
30
+ def options
31
+ defaults.merge!(@options)
32
+ end
33
+
34
+ # The default values for a new instance of this class.
35
+ #
36
+ # @return [Hash<Symbol => void>]
37
+ def defaults
38
+ {}
41
39
  end
42
40
 
43
41
  end # Text
@@ -23,7 +23,7 @@ module Vedeu
23
23
  # @param width [Fixnum]
24
24
  # @param renderer [Object|Renderers::HTML] An object responding to .render.
25
25
  # @return [Vedeu::VirtualTerminal]
26
- def initialize(height, width, renderer = Vedeu::Renderers::HTML)
26
+ def initialize(height, width, renderer = Vedeu::Renderers::HTML.new)
27
27
  @height = height
28
28
  @width = width
29
29
  @renderer = renderer
@@ -23,7 +23,7 @@ module Vedeu
23
23
  def initialize(object, path, options = {})
24
24
  @object = object
25
25
  @path = path.to_s
26
- @options = options
26
+ @options = options || {}
27
27
  end
28
28
 
29
29
  # @return [void]
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.4.50'
4
+ VERSION = '0.4.51'
5
5
 
6
6
  end
@@ -7,6 +7,8 @@ module Vedeu
7
7
  let(:described) { Vedeu::ApplicationController }
8
8
  let(:instance) { described.new }
9
9
 
10
+ # @todo
11
+
10
12
  end # ApplicationController
11
13
 
12
14
  end # Vedeu
@@ -13,6 +13,8 @@ module Vedeu
13
13
  let(:described) { Vedeu::ApplicationHelper }
14
14
  let(:instance) { Vedeu::ApplicationHelperTestClass.new }
15
15
 
16
+ # @todo
17
+
16
18
  end # Application
17
19
 
18
20
  end # Vedeu
@@ -14,7 +14,7 @@ module Vedeu
14
14
  let(:instance) { described.new }
15
15
 
16
16
  context 'ClassMethods' do
17
-
17
+ # @todo
18
18
  end
19
19
 
20
20
  end # Controller
@@ -13,6 +13,8 @@ module Vedeu
13
13
  let(:described) { Vedeu::HelperTestClass }
14
14
  let(:instance) { described.new }
15
15
 
16
+ # @todo
17
+
16
18
  end # Helper
17
19
 
18
20
  end # Vedeu
@@ -13,6 +13,8 @@ module Vedeu
13
13
  let(:described) { Vedeu::ViewTestClass }
14
14
  let(:instance) { described.new }
15
15
 
16
+ # @todo
17
+
16
18
  end # View
17
19
 
18
20
  end # Vedeu
@@ -22,7 +22,6 @@ module Vedeu
22
22
 
23
23
  before do
24
24
  Vedeu.stubs(:trigger)
25
- # Vedeu.interfaces.stubs(:by_name).returns(interface)
26
25
  end
27
26
  after { Vedeu.interfaces.reset }
28
27
 
@@ -244,6 +243,7 @@ module Vedeu
244
243
 
245
244
  it { instance.must_respond_to(:content) }
246
245
 
246
+ # @todo
247
247
  # it { skip }
248
248
  # it { subject.must_be_instance_of(Array) }
249
249
 
@@ -56,10 +56,12 @@ module Vedeu
56
56
  end
57
57
 
58
58
  context 'when the buffer is not already registered' do
59
+ # @todo
59
60
  # it { skip }
60
61
  end
61
62
 
62
63
  context 'when the buffer is already registered' do
64
+ # @todo
63
65
  # it { skip }
64
66
  end
65
67
  end
@@ -26,6 +26,8 @@ module Vedeu
26
26
 
27
27
  describe '#generate' do
28
28
  subject { instance.generate }
29
+
30
+ # @todo
29
31
  end
30
32
 
31
33
  end # Application
@@ -63,6 +63,7 @@ module Vedeu
63
63
 
64
64
  subject { instance.make_file(source, destination) }
65
65
 
66
+ # @todo
66
67
  # it { skip }
67
68
  end
68
69
 
@@ -230,6 +230,7 @@ module Vedeu
230
230
 
231
231
  subject { instance.stdin(io) }
232
232
 
233
+ # @todo
233
234
  # it { skip }
234
235
  end
235
236
 
@@ -238,6 +239,7 @@ module Vedeu
238
239
 
239
240
  subject { instance.stdout(io) }
240
241
 
242
+ # @todo
241
243
  # it { skip }
242
244
  end
243
245
 
@@ -246,6 +248,7 @@ module Vedeu
246
248
 
247
249
  subject { instance.stderr(io) }
248
250
 
251
+ # @todo
249
252
  # it { skip }
250
253
  end
251
254
 
@@ -75,6 +75,7 @@ module Vedeu
75
75
  context 'when the name is not specified' do
76
76
  let(:_name) {}
77
77
 
78
+ # @todo
78
79
  # it { skip }
79
80
  end
80
81
 
@@ -247,6 +248,7 @@ module Vedeu
247
248
  context 'when the entity is a Vedeu::Geometry' do
248
249
  let(:entity) { Vedeu::Geometry }
249
250
 
251
+ # @todo
250
252
  # it { skip }
251
253
  end
252
254
 
@@ -261,10 +263,12 @@ module Vedeu
261
263
  context 'when the entity is a Vedeu::Geometry' do
262
264
  let(:entity) { Vedeu::Geometry }
263
265
 
266
+ # @todo
264
267
  # it { skip }
265
268
  end
266
269
 
267
270
  context 'when the entity is a Vedeu::Cursor' do
271
+ # @todo
268
272
  # it { skip }
269
273
  end
270
274
  end
@@ -279,6 +283,7 @@ module Vedeu
279
283
  end
280
284
 
281
285
  context 'when the entity is a Vedeu::Cursor' do
286
+ # @todo
282
287
  # it { skip }
283
288
  end
284
289
  end
@@ -37,6 +37,7 @@ module Vedeu
37
37
  end
38
38
 
39
39
  context 'when the DRb server is available' do
40
+ # @todo
40
41
  # it { skip }
41
42
  end
42
43
  end
@@ -54,6 +55,7 @@ module Vedeu
54
55
  end
55
56
 
56
57
  context 'when the DRb server is available' do
58
+ # @todo
57
59
  # it { skip }
58
60
  end
59
61
  end
@@ -70,6 +72,7 @@ module Vedeu
70
72
  end
71
73
 
72
74
  context 'when the DRb server is available' do
75
+ # @todo
73
76
  # it { skip }
74
77
  end
75
78
  end
@@ -84,6 +87,7 @@ module Vedeu
84
87
  end
85
88
 
86
89
  context 'when the DRb server is available' do
90
+ # @todo
87
91
  # before do
88
92
  # DRbObject.stubs(:new_with_uri).returns(server)
89
93
  # Process.stubs(:kill)
@@ -35,6 +35,7 @@ module Vedeu
35
35
  describe '.restart' do
36
36
  subject { described.restart }
37
37
 
38
+ # @todo
38
39
  # it { skip }
39
40
  # it { subject.must_be_instance_of(NilClass) }
40
41
  context 'when the server is not enabled' do
@@ -44,11 +45,13 @@ module Vedeu
44
45
  context 'when the server is enabled' do
45
46
 
46
47
  context 'and the server is running' do
48
+ # @todo
47
49
  # it { subject.must_equal(:running) }
48
50
  # it { skip }
49
51
  end
50
52
 
51
53
  context 'and the server is not running' do
54
+ # @todo
52
55
  # it { subject.must_equal(:stopped) }
53
56
  # it { skip }
54
57
  end
@@ -71,11 +74,13 @@ module Vedeu
71
74
  end
72
75
 
73
76
  context 'and the server is running' do
77
+ # @todo
74
78
  # it { subject.must_equal(:running) }
75
79
  # it { skip }
76
80
  end
77
81
 
78
82
  context 'and the server is not running' do
83
+ # @todo
79
84
  # it { subject.must_equal(:stopped) }
80
85
  # it { skip }
81
86
  end
@@ -95,11 +100,13 @@ module Vedeu
95
100
  context 'when the server is enabled' do
96
101
 
97
102
  context 'and the server is running' do
103
+ # @todo
98
104
  # it { subject.must_equal(:running) }
99
105
  # it { skip }
100
106
  end
101
107
 
102
108
  context 'and the server is not running' do
109
+ # @todo
103
110
  # it { subject.must_equal(:stopped) }
104
111
  # it { skip }
105
112
  end
@@ -139,11 +146,13 @@ module Vedeu
139
146
  context 'when the server is enabled' do
140
147
 
141
148
  context 'and the server is running' do
149
+ # @todo
142
150
  # it { subject.must_equal(:running) }
143
151
  # it { skip }
144
152
  end
145
153
 
146
154
  context 'and the server is not running' do
155
+ # @todo
147
156
  # it { subject.must_equal(:stopped) }
148
157
  # it { skip }
149
158
  end