vedeu 0.4.58 → 0.4.59
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +0 -558
- data/README.md +2 -0
- data/docs/dsl.md +66 -54
- data/lib/vedeu/all.rb +44 -16
- data/lib/vedeu/api.rb +0 -2
- data/lib/vedeu/bindings/drb.rb +0 -1
- data/lib/vedeu/bindings/menus.rb +0 -1
- data/lib/vedeu/bindings/movement.rb +0 -1
- data/lib/vedeu/bindings/system.rb +0 -1
- data/lib/vedeu/bindings/visibility.rb +0 -1
- data/lib/vedeu/bootstrap.rb +2 -2
- data/lib/vedeu/buffers/buffers.rb +0 -4
- data/lib/vedeu/cli/generator/all.rb +0 -4
- data/lib/vedeu/cli/generator/helpers.rb +0 -2
- data/lib/vedeu/cli/generator/templates/application/application.erb +8 -5
- data/lib/vedeu/cli/generator/view.rb +4 -2
- data/lib/vedeu/cli/main.rb +0 -2
- data/lib/vedeu/colours/backgrounds.rb +0 -1
- data/lib/vedeu/colours/colours.rb +0 -1
- data/lib/vedeu/colours/foregrounds.rb +0 -1
- data/lib/vedeu/configuration/api.rb +19 -6
- data/lib/vedeu/configuration/cli.rb +9 -1
- data/lib/vedeu/configuration/configuration.rb +9 -0
- data/lib/vedeu/cursor/cursor.rb +0 -2
- data/lib/vedeu/cursor/cursors.rb +0 -3
- data/lib/vedeu/debug.rb +0 -1
- data/lib/vedeu/dsl.rb +0 -1
- data/lib/vedeu/dsl/border.rb +69 -106
- data/lib/vedeu/dsl/composition.rb +1 -2
- data/lib/vedeu/dsl/geometry.rb +102 -67
- data/lib/vedeu/dsl/group.rb +21 -9
- data/lib/vedeu/dsl/interface.rb +0 -1
- data/lib/vedeu/dsl/keymap.rb +26 -36
- data/lib/vedeu/dsl/line.rb +5 -10
- data/lib/vedeu/dsl/menu.rb +7 -13
- data/lib/vedeu/dsl/presentation.rb +0 -1
- data/lib/vedeu/dsl/stream.rb +0 -1
- data/lib/vedeu/dsl/text.rb +0 -1
- data/lib/vedeu/dsl/use.rb +0 -1
- data/lib/vedeu/dsl/view.rb +28 -31
- data/lib/vedeu/events/event.rb +0 -3
- data/lib/vedeu/events/events.rb +0 -1
- data/lib/vedeu/events/trigger.rb +0 -1
- data/lib/vedeu/geometry/geometries.rb +0 -4
- data/lib/vedeu/geometry/geometry.rb +0 -2
- data/lib/vedeu/geometry/grid.rb +2 -25
- data/lib/vedeu/input/keymap.rb +0 -3
- data/lib/vedeu/input/keymaps.rb +0 -3
- data/lib/vedeu/launcher.rb +0 -1
- data/lib/vedeu/log.rb +0 -1
- data/lib/vedeu/models/char.rb +0 -5
- data/lib/vedeu/models/group.rb +0 -2
- data/lib/vedeu/models/groups.rb +0 -3
- data/lib/vedeu/models/interface.rb +0 -19
- data/lib/vedeu/models/interfaces.rb +0 -4
- data/lib/vedeu/models/menus.rb +0 -3
- data/lib/vedeu/null/interface.rb +6 -7
- data/lib/vedeu/output/border.rb +0 -2
- data/lib/vedeu/output/borders.rb +0 -4
- data/lib/vedeu/output/esc.rb +0 -1
- data/lib/vedeu/output/html_char.rb +0 -2
- data/lib/vedeu/output/refresh.rb +0 -3
- data/lib/vedeu/output/refresh_group.rb +0 -2
- data/lib/vedeu/output/renderers.rb +0 -13
- data/lib/vedeu/repositories.rb +2 -15
- data/lib/vedeu/repositories/model.rb +0 -2
- data/lib/vedeu/repositories/repository.rb +0 -2
- data/lib/vedeu/templating/template.rb +0 -2
- data/lib/vedeu/terminal.rb +0 -3
- data/lib/vedeu/timer.rb +0 -1
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/bootstrap_test.rb +8 -1
- data/test/lib/vedeu/configuration/api_test.rb +14 -0
- data/test/lib/vedeu/configuration/cli_test.rb +15 -0
- data/test/lib/vedeu/cursor/cursor_test.rb +0 -1
- data/test/lib/vedeu/models/interface_test.rb +12 -4
- data/test/lib/vedeu/null/interface_test.rb +3 -12
- data/test/support/helpers/model_test_class.rb +0 -3
- data/test/test_helper.rb +0 -2
- data/vedeu.gemspec +1 -1
- metadata +4 -4
data/lib/vedeu/models/menus.rb
CHANGED
data/lib/vedeu/null/interface.rb
CHANGED
@@ -18,6 +18,11 @@ module Vedeu
|
|
18
18
|
# @return [String]
|
19
19
|
attr_reader :attributes
|
20
20
|
|
21
|
+
# @!attribute [rw] visible
|
22
|
+
# @return [String]
|
23
|
+
attr_accessor :visible
|
24
|
+
alias_method :visible?, :visible
|
25
|
+
|
21
26
|
# Returns a new instance of Vedeu::Null::Interface.
|
22
27
|
#
|
23
28
|
# @param attributes [Hash<Symbol => void>]
|
@@ -26,6 +31,7 @@ module Vedeu
|
|
26
31
|
def initialize(attributes = {})
|
27
32
|
@attributes = attributes
|
28
33
|
@name = @attributes[:name]
|
34
|
+
@visible = @attributes[:visible]
|
29
35
|
end
|
30
36
|
|
31
37
|
# @return [NilClass]
|
@@ -69,13 +75,6 @@ module Vedeu
|
|
69
75
|
false
|
70
76
|
end
|
71
77
|
|
72
|
-
# Override the visible= setter usually found on a Vedeu::Interface.
|
73
|
-
#
|
74
|
-
# @return [FalseClass]
|
75
|
-
def visible=(*)
|
76
|
-
false
|
77
|
-
end
|
78
|
-
|
79
78
|
end # Interface
|
80
79
|
|
81
80
|
end # Null
|
data/lib/vedeu/output/border.rb
CHANGED
data/lib/vedeu/output/borders.rb
CHANGED
data/lib/vedeu/output/esc.rb
CHANGED
data/lib/vedeu/output/refresh.rb
CHANGED
@@ -1,5 +1,3 @@
|
|
1
|
-
require 'vedeu/output/refresh_group'
|
2
|
-
|
3
1
|
module Vedeu
|
4
2
|
|
5
3
|
# Refreshes the terminal.
|
@@ -9,7 +7,6 @@ module Vedeu
|
|
9
7
|
# in z-index order, meaning that interfaces with a lower z-index will be
|
10
8
|
# drawn first. This means overlapping interfaces will be drawn as specified.
|
11
9
|
#
|
12
|
-
# @api public
|
13
10
|
module Refresh
|
14
11
|
|
15
12
|
module_function
|
@@ -1,12 +1,3 @@
|
|
1
|
-
require 'vedeu/output/renderers/renderer_options'
|
2
|
-
require 'vedeu/output/renderers/escape_sequence'
|
3
|
-
require 'vedeu/output/renderers/file'
|
4
|
-
require 'vedeu/output/renderers/html'
|
5
|
-
require 'vedeu/output/renderers/json'
|
6
|
-
require 'vedeu/output/renderers/null'
|
7
|
-
require 'vedeu/output/renderers/terminal'
|
8
|
-
require 'vedeu/output/renderers/text'
|
9
|
-
|
10
1
|
module Vedeu
|
11
2
|
|
12
3
|
# Provides a single interface to all registered renderers.
|
@@ -21,7 +12,6 @@ module Vedeu
|
|
21
12
|
# @example
|
22
13
|
# Vedeu.renderers
|
23
14
|
#
|
24
|
-
# @api public
|
25
15
|
# @return [Module]
|
26
16
|
def renderers
|
27
17
|
self
|
@@ -30,7 +20,6 @@ module Vedeu
|
|
30
20
|
# @example
|
31
21
|
# Vedeu.renderers.render(output)
|
32
22
|
#
|
33
|
-
# @api public
|
34
23
|
# @param output [void]
|
35
24
|
# @return [Array<void>]
|
36
25
|
def render(output)
|
@@ -55,7 +44,6 @@ module Vedeu
|
|
55
44
|
# @note
|
56
45
|
# A renderer class must respond to the '.render' class method.
|
57
46
|
#
|
58
|
-
# @api public
|
59
47
|
# @param renderers [Class]
|
60
48
|
# @return [Set]
|
61
49
|
def renderer(*renderers)
|
@@ -67,7 +55,6 @@ module Vedeu
|
|
67
55
|
# @example
|
68
56
|
# Vedeu.renderers.reset
|
69
57
|
#
|
70
|
-
# @api public
|
71
58
|
# @return [Set]
|
72
59
|
def reset
|
73
60
|
@storage = Set.new
|
data/lib/vedeu/repositories.rb
CHANGED
@@ -6,6 +6,8 @@ module Vedeu
|
|
6
6
|
|
7
7
|
extend self
|
8
8
|
|
9
|
+
# Register a repository with the collection of Vedeu repositories.
|
10
|
+
#
|
9
11
|
# @param klass [Class]
|
10
12
|
# @return [Set]
|
11
13
|
def register(klass)
|
@@ -55,18 +57,3 @@ module Vedeu
|
|
55
57
|
end # Repositories
|
56
58
|
|
57
59
|
end # Vedeu
|
58
|
-
|
59
|
-
require 'vedeu/repositories/store'
|
60
|
-
require 'vedeu/repositories/registerable'
|
61
|
-
require 'vedeu/repositories/collection'
|
62
|
-
|
63
|
-
require 'vedeu/events/event_collection'
|
64
|
-
require 'vedeu/input/keys'
|
65
|
-
|
66
|
-
require 'vedeu/models/chars'
|
67
|
-
require 'vedeu/models/interface_collection'
|
68
|
-
require 'vedeu/models/lines'
|
69
|
-
require 'vedeu/models/streams'
|
70
|
-
|
71
|
-
require 'vedeu/repositories/model'
|
72
|
-
require 'vedeu/repositories/repository'
|
data/lib/vedeu/terminal.rb
CHANGED
data/lib/vedeu/timer.rb
CHANGED
data/lib/vedeu/version.rb
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
+
module YourApp
|
4
|
+
|
5
|
+
class SomeController
|
6
|
+
end # SomeController
|
7
|
+
|
8
|
+
end # YourApp
|
9
|
+
|
3
10
|
module Vedeu
|
4
11
|
|
5
12
|
describe Bootstrap do
|
@@ -7,7 +14,7 @@ module Vedeu
|
|
7
14
|
let(:described) { Vedeu::Bootstrap }
|
8
15
|
let(:instance) { described.new(argv, entry_point) }
|
9
16
|
let(:argv) { [] }
|
10
|
-
let(:entry_point) {}
|
17
|
+
let(:entry_point) { YourApp::SomeController.new }
|
11
18
|
|
12
19
|
describe '#initialize' do
|
13
20
|
it { instance.must_be_instance_of(described) }
|
@@ -1,5 +1,12 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
+
module YourApp
|
4
|
+
|
5
|
+
class SomeController
|
6
|
+
end # SomeController
|
7
|
+
|
8
|
+
end # YourApp
|
9
|
+
|
3
10
|
module Vedeu
|
4
11
|
|
5
12
|
module Config
|
@@ -225,6 +232,13 @@ module Vedeu
|
|
225
232
|
it { instance.must_respond_to(:renderers) }
|
226
233
|
end
|
227
234
|
|
235
|
+
describe '#root' do
|
236
|
+
it 'sets the options to the desired value' do
|
237
|
+
configuration = Vedeu.configure { root(::YourApp::SomeController.new) }
|
238
|
+
configuration.root.must_be_instance_of(YourApp::SomeController)
|
239
|
+
end
|
240
|
+
end
|
241
|
+
|
228
242
|
describe '#stdin' do
|
229
243
|
let(:io) {}
|
230
244
|
|
@@ -1,5 +1,13 @@
|
|
1
1
|
require 'test_helper'
|
2
2
|
|
3
|
+
module YourApp
|
4
|
+
|
5
|
+
class SomeController
|
6
|
+
|
7
|
+
end # SomeController
|
8
|
+
|
9
|
+
end # YourApp
|
10
|
+
|
3
11
|
module Vedeu
|
4
12
|
|
5
13
|
module Config
|
@@ -119,6 +127,13 @@ module Vedeu
|
|
119
127
|
end
|
120
128
|
end
|
121
129
|
|
130
|
+
describe '#root' do
|
131
|
+
it '--root' do
|
132
|
+
Configuration.configure(['--root', 'YourApp::SomeController.new'])
|
133
|
+
Configuration.root.must_equal('YourApp::SomeController.new')
|
134
|
+
end
|
135
|
+
end
|
136
|
+
|
122
137
|
describe '#terminal_mode' do
|
123
138
|
it '--cooked' do
|
124
139
|
Configuration.configure(['--cooked'])
|
@@ -74,10 +74,14 @@ module Vedeu
|
|
74
74
|
end
|
75
75
|
|
76
76
|
describe '#hide' do
|
77
|
+
before { Vedeu::Output.stubs(:render) }
|
78
|
+
|
77
79
|
subject { instance.hide }
|
78
80
|
|
79
|
-
|
80
|
-
|
81
|
+
it {
|
82
|
+
Vedeu::Output.expects(:render)
|
83
|
+
subject
|
84
|
+
}
|
81
85
|
end
|
82
86
|
|
83
87
|
describe '#inspect' do
|
@@ -161,10 +165,14 @@ module Vedeu
|
|
161
165
|
end
|
162
166
|
|
163
167
|
describe '#show' do
|
168
|
+
before { Vedeu::Output.stubs(:render) }
|
169
|
+
|
164
170
|
subject { instance.show }
|
165
171
|
|
166
|
-
|
167
|
-
|
172
|
+
it {
|
173
|
+
Vedeu::Output.expects(:render)
|
174
|
+
subject
|
175
|
+
}
|
168
176
|
end
|
169
177
|
|
170
178
|
describe '#store' do
|
@@ -26,6 +26,9 @@ module Vedeu
|
|
26
26
|
describe 'accessors' do
|
27
27
|
it { instance.must_respond_to(:name) }
|
28
28
|
it { instance.must_respond_to(:attributes) }
|
29
|
+
it { instance.must_respond_to(:visible) }
|
30
|
+
it { instance.must_respond_to(:visible=) }
|
31
|
+
it { instance.must_respond_to(:visible?) }
|
29
32
|
end
|
30
33
|
|
31
34
|
describe '#hide' do
|
@@ -52,18 +55,6 @@ module Vedeu
|
|
52
55
|
it { instance.toggle.must_be_instance_of(NilClass) }
|
53
56
|
end
|
54
57
|
|
55
|
-
describe '#visible?' do
|
56
|
-
it { instance.visible?.must_be_instance_of(FalseClass) }
|
57
|
-
end
|
58
|
-
|
59
|
-
describe '#visible=' do
|
60
|
-
subject { instance.visible=(:irrelevant) }
|
61
|
-
|
62
|
-
# @todo
|
63
|
-
# it { skip }
|
64
|
-
# it { subject.must_be_instance_of(FalseClass) }
|
65
|
-
end
|
66
|
-
|
67
58
|
end # Interface
|
68
59
|
|
69
60
|
end # Null
|
data/test/test_helper.rb
CHANGED
@@ -32,8 +32,6 @@ SimpleCov.start do
|
|
32
32
|
add_group 'null', 'vedeu/null'
|
33
33
|
add_group 'output', 'vedeu/output'
|
34
34
|
add_group 'repositories', 'vedeu/repositories'
|
35
|
-
add_group 'storage', 'vedeu/storage'
|
36
|
-
add_group 'support', 'vedeu/support'
|
37
35
|
add_group 'templating', 'vedeu/templating'
|
38
36
|
end unless ENV['NO_SIMPLECOV']
|
39
37
|
|
data/vedeu.gemspec
CHANGED
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
|
|
20
20
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
|
23
|
-
spec.add_development_dependency 'guard', '2.12.
|
23
|
+
spec.add_development_dependency 'guard', '2.12.9'
|
24
24
|
spec.add_development_dependency 'guard-minitest', '2.4.4'
|
25
25
|
spec.add_development_dependency 'minitest', '5.7.0'
|
26
26
|
spec.add_development_dependency 'minitest-reporters', '1.0.19'
|
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.4.
|
4
|
+
version: 0.4.59
|
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-07-
|
11
|
+
date: 2015-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.12.
|
19
|
+
version: 2.12.9
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - '='
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.12.
|
26
|
+
version: 2.12.9
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: guard-minitest
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|