vedeu 0.6.11 → 0.6.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/vedeu/bindings/system.rb +1 -5
- data/lib/vedeu/buffers/refresh.rb +1 -1
- data/lib/vedeu/output/renderers.rb +13 -0
- data/lib/vedeu/output/renderers/escape_sequence.rb +7 -0
- data/lib/vedeu/output/renderers/file.rb +9 -0
- data/lib/vedeu/output/renderers/html.rb +9 -0
- data/lib/vedeu/output/renderers/json.rb +11 -0
- data/lib/vedeu/output/renderers/null.rb +7 -0
- data/lib/vedeu/output/renderers/terminal.rb +7 -0
- data/lib/vedeu/output/renderers/text.rb +7 -0
- data/lib/vedeu/terminal/buffer.rb +10 -2
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/buffers/refresh_test.rb +19 -19
- data/test/support/examples/material_colours_app.rb +1 -1
- data/test/test_helper.rb +7 -7
- data/vedeu.gemspec +2 -2
- metadata +18 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3baa951de557aa4e39a7c9414fae7caea7c9efef
|
4
|
+
data.tar.gz: 58355bdd2dabc9b59d5c52fc99306a81afcc934b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b9f5da3a38e66ce269b8233084bfbec48fb67c2cd32abe33e71e12b03d2f77d85f816188b050b7f8d1ec92c8fdc14dcb00e5019efd8095c645de54cc39418e9c
|
7
|
+
data.tar.gz: 2c44e1296ac86195023e72bc5f40cc6428de275c9115b2322f3c756f25145bb5a7c3e3efd6a3eb33c059c66d3bde4b0dca1491f8ac5d8f36df1b5276dca0186a
|
@@ -42,7 +42,6 @@ module Vedeu
|
|
42
42
|
Vedeu::Clear::NamedInterface.render(name)
|
43
43
|
|
44
44
|
else
|
45
|
-
Vedeu::Terminal.clear
|
46
45
|
Vedeu::Terminal::Buffer.clear
|
47
46
|
|
48
47
|
end
|
@@ -68,10 +67,7 @@ module Vedeu
|
|
68
67
|
|
69
68
|
# See {file:docs/events/system.md#\_initialize_}
|
70
69
|
def initialize!
|
71
|
-
Vedeu.bind(:_initialize_)
|
72
|
-
Vedeu.ready!
|
73
|
-
Vedeu.trigger(:_refresh_)
|
74
|
-
end
|
70
|
+
Vedeu.bind(:_initialize_) { Vedeu.ready! }
|
75
71
|
end
|
76
72
|
|
77
73
|
# See {file:docs/events/system.md#\_keypress_}
|
@@ -7,6 +7,19 @@ module Vedeu
|
|
7
7
|
extend Enumerable
|
8
8
|
extend self
|
9
9
|
|
10
|
+
def clear
|
11
|
+
threads = storage.map do |renderer|
|
12
|
+
Thread.new(renderer) do
|
13
|
+
mutex.synchronize do
|
14
|
+
renderer.clear
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
18
|
+
threads.each(&:join)
|
19
|
+
|
20
|
+
''
|
21
|
+
end
|
22
|
+
|
10
23
|
# Provides access to the list of renderers.
|
11
24
|
#
|
12
25
|
# @example
|
@@ -22,6 +22,15 @@ module Vedeu
|
|
22
22
|
@options = options || {}
|
23
23
|
end
|
24
24
|
|
25
|
+
# Render a cleared output.
|
26
|
+
#
|
27
|
+
# @return [String]
|
28
|
+
def clear
|
29
|
+
::File.write(filename, '') if write_file?
|
30
|
+
|
31
|
+
''
|
32
|
+
end
|
33
|
+
|
25
34
|
# @param output [Vedeu::Models::Page]
|
26
35
|
# @return [String]
|
27
36
|
def render(output)
|
@@ -30,6 +30,15 @@ module Vedeu
|
|
30
30
|
@output = nil
|
31
31
|
end
|
32
32
|
|
33
|
+
# Render a cleared output.
|
34
|
+
#
|
35
|
+
# @return [String]
|
36
|
+
def clear
|
37
|
+
@output = Vedeu::Models::Escape.new
|
38
|
+
|
39
|
+
''
|
40
|
+
end
|
41
|
+
|
33
42
|
# @param output [Vedeu::Models::Page]
|
34
43
|
# @return [String]
|
35
44
|
def render(output)
|
@@ -14,6 +14,17 @@ module Vedeu
|
|
14
14
|
@options = options || {}
|
15
15
|
end
|
16
16
|
|
17
|
+
# Render a cleared output.
|
18
|
+
#
|
19
|
+
# @return [String]
|
20
|
+
def clear
|
21
|
+
json = parse({})
|
22
|
+
|
23
|
+
super(json)
|
24
|
+
|
25
|
+
json
|
26
|
+
end
|
27
|
+
|
17
28
|
# @param output [Vedeu::Models::Page]
|
18
29
|
# @return [String]
|
19
30
|
def render(output)
|
@@ -24,6 +24,15 @@ module Vedeu
|
|
24
24
|
end
|
25
25
|
alias_method :cells, :buffer
|
26
26
|
|
27
|
+
# Clear the output.
|
28
|
+
#
|
29
|
+
# @return [String|void] Most likely to be a String.
|
30
|
+
def clear
|
31
|
+
reset
|
32
|
+
|
33
|
+
Vedeu.renderers.clear if Vedeu.ready?
|
34
|
+
end
|
35
|
+
|
27
36
|
# @return [Array<Array<Vedeu::Models::Cell>>]
|
28
37
|
def empty_buffer
|
29
38
|
Array.new(Vedeu.height) do |y|
|
@@ -69,9 +78,8 @@ module Vedeu
|
|
69
78
|
#
|
70
79
|
# @return [Array<Array<Vedeu::Models::Cell>>]
|
71
80
|
def reset
|
72
|
-
@output = empty_buffer
|
81
|
+
@output = empty_buffer if Vedeu.ready?
|
73
82
|
end
|
74
|
-
alias_method :clear, :reset
|
75
83
|
|
76
84
|
# Write a collection of cells to the virtual terminal.
|
77
85
|
#
|
data/lib/vedeu/version.rb
CHANGED
@@ -9,6 +9,11 @@ module Vedeu
|
|
9
9
|
let(:described) { Vedeu::Buffers::Refresh }
|
10
10
|
let(:instance) { described.new(_name) }
|
11
11
|
let(:_name) { 'Vedeu::Buffers::Refresh' }
|
12
|
+
let(:ready) { true }
|
13
|
+
|
14
|
+
before do
|
15
|
+
Vedeu.stubs(:ready?).returns(ready)
|
16
|
+
end
|
12
17
|
|
13
18
|
describe '#initialize' do
|
14
19
|
it { instance.must_be_instance_of(described) }
|
@@ -18,28 +23,23 @@ module Vedeu
|
|
18
23
|
describe '.by_name' do
|
19
24
|
subject { described.by_name(_name) }
|
20
25
|
|
21
|
-
context 'when
|
22
|
-
let(:
|
26
|
+
context 'when Vedeu is not yet ready' do
|
27
|
+
let(:ready) { false }
|
23
28
|
|
24
|
-
it {
|
29
|
+
it { subject.must_equal(nil) }
|
25
30
|
end
|
26
31
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
# end
|
39
|
-
|
40
|
-
context 'when the name is present' do
|
41
|
-
# @todo Add more tests.
|
42
|
-
# it { skip }
|
32
|
+
context 'when Vedeu is ready' do
|
33
|
+
context 'when the name is not present' do
|
34
|
+
let(:_name) { '' }
|
35
|
+
|
36
|
+
it { proc { subject }.must_raise(Vedeu::Error::MissingRequired) }
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'when the name is present' do
|
40
|
+
# @todo Add more tests.
|
41
|
+
# it { skip }
|
42
|
+
end
|
43
43
|
end
|
44
44
|
end
|
45
45
|
|
data/test/test_helper.rb
CHANGED
@@ -92,13 +92,13 @@ require 'support/helpers/model_test_class'
|
|
92
92
|
# require 'minitest/reporters'
|
93
93
|
# require 'support/average_duration_reporter'
|
94
94
|
# Minitest::Reporters.use!(
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
95
|
+
# # # commented out by default (makes tests slower)
|
96
|
+
# # Minitest::Reporters::MeanTimeReporter.new({
|
97
|
+
# # previous_runs_filename: "/tmp/reports/durations",
|
98
|
+
# # report_filename: "/tmp/reports/durations_results"})
|
99
|
+
# # Minitest::Reporters::DefaultReporter.new({ color: true,
|
100
|
+
# # slow_suite_count: 15 }),
|
101
|
+
# # Minitest::Reporters::SpecReporter.new
|
102
102
|
# )
|
103
103
|
|
104
104
|
def test_configuration
|
data/vedeu.gemspec
CHANGED
@@ -24,10 +24,10 @@ Gem::Specification.new do |spec|
|
|
24
24
|
spec.add_development_dependency 'guard-minitest', '2.4.4'
|
25
25
|
spec.add_development_dependency 'guard-rubocop', '1.2.0'
|
26
26
|
spec.add_development_dependency 'minitest', '5.8.0'
|
27
|
-
|
27
|
+
spec.add_development_dependency 'minitest-reporters', '1.1.1'
|
28
28
|
spec.add_development_dependency 'mocha', '1.1.0'
|
29
29
|
spec.add_development_dependency 'pry', '0.10.1'
|
30
|
-
spec.add_development_dependency 'rubocop', '0.34.
|
30
|
+
spec.add_development_dependency 'rubocop', '0.34.2'
|
31
31
|
|
32
32
|
spec.add_development_dependency 'ruby-prof', '0.15.8'
|
33
33
|
spec.add_development_dependency 'simplecov', '0.10.0'
|
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.6.
|
4
|
+
version: 0.6.12
|
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-09-
|
11
|
+
date: 2015-09-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - '='
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: 5.8.0
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: minitest-reporters
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - '='
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: 1.1.1
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - '='
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: 1.1.1
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: mocha
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -100,14 +114,14 @@ dependencies:
|
|
100
114
|
requirements:
|
101
115
|
- - '='
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.34.
|
117
|
+
version: 0.34.2
|
104
118
|
type: :development
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - '='
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.34.
|
124
|
+
version: 0.34.2
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
126
|
name: ruby-prof
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|