vedeu 0.8.6 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/.travis.yml +1 -1
- data/README.md +2 -6
- data/config/rubocop_enabled.yml +0 -6
- data/docs/dsl/by_method/clock_time.md +4 -1
- data/lib/vedeu/application/application_controller.rb +2 -2
- data/lib/vedeu/application/controller.rb +3 -3
- data/lib/vedeu/borders/border.rb +6 -6
- data/lib/vedeu/borders/dsl.rb +26 -26
- data/lib/vedeu/borders/refresh.rb +2 -2
- data/lib/vedeu/borders/title.rb +4 -4
- data/lib/vedeu/buffers/refresh.rb +8 -7
- data/lib/vedeu/buffers/terminal.rb +1 -1
- data/lib/vedeu/buffers/view.rb +2 -2
- data/lib/vedeu/cells/clear.rb +1 -1
- data/lib/vedeu/cells/cursor.rb +6 -6
- data/lib/vedeu/cells/empty.rb +2 -2
- data/lib/vedeu/cells/escape.rb +6 -6
- data/lib/vedeu/coercers/alignment.rb +1 -1
- data/lib/vedeu/coercers/colour_attributes.rb +8 -16
- data/lib/vedeu/colours/background.rb +4 -8
- data/lib/vedeu/colours/colour.rb +4 -4
- data/lib/vedeu/colours/foreground.rb +4 -8
- data/lib/vedeu/colours/repository.rb +1 -1
- data/lib/vedeu/colours/translator.rb +6 -6
- data/lib/vedeu/common.rb +1 -1
- data/lib/vedeu/configuration/api.rb +15 -15
- data/lib/vedeu/configuration/configuration.rb +8 -8
- data/lib/vedeu/cursors/coordinate.rb +4 -4
- data/lib/vedeu/cursors/cursor.rb +2 -2
- data/lib/vedeu/distributed/client.rb +2 -2
- data/lib/vedeu/distributed/server.rb +8 -10
- data/lib/vedeu/distributed/subprocess.rb +1 -1
- data/lib/vedeu/distributed/uri.rb +1 -1
- data/lib/vedeu/dsl/cursors.rb +2 -2
- data/lib/vedeu/dsl/elements.rb +5 -5
- data/lib/vedeu/dsl/helpers/align.rb +1 -1
- data/lib/vedeu/dsl/helpers/attributes.rb +1 -1
- data/lib/vedeu/dsl/presentation.rb +15 -15
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/dsl/views.rb +1 -1
- data/lib/vedeu/editor/cursor.rb +1 -1
- data/lib/vedeu/editor/line.rb +2 -2
- data/lib/vedeu/editor/lines.rb +2 -2
- data/lib/vedeu/esc/borders.rb +19 -19
- data/lib/vedeu/esc/colours.rb +1 -1
- data/lib/vedeu/events/aliases.rb +3 -15
- data/lib/vedeu/events/event.rb +14 -14
- data/lib/vedeu/events/repository.rb +1 -1
- data/lib/vedeu/geometries/area/area.rb +5 -5
- data/lib/vedeu/geometries/area/dimension.rb +1 -1
- data/lib/vedeu/geometries/dsl/dsl.rb +7 -7
- data/lib/vedeu/geometries/geometry.rb +2 -2
- data/lib/vedeu/geometries/position.rb +6 -6
- data/lib/vedeu/groups/clear.rb +2 -2
- data/lib/vedeu/groups/group.rb +2 -2
- data/lib/vedeu/input/dsl.rb +1 -1
- data/lib/vedeu/input/key.rb +3 -3
- data/lib/vedeu/input/mapper.rb +2 -2
- data/lib/vedeu/input/read.rb +2 -4
- data/lib/vedeu/input/store.rb +1 -17
- data/lib/vedeu/input/translator.rb +49 -45
- data/lib/vedeu/interfaces/clear.rb +3 -3
- data/lib/vedeu/interfaces/dsl.rb +4 -4
- data/lib/vedeu/interfaces/interface.rb +2 -2
- data/lib/vedeu/logging/clock_time.rb +3 -3
- data/lib/vedeu/logging/debug.rb +14 -6
- data/lib/vedeu/logging/log.rb +1 -1
- data/lib/vedeu/menus/dsl.rb +2 -2
- data/lib/vedeu/menus/menu.rb +9 -9
- data/lib/vedeu/models/focus.rb +11 -11
- data/lib/vedeu/models/page.rb +1 -1
- data/lib/vedeu/models/row.rb +1 -1
- data/lib/vedeu/models/toggleable.rb +7 -7
- data/lib/vedeu/null/generic.rb +29 -29
- data/lib/vedeu/output/compressor_cache.rb +1 -11
- data/lib/vedeu/output/viewport.rb +4 -12
- data/lib/vedeu/output/write.rb +3 -3
- data/lib/vedeu/plugins/plugin.rb +1 -1
- data/lib/vedeu/presentation/colour.rb +1 -1
- data/lib/vedeu/presentation/presentation.rb +1 -1
- data/lib/vedeu/presentation/style.rb +4 -4
- data/lib/vedeu/renderers/all.rb +1 -14
- data/lib/vedeu/renderers/options.rb +1 -1
- data/lib/vedeu/repositories/all.rb +1 -0
- data/lib/vedeu/repositories/assemblage.rb +1 -1
- data/lib/vedeu/repositories/collection.rb +4 -4
- data/lib/vedeu/repositories/registerable.rb +2 -2
- data/lib/vedeu/repositories/repositories.rb +1 -1
- data/lib/vedeu/repositories/repository.rb +3 -3
- data/lib/vedeu/repositories/storage.rb +38 -0
- data/lib/vedeu/repositories/store.rb +5 -22
- data/lib/vedeu/runtime/application.rb +1 -1
- data/lib/vedeu/runtime/flags.rb +3 -3
- data/lib/vedeu/runtime/router.rb +3 -18
- data/lib/vedeu/templating/helpers.rb +5 -3
- data/lib/vedeu/templating/view_template.rb +26 -18
- data/lib/vedeu/terminal/terminal.rb +5 -5
- data/lib/vedeu/version.rb +1 -1
- data/lib/vedeu/views/chars.rb +1 -1
- data/lib/vedeu/views/composition.rb +4 -4
- data/lib/vedeu/views/default_attributes.rb +2 -2
- data/lib/vedeu/views/line.rb +6 -6
- data/lib/vedeu/views/lines.rb +1 -1
- data/lib/vedeu/views/stream.rb +6 -6
- data/lib/vedeu/views/streams.rb +1 -1
- data/lib/vedeu/views/view.rb +4 -4
- data/test/lib/vedeu/borders/border_test.rb +1 -1
- data/test/lib/vedeu/borders/caption_test.rb +1 -1
- data/test/lib/vedeu/borders/dsl_test.rb +2 -3
- data/test/lib/vedeu/borders/refresh_test.rb +1 -1
- data/test/lib/vedeu/borders/title_test.rb +1 -1
- data/test/lib/vedeu/buffers/buffer_test.rb +7 -7
- data/test/lib/vedeu/buffers/refresh_test.rb +1 -1
- data/test/lib/vedeu/colours/background_test.rb +27 -0
- data/test/lib/vedeu/colours/foreground_test.rb +27 -0
- data/test/lib/vedeu/cursors/cursor_test.rb +3 -3
- data/test/lib/vedeu/cursors/move_test.rb +1 -1
- data/test/lib/vedeu/cursors/refresh_test.rb +1 -1
- data/test/lib/vedeu/cursors/reposition_test.rb +2 -2
- data/test/lib/vedeu/dsl/view_test.rb +6 -8
- data/test/lib/vedeu/editor/cropper_test.rb +1 -1
- data/test/lib/vedeu/editor/cursor_test.rb +1 -1
- data/test/lib/vedeu/editor/document_test.rb +1 -1
- data/test/lib/vedeu/editor/editor_test.rb +1 -1
- data/test/lib/vedeu/events/aliases_test.rb +0 -14
- data/test/lib/vedeu/geometries/area/area_test.rb +1 -1
- data/test/lib/vedeu/geometries/geometry_test.rb +1 -1
- data/test/lib/vedeu/geometries/move_test.rb +1 -1
- data/test/lib/vedeu/groups/clear_test.rb +1 -1
- data/test/lib/vedeu/groups/dsl_test.rb +1 -1
- data/test/lib/vedeu/groups/group_test.rb +1 -1
- data/test/lib/vedeu/groups/refresh_test.rb +1 -1
- data/test/lib/vedeu/input/capture_test.rb +2 -2
- data/test/lib/vedeu/input/store_test.rb +0 -34
- data/test/lib/vedeu/interfaces/clear_test.rb +1 -1
- data/test/lib/vedeu/interfaces/dsl_test.rb +4 -4
- data/test/lib/vedeu/interfaces/interface_test.rb +1 -1
- data/test/lib/vedeu/menus/dsl_test.rb +1 -1
- data/test/lib/vedeu/null/generic_test.rb +1 -1
- data/test/lib/vedeu/output/compressor_cache_test.rb +0 -33
- data/test/lib/vedeu/renderers/all_test.rb +0 -8
- data/test/lib/vedeu/repositories/repository_test.rb +2 -2
- data/test/lib/vedeu/repositories/storage_test.rb +74 -0
- data/test/lib/vedeu/repositories/store_test.rb +10 -28
- data/test/lib/vedeu/runtime/router_test.rb +0 -8
- data/test/lib/vedeu/views/default_attributes_test.rb +5 -5
- data/test/lib/vedeu/views/view_test.rb +5 -2
- data/test/test_helper.rb +1 -1
- data/vedeu.gemspec +1 -1
- metadata +7 -4
@@ -0,0 +1,74 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
module Vedeu
|
4
|
+
|
5
|
+
module Repositories
|
6
|
+
|
7
|
+
module StorageTestModule
|
8
|
+
|
9
|
+
extend self
|
10
|
+
extend Vedeu::Repositories::Storage
|
11
|
+
|
12
|
+
def store(test_item = nil)
|
13
|
+
storage << test_item if test_item
|
14
|
+
end
|
15
|
+
|
16
|
+
def in_memory
|
17
|
+
[]
|
18
|
+
end
|
19
|
+
|
20
|
+
end # StorageTestModule
|
21
|
+
|
22
|
+
describe Storage do
|
23
|
+
|
24
|
+
let(:extended_described) { Vedeu::Repositories::StorageTestModule }
|
25
|
+
|
26
|
+
describe '#all' do
|
27
|
+
it { extended_described.must_respond_to(:all) }
|
28
|
+
end
|
29
|
+
|
30
|
+
describe '#reset' do
|
31
|
+
it { extended_described.must_respond_to(:reset) }
|
32
|
+
end
|
33
|
+
|
34
|
+
describe '#reset!' do
|
35
|
+
before do
|
36
|
+
extended_described.reset!
|
37
|
+
extended_described.store(:some_item)
|
38
|
+
end
|
39
|
+
|
40
|
+
subject { extended_described.reset! }
|
41
|
+
|
42
|
+
it 'resets the storage to an empty state' do
|
43
|
+
extended_described.storage.must_equal([:some_item])
|
44
|
+
subject.must_equal([])
|
45
|
+
end
|
46
|
+
end
|
47
|
+
|
48
|
+
describe '#storage' do
|
49
|
+
subject { extended_described.storage }
|
50
|
+
|
51
|
+
context 'when the storage is empty' do
|
52
|
+
before { extended_described.reset! }
|
53
|
+
|
54
|
+
it { subject.must_equal([]) }
|
55
|
+
end
|
56
|
+
|
57
|
+
context 'when the storage is not empty' do
|
58
|
+
let(:expected) { [:some_item, :other_item] }
|
59
|
+
|
60
|
+
before do
|
61
|
+
extended_described.reset!
|
62
|
+
extended_described.store(:some_item)
|
63
|
+
extended_described.store(:other_item)
|
64
|
+
end
|
65
|
+
|
66
|
+
it { subject.must_equal(expected) }
|
67
|
+
end
|
68
|
+
end
|
69
|
+
|
70
|
+
end # Storage
|
71
|
+
|
72
|
+
end # Repositories
|
73
|
+
|
74
|
+
end # Vedeu
|
@@ -30,6 +30,14 @@ module Vedeu
|
|
30
30
|
let(:model) {}
|
31
31
|
let(:storage) {}
|
32
32
|
|
33
|
+
describe '#all' do
|
34
|
+
it { instance.must_respond_to(:all) }
|
35
|
+
end
|
36
|
+
|
37
|
+
describe '#clear' do
|
38
|
+
it { instance.must_respond_to(:clear) }
|
39
|
+
end
|
40
|
+
|
33
41
|
describe '#each' do
|
34
42
|
subject { instance.each }
|
35
43
|
|
@@ -55,8 +63,8 @@ module Vedeu
|
|
55
63
|
|
56
64
|
subject { instance.exists?(_name) }
|
57
65
|
|
58
|
-
context 'when empty' do
|
59
|
-
let(:_name) {
|
66
|
+
context 'when the store is empty' do
|
67
|
+
let(:_name) { :vedeu_repositories_store }
|
60
68
|
|
61
69
|
it { subject.must_equal(false) }
|
62
70
|
end
|
@@ -130,26 +138,6 @@ module Vedeu
|
|
130
138
|
end
|
131
139
|
end
|
132
140
|
|
133
|
-
describe '#reset' do
|
134
|
-
before { Vedeu.stubs(:log) }
|
135
|
-
|
136
|
-
it 'returns a Hash' do
|
137
|
-
instance.reset.must_be_instance_of(Hash)
|
138
|
-
end
|
139
|
-
|
140
|
-
it 'resets the repository' do
|
141
|
-
instance.reset.must_equal({})
|
142
|
-
end
|
143
|
-
end
|
144
|
-
|
145
|
-
describe '#reset!' do
|
146
|
-
it { instance.must_respond_to(:reset!) }
|
147
|
-
end
|
148
|
-
|
149
|
-
describe '#clear' do
|
150
|
-
it { instance.must_respond_to(:clear) }
|
151
|
-
end
|
152
|
-
|
153
141
|
describe '#size' do
|
154
142
|
subject { instance.size }
|
155
143
|
|
@@ -164,12 +152,6 @@ module Vedeu
|
|
164
152
|
end
|
165
153
|
end
|
166
154
|
|
167
|
-
describe '#storage' do
|
168
|
-
subject { instance.storage }
|
169
|
-
|
170
|
-
it { subject.must_equal({}) }
|
171
|
-
end
|
172
|
-
|
173
155
|
describe '#all' do
|
174
156
|
it { instance.must_respond_to(:all) }
|
175
157
|
end
|
@@ -13,11 +13,11 @@ module Vedeu
|
|
13
13
|
def nil_for_testing_purposes
|
14
14
|
nil
|
15
15
|
end
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
16
|
+
alias client nil_for_testing_purposes
|
17
|
+
alias colour nil_for_testing_purposes
|
18
|
+
alias name nil_for_testing_purposes
|
19
|
+
alias parent nil_for_testing_purposes
|
20
|
+
alias style nil_for_testing_purposes
|
21
21
|
|
22
22
|
end # DefaultAttributesTest
|
23
23
|
|
@@ -25,7 +25,7 @@ module Vedeu
|
|
25
25
|
let(:client) {}
|
26
26
|
let(:colour) {}
|
27
27
|
let(:cursor_visible) {}
|
28
|
-
let(:_name) {
|
28
|
+
let(:_name) { :vedeu_views_view }
|
29
29
|
let(:parent) {}
|
30
30
|
let(:style) {}
|
31
31
|
let(:_value) {}
|
@@ -35,7 +35,10 @@ module Vedeu
|
|
35
35
|
it { instance.must_be_instance_of(described) }
|
36
36
|
it { instance.instance_variable_get('@client').must_equal(client) }
|
37
37
|
it { instance.instance_variable_get('@colour').must_equal(colour) }
|
38
|
-
it
|
38
|
+
it do
|
39
|
+
instance.instance_variable_get('@cursor_visible')
|
40
|
+
.must_equal(cursor_visible)
|
41
|
+
end
|
39
42
|
it { instance.instance_variable_get('@name').must_equal(_name) }
|
40
43
|
it { instance.instance_variable_get('@parent').must_equal(parent) }
|
41
44
|
it { instance.instance_variable_get('@style').must_equal(style) }
|
data/test/test_helper.rb
CHANGED
data/vedeu.gemspec
CHANGED
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'minitest', '5.8.3'
|
27
27
|
spec.add_development_dependency 'minitest-reporters', '1.1.7'
|
28
28
|
spec.add_development_dependency 'mocha', '1.1.0'
|
29
|
-
spec.add_development_dependency 'rubocop', '0.
|
29
|
+
spec.add_development_dependency 'rubocop', '0.36.0'
|
30
30
|
spec.add_development_dependency 'simplecov', '0.11.1'
|
31
31
|
spec.add_development_dependency 'simplecov-console', '0.3.0'
|
32
32
|
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.8.
|
4
|
+
version: 0.8.7
|
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-01-
|
11
|
+
date: 2016-01-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - '='
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.
|
103
|
+
version: 0.36.0
|
104
104
|
type: :development
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - '='
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.
|
110
|
+
version: 0.36.0
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: simplecov
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -766,6 +766,7 @@ files:
|
|
766
766
|
- lib/vedeu/repositories/registerable.rb
|
767
767
|
- lib/vedeu/repositories/repositories.rb
|
768
768
|
- lib/vedeu/repositories/repository.rb
|
769
|
+
- lib/vedeu/repositories/storage.rb
|
769
770
|
- lib/vedeu/repositories/store.rb
|
770
771
|
- lib/vedeu/runtime/all.rb
|
771
772
|
- lib/vedeu/runtime/application.rb
|
@@ -975,6 +976,7 @@ files:
|
|
975
976
|
- test/lib/vedeu/repositories/registerable_test.rb
|
976
977
|
- test/lib/vedeu/repositories/repositories_test.rb
|
977
978
|
- test/lib/vedeu/repositories/repository_test.rb
|
979
|
+
- test/lib/vedeu/repositories/storage_test.rb
|
978
980
|
- test/lib/vedeu/repositories/store_test.rb
|
979
981
|
- test/lib/vedeu/runtime/application_test.rb
|
980
982
|
- test/lib/vedeu/runtime/bootstrap_test.rb
|
@@ -1224,6 +1226,7 @@ test_files:
|
|
1224
1226
|
- test/lib/vedeu/repositories/registerable_test.rb
|
1225
1227
|
- test/lib/vedeu/repositories/repositories_test.rb
|
1226
1228
|
- test/lib/vedeu/repositories/repository_test.rb
|
1229
|
+
- test/lib/vedeu/repositories/storage_test.rb
|
1227
1230
|
- test/lib/vedeu/repositories/store_test.rb
|
1228
1231
|
- test/lib/vedeu/runtime/application_test.rb
|
1229
1232
|
- test/lib/vedeu/runtime/bootstrap_test.rb
|