vedeu 0.4.44 → 0.4.45
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.ruby-version +1 -1
- data/README.md +3 -2
- data/Rakefile +0 -6
- data/docs/api.md +56 -53
- data/docs/applications.md +1 -1
- data/docs/dsl.md +2 -0
- data/docs/getting_started.md +1 -1
- data/docs/object_graph.md +1 -1
- data/docs/views.md +1 -1
- data/lib/vedeu.rb +4 -0
- data/lib/vedeu/api.rb +75 -13
- data/lib/vedeu/application/application_view.rb +3 -0
- data/lib/vedeu/application/controller.rb +13 -0
- data/lib/vedeu/bootstrap.rb +11 -0
- data/lib/vedeu/buffers/buffer.rb +2 -0
- data/lib/vedeu/configuration/api.rb +1 -15
- data/lib/vedeu/configuration/configuration.rb +1 -0
- data/lib/vedeu/cursor/cursor.rb +2 -0
- data/lib/vedeu/geometry/dimension.rb +2 -0
- data/lib/vedeu/geometry/geometry.rb +4 -0
- data/lib/vedeu/input/keymap.rb +2 -0
- data/lib/vedeu/launcher.rb +14 -0
- data/lib/vedeu/main_loop.rb +2 -0
- data/lib/vedeu/models/cell.rb +2 -0
- data/lib/vedeu/models/char.rb +2 -0
- data/lib/vedeu/models/escape_char.rb +2 -0
- data/lib/vedeu/models/group.rb +2 -0
- data/lib/vedeu/output/clear.rb +2 -0
- data/lib/vedeu/output/esc.rb +8 -16
- data/lib/vedeu/output/render_border.rb +43 -19
- data/lib/vedeu/output/renderers/file.rb +2 -0
- data/lib/vedeu/output/wordwrap.rb +2 -0
- data/lib/vedeu/repositories/repositories/backgrounds.rb +1 -3
- data/lib/vedeu/repositories/repositories/borders.rb +0 -4
- data/lib/vedeu/repositories/repositories/buffers.rb +0 -4
- data/lib/vedeu/repositories/repositories/cursors.rb +1 -7
- data/lib/vedeu/repositories/repositories/events.rb +0 -4
- data/lib/vedeu/repositories/repositories/foregrounds.rb +1 -3
- data/lib/vedeu/repositories/repositories/geometries.rb +0 -4
- data/lib/vedeu/repositories/repositories/groups.rb +0 -4
- data/lib/vedeu/repositories/repositories/interfaces.rb +0 -4
- data/lib/vedeu/repositories/repositories/keymaps.rb +0 -4
- data/lib/vedeu/repositories/repositories/menus.rb +0 -4
- data/lib/vedeu/repositories/repository.rb +6 -0
- data/lib/vedeu/templating/directive.rb +3 -0
- data/lib/vedeu/traps.rb +2 -0
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/cli/generator/helpers_test.rb +33 -1
- data/test/lib/vedeu/distributed/client_test.rb +10 -0
- data/test/lib/vedeu/output/text_test.rb +18 -12
- data/test/lib/vedeu/repositories/repository_test.rb +11 -2
- data/test/support/helpers/model_test_class.rb +2 -0
- data/test/test_helper.rb +7 -2
- data/vedeu.gemspec +2 -3
- metadata +5 -21
- data/inch.yml +0 -5
- data/logs/.gitkeep +0 -0
@@ -7,16 +7,10 @@ module Vedeu
|
|
7
7
|
|
8
8
|
class << self
|
9
9
|
|
10
|
-
# @example
|
11
|
-
# Vedeu.cursors
|
12
|
-
#
|
13
|
-
# @return [Vedeu::Cursors]
|
14
10
|
alias_method :cursors, :repository
|
15
11
|
|
16
|
-
# @example
|
17
|
-
# Vedeu.cursor
|
18
|
-
#
|
19
12
|
# @return [Vedeu::Cursor]
|
13
|
+
# @see Vedeu::API.cursor
|
20
14
|
def cursor
|
21
15
|
cursors.by_name(Vedeu.focus) if Vedeu.focus
|
22
16
|
end
|
@@ -41,6 +41,8 @@ module Vedeu
|
|
41
41
|
self.class
|
42
42
|
end
|
43
43
|
|
44
|
+
# Return all the registered models.
|
45
|
+
#
|
44
46
|
# @return [Array<void>] An array containing each stored model.
|
45
47
|
def all
|
46
48
|
return storage.values if storage.is_a?(Hash)
|
@@ -48,6 +50,8 @@ module Vedeu
|
|
48
50
|
registered
|
49
51
|
end
|
50
52
|
|
53
|
+
# Return the named model or a null object if not registered.
|
54
|
+
#
|
51
55
|
# @param name [String] The name of the stored model.
|
52
56
|
# @return [void]
|
53
57
|
def by_name(name)
|
@@ -101,6 +105,8 @@ module Vedeu
|
|
101
105
|
end
|
102
106
|
end
|
103
107
|
|
108
|
+
# Override Ruby's Object#inspect method to provide a more helpful output.
|
109
|
+
#
|
104
110
|
# @return [String]
|
105
111
|
def inspect
|
106
112
|
"<#{self.class.name}: #{registered.inspect}>"
|
data/lib/vedeu/traps.rb
CHANGED
@@ -5,6 +5,7 @@ module Vedeu
|
|
5
5
|
# @api private
|
6
6
|
module Traps
|
7
7
|
|
8
|
+
# :nocov:
|
8
9
|
Signal.trap('INT') do
|
9
10
|
puts
|
10
11
|
exit(1)
|
@@ -20,6 +21,7 @@ module Vedeu
|
|
20
21
|
Signal.trap('USR2') {}
|
21
22
|
|
22
23
|
Signal.trap('SIGWINCH') { Vedeu.trigger(:_resize_) }
|
24
|
+
# :nocov:
|
23
25
|
|
24
26
|
end # Traps
|
25
27
|
|
data/lib/vedeu/version.rb
CHANGED
@@ -21,35 +21,62 @@ module Vedeu
|
|
21
21
|
let(:_name) { 'my_first_app' }
|
22
22
|
|
23
23
|
describe '#app_name' do
|
24
|
+
before { File.stubs(:read).returns('MyFirstApp') }
|
25
|
+
|
24
26
|
subject { instance.app_name }
|
25
27
|
|
26
|
-
|
28
|
+
it { subject.must_equal('MyFirstApp') }
|
27
29
|
end
|
28
30
|
|
29
31
|
describe '#make_directory' do
|
30
32
|
let(:destination) {}
|
31
33
|
|
34
|
+
before { Vedeu.stubs(:log_stdout) }
|
35
|
+
|
32
36
|
subject { instance.make_directory(destination) }
|
37
|
+
|
38
|
+
it {
|
39
|
+
FileUtils.expects(:mkdir_p).with(destination)
|
40
|
+
subject
|
41
|
+
}
|
33
42
|
end
|
34
43
|
|
35
44
|
describe '#copy_file' do
|
36
45
|
let(:source) {}
|
37
46
|
let(:destination) {}
|
38
47
|
|
48
|
+
before { Vedeu.stubs(:log_stdout) }
|
49
|
+
|
39
50
|
subject { instance.copy_file(source, destination) }
|
51
|
+
|
52
|
+
it {
|
53
|
+
FileUtils.expects(:cp).with(source, destination)
|
54
|
+
subject
|
55
|
+
}
|
40
56
|
end
|
41
57
|
|
42
58
|
describe '#make_file' do
|
43
59
|
let(:source) {}
|
44
60
|
let(:destination) {}
|
45
61
|
|
62
|
+
before { Vedeu.stubs(:log_stdout) }
|
63
|
+
|
46
64
|
subject { instance.make_file(source, destination) }
|
65
|
+
|
66
|
+
# it { skip }
|
47
67
|
end
|
48
68
|
|
49
69
|
describe '#touch_file' do
|
50
70
|
let(:destination) {}
|
51
71
|
|
72
|
+
before { Vedeu.stubs(:log_stdout) }
|
73
|
+
|
52
74
|
subject { instance.touch_file(destination) }
|
75
|
+
|
76
|
+
it {
|
77
|
+
FileUtils.expects(:touch).with(destination)
|
78
|
+
subject
|
79
|
+
}
|
53
80
|
end
|
54
81
|
|
55
82
|
describe '#name' do
|
@@ -104,6 +131,11 @@ module Vedeu
|
|
104
131
|
let(:source) {}
|
105
132
|
|
106
133
|
subject { instance.parse(source) }
|
134
|
+
|
135
|
+
it {
|
136
|
+
Vedeu::Template.expects(:parse).with(instance, source)
|
137
|
+
subject
|
138
|
+
}
|
107
139
|
end
|
108
140
|
|
109
141
|
describe '#source' do
|
@@ -84,6 +84,16 @@ module Vedeu
|
|
84
84
|
end
|
85
85
|
|
86
86
|
context 'when the DRb server is available' do
|
87
|
+
# before do
|
88
|
+
# DRbObject.stubs(:new_with_uri).returns(server)
|
89
|
+
# Process.stubs(:kill)
|
90
|
+
# end
|
91
|
+
|
92
|
+
# it {
|
93
|
+
# Process.expects(:kill).with('KILL', 0)
|
94
|
+
# subject
|
95
|
+
# }
|
96
|
+
|
87
97
|
# it { skip }
|
88
98
|
end
|
89
99
|
end
|
@@ -8,18 +8,22 @@ module Vedeu
|
|
8
8
|
let(:_value) { 'Testing the Text class with various options' }
|
9
9
|
let(:options) {
|
10
10
|
{
|
11
|
-
anchor:
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
11
|
+
anchor: anchor,
|
12
|
+
background: background,
|
13
|
+
colour: colour,
|
14
|
+
foreground: foreground,
|
15
|
+
model: model,
|
16
|
+
pad: pad,
|
17
|
+
width: width,
|
16
18
|
}
|
17
19
|
}
|
18
|
-
let(:anchor)
|
19
|
-
let(:
|
20
|
-
let(:
|
21
|
-
let(:
|
22
|
-
let(:
|
20
|
+
let(:anchor) { :left }
|
21
|
+
let(:background) { nil }
|
22
|
+
let(:colour) { nil }
|
23
|
+
let(:foreground) { nil }
|
24
|
+
let(:model) { nil }
|
25
|
+
let(:pad) { ' ' }
|
26
|
+
let(:width) { nil }
|
23
27
|
|
24
28
|
describe '.with' do
|
25
29
|
subject { described.with(_value, options) }
|
@@ -127,14 +131,16 @@ module Vedeu
|
|
127
131
|
end
|
128
132
|
|
129
133
|
context 'when the colour option is given' do
|
130
|
-
let(:colour) {}
|
134
|
+
let(:colour) { { background: '#33ff33', foreground: '#ffaa00' } }
|
135
|
+
|
136
|
+
# it { skip }
|
131
137
|
end
|
132
138
|
|
133
139
|
context 'when the background and/or foreground options are given' do
|
134
140
|
let(:background) { '#111111' }
|
135
141
|
let(:foreground) { '#aadd00' }
|
136
142
|
|
137
|
-
|
143
|
+
# it { skip }
|
138
144
|
end
|
139
145
|
|
140
146
|
end
|
@@ -97,8 +97,17 @@ module Vedeu
|
|
97
97
|
describe '#current' do
|
98
98
|
subject { instance.current }
|
99
99
|
|
100
|
-
|
101
|
-
|
100
|
+
context 'when there is nothing in focus' do
|
101
|
+
before { Vedeu.stubs(:focus) }
|
102
|
+
|
103
|
+
it { subject.must_be_instance_of(NilClass) }
|
104
|
+
end
|
105
|
+
|
106
|
+
context 'when there something in focus' do
|
107
|
+
before { Vedeu.stubs(:focus).returns('zinc') }
|
108
|
+
|
109
|
+
it { subject.must_be_instance_of(Vedeu::TestModel) }
|
110
|
+
end
|
102
111
|
end
|
103
112
|
|
104
113
|
describe '#find' do
|
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
require 'simplecov'
|
2
|
-
require 'simplecov-console'
|
2
|
+
require 'simplecov-console' if ENV['CONSOLE_COVERAGE']
|
3
3
|
require 'pry'
|
4
4
|
require 'minitest/autorun'
|
5
5
|
require 'minitest/pride' unless ENV['NO_COLOR']
|
@@ -8,10 +8,13 @@ require 'minitest/hell'
|
|
8
8
|
# GC.disable # uncomment to remove ~20ms from test run speed
|
9
9
|
|
10
10
|
SimpleCov.start do
|
11
|
-
formatter SimpleCov::Formatter::Console
|
11
|
+
formatter SimpleCov::Formatter::Console if ENV['CONSOLE_COVERAGE']
|
12
12
|
command_name 'MiniTest::Spec'
|
13
13
|
add_filter '/test/'
|
14
|
+
add_group 'application', 'vedeu/application'
|
15
|
+
add_group 'bindings', 'vedeu/bindings'
|
14
16
|
add_group 'buffers', 'vedeu/buffers'
|
17
|
+
add_group 'cli', 'vedeu/cli'
|
15
18
|
add_group 'configuration', 'vedeu/configuration'
|
16
19
|
add_group 'cursor', 'vedeu/cursor'
|
17
20
|
add_group 'distributed', 'vedeu/distributed'
|
@@ -20,10 +23,12 @@ SimpleCov.start do
|
|
20
23
|
add_group 'geometry', 'vedeu/geometry'
|
21
24
|
add_group 'input', 'vedeu/input'
|
22
25
|
add_group 'models', 'vedeu/models'
|
26
|
+
add_group 'null', 'vedeu/null'
|
23
27
|
add_group 'output', 'vedeu/output'
|
24
28
|
add_group 'repositories', 'vedeu/repositories'
|
25
29
|
add_group 'storage', 'vedeu/storage'
|
26
30
|
add_group 'support', 'vedeu/support'
|
31
|
+
add_group 'templating', 'vedeu/templating'
|
27
32
|
end unless ENV['no_simplecov']
|
28
33
|
|
29
34
|
module VedeuMiniTestPlugin
|
data/vedeu.gemspec
CHANGED
@@ -20,12 +20,11 @@ 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.8'
|
24
24
|
spec.add_development_dependency 'guard-bundler', '2.1.0'
|
25
25
|
spec.add_development_dependency 'guard-minitest', '2.4.4'
|
26
|
-
spec.add_development_dependency 'inch', '0.6.3'
|
27
26
|
spec.add_development_dependency 'minitest', '5.7.0'
|
28
|
-
spec.add_development_dependency 'minitest-reporters', '1.0.
|
27
|
+
spec.add_development_dependency 'minitest-reporters', '1.0.18'
|
29
28
|
spec.add_development_dependency 'mocha', '1.1.0'
|
30
29
|
spec.add_development_dependency 'pry', '0.10.1'
|
31
30
|
spec.add_development_dependency 'pry-byebug', '3.1.0'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
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.45
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gavin Laking
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.12.
|
19
|
+
version: 2.12.8
|
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.8
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: guard-bundler
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -52,20 +52,6 @@ dependencies:
|
|
52
52
|
- - '='
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: 2.4.4
|
55
|
-
- !ruby/object:Gem::Dependency
|
56
|
-
name: inch
|
57
|
-
requirement: !ruby/object:Gem::Requirement
|
58
|
-
requirements:
|
59
|
-
- - '='
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: 0.6.3
|
62
|
-
type: :development
|
63
|
-
prerelease: false
|
64
|
-
version_requirements: !ruby/object:Gem::Requirement
|
65
|
-
requirements:
|
66
|
-
- - '='
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
version: 0.6.3
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: minitest
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -86,14 +72,14 @@ dependencies:
|
|
86
72
|
requirements:
|
87
73
|
- - '='
|
88
74
|
- !ruby/object:Gem::Version
|
89
|
-
version: 1.0.
|
75
|
+
version: 1.0.18
|
90
76
|
type: :development
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - '='
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: 1.0.
|
82
|
+
version: 1.0.18
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: mocha
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -300,7 +286,6 @@ files:
|
|
300
286
|
- examples/view_templates_app/prune.erb
|
301
287
|
- examples/view_templates_app/view_templates_app.rb
|
302
288
|
- examples/view_templates_app/wrap.erb
|
303
|
-
- inch.yml
|
304
289
|
- lib/vedeu.rb
|
305
290
|
- lib/vedeu/all.rb
|
306
291
|
- lib/vedeu/api.rb
|
@@ -492,7 +477,6 @@ files:
|
|
492
477
|
- lib/vedeu/templating/preprocessor.rb
|
493
478
|
- lib/vedeu/traps.rb
|
494
479
|
- lib/vedeu/version.rb
|
495
|
-
- logs/.gitkeep
|
496
480
|
- test/lib/vedeu/api_test.rb
|
497
481
|
- test/lib/vedeu/application/application_controller_test.rb
|
498
482
|
- test/lib/vedeu/application/application_helper_test.rb
|