vedeu 0.4.50 → 0.4.51
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Guardfile +0 -5
- data/examples/material_colours_app.rb +1 -1
- data/examples/panel_app.rb +1 -1
- data/lib/vedeu/cli/generator/templates/application/config/configuration.erb +7 -2
- data/lib/vedeu/configuration/configuration.rb +1 -1
- data/lib/vedeu/output/border.rb +0 -6
- data/lib/vedeu/output/clear/named_interface.rb +2 -2
- data/lib/vedeu/output/output.rb +12 -12
- data/lib/vedeu/output/render_border.rb +1 -1
- data/lib/vedeu/output/renderers/all.rb +10 -5
- data/lib/vedeu/output/renderers/escape_sequence.rb +21 -23
- data/lib/vedeu/output/renderers/file.rb +16 -27
- data/lib/vedeu/output/renderers/html.rb +36 -42
- data/lib/vedeu/output/renderers/json.rb +22 -5
- data/lib/vedeu/output/renderers/null.rb +28 -3
- data/lib/vedeu/output/renderers/terminal.rb +23 -19
- data/lib/vedeu/output/renderers/text.rb +18 -20
- data/lib/vedeu/output/virtual_terminal.rb +1 -1
- data/lib/vedeu/support/template.rb +1 -1
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/application/application_controller_test.rb +2 -0
- data/test/lib/vedeu/application/application_helper_test.rb +2 -0
- data/test/lib/vedeu/application/controller_test.rb +1 -1
- data/test/lib/vedeu/application/helper_test.rb +2 -0
- data/test/lib/vedeu/application/view_test.rb +2 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +1 -1
- data/test/lib/vedeu/buffers/display_buffer_test.rb +2 -0
- data/test/lib/vedeu/cli/generator/application_test.rb +2 -0
- data/test/lib/vedeu/cli/generator/helpers_test.rb +1 -0
- data/test/lib/vedeu/configuration/api_test.rb +3 -0
- data/test/lib/vedeu/cursor/move_test.rb +5 -0
- data/test/lib/vedeu/distributed/client_test.rb +4 -0
- data/test/lib/vedeu/distributed/server_test.rb +9 -0
- data/test/lib/vedeu/dsl/use_test.rb +4 -0
- data/test/lib/vedeu/launcher_test.rb +2 -0
- data/test/lib/vedeu/main_loop_test.rb +2 -0
- data/test/lib/vedeu/null/interface_test.rb +1 -0
- data/test/lib/vedeu/output/border_test.rb +0 -8
- data/test/lib/vedeu/output/output_test.rb +12 -11
- data/test/lib/vedeu/output/refresh_test.rb +1 -0
- data/test/lib/vedeu/output/render_border_test.rb +1 -0
- data/test/lib/vedeu/output/renderers/all_test.rb +4 -8
- data/test/lib/vedeu/output/renderers/escape_sequence_test.rb +5 -4
- data/test/lib/vedeu/output/renderers/file_test.rb +14 -19
- data/test/lib/vedeu/output/renderers/html_test.rb +55 -56
- data/test/lib/vedeu/output/renderers/json_test.rb +4 -5
- data/test/lib/vedeu/output/renderers/null_test.rb +9 -3
- data/test/lib/vedeu/output/renderers/terminal_test.rb +5 -4
- data/test/lib/vedeu/output/renderers/text_test.rb +5 -4
- data/test/lib/vedeu/output/text_test.rb +2 -0
- data/test/lib/vedeu/output/virtual_terminal_test.rb +10 -28
- data/test/lib/vedeu/repositories/collection_test.rb +1 -0
- data/test/lib/vedeu/repositories/model_test.rb +3 -0
- data/test/lib/vedeu/repositories/repository_test.rb +1 -0
- data/test/lib/vedeu/support/visibility_test.rb +1 -0
- data/test/lib/vedeu/traps_test.rb +1 -0
- data/test/lib/vedeu_test.rb +1 -0
- data/vedeu.gemspec +0 -2
- 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
|
-
#
|
11
|
-
|
12
|
-
|
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
|
13
|
+
# @param options [Hash]
|
20
14
|
# @return [Vedeu::Renderers::Terminal]
|
21
|
-
def initialize(
|
22
|
-
@
|
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
|
-
# @
|
39
|
-
|
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
|
13
|
+
# @param options [Hash]
|
20
14
|
# @return [Vedeu::Renderers::Text]
|
21
|
-
def initialize(
|
22
|
-
@
|
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
|
-
|
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
|
-
#
|
39
|
-
|
40
|
-
|
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
|
data/lib/vedeu/version.rb
CHANGED
@@ -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
|
|
@@ -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
|