vedeu 0.5.7 → 0.5.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -0
- data/lib/vedeu/bindings/movement.rb +20 -74
- data/lib/vedeu/borders/borders.rb +1 -5
- data/lib/vedeu/buffers/buffers.rb +1 -5
- data/lib/vedeu/cursor/cursors.rb +2 -2
- data/lib/vedeu/dsl/interface.rb +1 -1
- data/lib/vedeu/events/events.rb +2 -2
- data/lib/vedeu/geometry/coordinate.rb +6 -18
- data/lib/vedeu/geometry/geometries.rb +1 -5
- data/lib/vedeu/input/keymaps.rb +1 -5
- data/lib/vedeu/log/log.rb +0 -1
- data/lib/vedeu/models/group.rb +14 -0
- data/lib/vedeu/models/groups.rb +1 -5
- data/lib/vedeu/models/interfaces.rb +1 -5
- data/lib/vedeu/models/menus.rb +1 -5
- data/lib/vedeu/models/views/char.rb +0 -4
- data/lib/vedeu/output/refresh_group.rb +8 -23
- data/lib/vedeu/plugins.rb +1 -1
- data/lib/vedeu/plugins/plugin.rb +1 -1
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/colours/colour_test.rb +5 -0
- data/test/lib/vedeu/colours/colour_translator_test.rb +5 -4
- data/test/lib/vedeu/colours/colours_test.rb +4 -0
- data/test/lib/vedeu/distributed/test_application_test.rb +19 -0
- data/test/lib/vedeu/dsl/interface_test.rb +10 -18
- data/test/lib/vedeu/input/keymap_test.rb +4 -0
- data/test/lib/vedeu/log/debug_test.rb +21 -2
- data/test/lib/vedeu/models/escape_test.rb +4 -0
- data/test/lib/vedeu/models/group_test.rb +9 -0
- data/test/lib/vedeu/models/views/view_test.rb +13 -0
- data/test/lib/vedeu/null/border_test.rb +4 -0
- data/test/lib/vedeu/null/buffer_test.rb +4 -0
- data/test/lib/vedeu/null/geometry_test.rb +1 -7
- data/test/lib/vedeu/plugins/plugin_test.rb +10 -1
- data/test/lib/vedeu/repositories/repository_test.rb +5 -0
- data/test/lib/vedeu/runtime/launcher_test.rb +4 -0
- data/test/test_helper.rb +33 -28
- metadata +2 -3
- data/examples/colours_app.rb +0 -48
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c62441c6579d781c59c825d69511b5d3705f6014
|
4
|
+
data.tar.gz: b944ba4c7e976e70968d18b2bf758887b83b3516
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: abb5508cfafc005658e04093bf5b0c4ba39e44cbdcc5830658d05b6b58804e259b95d57d236981a851b95db6bf3771852788e0690ab9740b29cae3254db12feb
|
7
|
+
data.tar.gz: 86f47fa933d1ac72ab151aa968b8a7c2ef830e007fda1d4d5631e66a128ed054a11cf989cf852674968f0b79436f76a7f2f38f83a9891f1913a7969e4f51e7c6
|
data/Rakefile
CHANGED
@@ -16,54 +16,42 @@ module Vedeu
|
|
16
16
|
cursor_origin!
|
17
17
|
cursor_position!
|
18
18
|
cursor_reposition!
|
19
|
-
|
20
|
-
left!
|
21
|
-
right!
|
22
|
-
up!
|
19
|
+
directional!
|
23
20
|
end
|
24
21
|
|
25
22
|
private
|
26
23
|
|
27
|
-
# Move the cursor/view down by one character.
|
24
|
+
# Move the cursor/view down, left, right or up by one character.
|
28
25
|
#
|
29
26
|
# @example
|
30
27
|
# Vedeu.trigger(:_cursor_down_, name)
|
31
28
|
# Vedeu.trigger(:_view_down_, name)
|
32
29
|
# Vedeu.trigger(:_geometry_down_, name)
|
33
|
-
#
|
34
|
-
# @return [TrueClass]
|
35
|
-
# @see Vedeu::Move
|
36
|
-
def down!
|
37
|
-
Vedeu.bind(:_cursor_down_) do |name|
|
38
|
-
Vedeu::Move.down(Vedeu::Cursor, name)
|
39
|
-
end
|
40
|
-
|
41
|
-
Vedeu.bind(:_view_down_) do |name|
|
42
|
-
Vedeu::Move.down(Vedeu::Geometry, name)
|
43
|
-
end
|
44
|
-
|
45
|
-
Vedeu.bind_alias(:_geometry_down_, :_view_down_)
|
46
|
-
end
|
47
|
-
|
48
|
-
# Move the cursor/view left by one character.
|
49
|
-
#
|
50
|
-
# @example
|
51
30
|
# Vedeu.trigger(:_cursor_left_, name)
|
52
31
|
# Vedeu.trigger(:_view_left_, name)
|
53
32
|
# Vedeu.trigger(:_geometry_left_, name)
|
33
|
+
# Vedeu.trigger(:_cursor_right_, name)
|
34
|
+
# Vedeu.trigger(:_view_right_, name)
|
35
|
+
# Vedeu.trigger(:_geometry_right_, name)
|
36
|
+
# Vedeu.trigger(:_cursor_up_, name)
|
37
|
+
# Vedeu.trigger(:_view_up_, name)
|
38
|
+
# Vedeu.trigger(:_geometry_up_, name)
|
54
39
|
#
|
55
40
|
# @return [TrueClass]
|
56
41
|
# @see Vedeu::Move
|
57
|
-
def
|
58
|
-
|
59
|
-
Vedeu
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
Vedeu
|
42
|
+
def directional!
|
43
|
+
[:down, :left, :right, :up].each do |direction|
|
44
|
+
Vedeu.bind("_cursor_#{direction}_".to_sym) do |name|
|
45
|
+
Vedeu::Move.send(direction, Vedeu::Cursor, name)
|
46
|
+
end
|
47
|
+
|
48
|
+
Vedeu.bind("_view_#{direction}_".to_sym) do |name|
|
49
|
+
Vedeu::Move.send(direction, Vedeu::Geometry, name)
|
50
|
+
end
|
51
|
+
|
52
|
+
Vedeu.bind_alias("_geometry_#{direction}_".to_sym,
|
53
|
+
"_view_#{direction}_".to_sym)
|
64
54
|
end
|
65
|
-
|
66
|
-
Vedeu.bind_alias(:_geometry_left_, :_view_left_)
|
67
55
|
end
|
68
56
|
|
69
57
|
# This event moves the cursor to the interface origin; the top left corner
|
@@ -111,48 +99,6 @@ module Vedeu
|
|
111
99
|
end
|
112
100
|
end
|
113
101
|
|
114
|
-
# Move the cursor/view right by one character.
|
115
|
-
#
|
116
|
-
# @example
|
117
|
-
# Vedeu.trigger(:_cursor_right_, name)
|
118
|
-
# Vedeu.trigger(:_view_right_, name)
|
119
|
-
# Vedeu.trigger(:_geometry_right_, name)
|
120
|
-
#
|
121
|
-
# @return [TrueClass]
|
122
|
-
# @see Vedeu::Move
|
123
|
-
def right!
|
124
|
-
Vedeu.bind(:_cursor_right_) do |name|
|
125
|
-
Vedeu::Move.right(Vedeu::Cursor, name)
|
126
|
-
end
|
127
|
-
|
128
|
-
Vedeu.bind(:_view_right_) do |name|
|
129
|
-
Vedeu::Move.right(Vedeu::Geometry, name)
|
130
|
-
end
|
131
|
-
|
132
|
-
Vedeu.bind_alias(:_geometry_right_, :_view_right_)
|
133
|
-
end
|
134
|
-
|
135
|
-
# Move the cursor/view up by one character.
|
136
|
-
#
|
137
|
-
# @example
|
138
|
-
# Vedeu.trigger(:_cursor_up, name)
|
139
|
-
# Vedeu.trigger(:_view_up_, name)
|
140
|
-
# Vedeu.trigger(:_geometry_up_, name)
|
141
|
-
#
|
142
|
-
# @return [TrueClass]
|
143
|
-
# @see Vedeu::Move
|
144
|
-
def up!
|
145
|
-
Vedeu.bind(:_cursor_up_) do |name|
|
146
|
-
Vedeu::Move.up(Vedeu::Cursor, name)
|
147
|
-
end
|
148
|
-
|
149
|
-
Vedeu.bind(:_view_up_) do |name|
|
150
|
-
Vedeu::Move.up(Vedeu::Geometry, name)
|
151
|
-
end
|
152
|
-
|
153
|
-
Vedeu.bind_alias(:_geometry_up_, :_view_up_)
|
154
|
-
end
|
155
|
-
|
156
102
|
end # Movement
|
157
103
|
# :nocov:
|
158
104
|
|
data/lib/vedeu/cursor/cursors.rb
CHANGED
data/lib/vedeu/dsl/interface.rb
CHANGED
@@ -162,7 +162,7 @@ module Vedeu
|
|
162
162
|
# When the above is specified (outside of a `Vedeu.interface`
|
163
163
|
# declaration), the named interface will be focussed instead.
|
164
164
|
#
|
165
|
-
# @return [String]
|
165
|
+
# @return [Array<String>] A list of focusable interfaces.
|
166
166
|
def focus!
|
167
167
|
Vedeu::Focus.add(model.name, true) if present?(model.name)
|
168
168
|
end
|
data/lib/vedeu/events/events.rb
CHANGED
@@ -82,7 +82,9 @@ module Vedeu
|
|
82
82
|
y_range[oy]
|
83
83
|
end
|
84
84
|
|
85
|
-
|
85
|
+
pos = pos < by ? by : pos
|
86
|
+
pos = pos > byn ? byn : pos
|
87
|
+
pos
|
86
88
|
end
|
87
89
|
|
88
90
|
# Returns the x coordinate for a given index.
|
@@ -103,7 +105,9 @@ module Vedeu
|
|
103
105
|
x_range[ox]
|
104
106
|
end
|
105
107
|
|
106
|
-
|
108
|
+
pos = pos < bx ? bx : pos
|
109
|
+
pos = pos > bxn ? bxn : pos
|
110
|
+
pos
|
107
111
|
end
|
108
112
|
|
109
113
|
protected
|
@@ -127,22 +131,6 @@ module Vedeu
|
|
127
131
|
@border ||= Vedeu.borders.by_name(name)
|
128
132
|
end
|
129
133
|
|
130
|
-
# @param value [Fixnum]
|
131
|
-
# @return [Fixnum]
|
132
|
-
def validate_x(value)
|
133
|
-
value = value < bx ? bx : value
|
134
|
-
value = value > bxn ? bxn : value
|
135
|
-
value
|
136
|
-
end
|
137
|
-
|
138
|
-
# @param value [Fixnum]
|
139
|
-
# @return [Fixnum]
|
140
|
-
def validate_y(value)
|
141
|
-
value = value < by ? by : value
|
142
|
-
value = value > byn ? byn : value
|
143
|
-
value
|
144
|
-
end
|
145
|
-
|
146
134
|
# Returns the maximum y index for an area.
|
147
135
|
#
|
148
136
|
# @example
|
@@ -5,11 +5,7 @@ module Vedeu
|
|
5
5
|
#
|
6
6
|
class Geometries < Vedeu::Repository
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
alias_method :geometries, :repository
|
11
|
-
|
12
|
-
end # Eigenclass
|
8
|
+
singleton_class.send(:alias_method, :geometries, :repository)
|
13
9
|
|
14
10
|
null Vedeu::Null::Geometry
|
15
11
|
real Vedeu::Geometry
|
data/lib/vedeu/input/keymaps.rb
CHANGED
data/lib/vedeu/log/log.rb
CHANGED
data/lib/vedeu/models/group.rb
CHANGED
@@ -54,6 +54,13 @@ module Vedeu
|
|
54
54
|
}
|
55
55
|
end
|
56
56
|
|
57
|
+
# Return the members of the group sorted by the zindex of the members.
|
58
|
+
#
|
59
|
+
# @return [Array<String>]
|
60
|
+
def by_zindex
|
61
|
+
interfaces.sort { |a, b| a.zindex <=> b.zindex }.map(&:name)
|
62
|
+
end
|
63
|
+
|
57
64
|
# Hide the named group of interfaces, or without a name, the group of the
|
58
65
|
# currently focussed interface. Useful for hiding part of that which is
|
59
66
|
# currently displaying in the terminal.
|
@@ -131,6 +138,13 @@ module Vedeu
|
|
131
138
|
}
|
132
139
|
end
|
133
140
|
|
141
|
+
# Return the interfaces for all members of the group.
|
142
|
+
#
|
143
|
+
# @return [Array<Vedeu::Interface]
|
144
|
+
def interfaces
|
145
|
+
members.map { |name| Vedeu.interfaces.by_name(name) }
|
146
|
+
end
|
147
|
+
|
134
148
|
end # Group
|
135
149
|
|
136
150
|
end # Vedeu
|
data/lib/vedeu/models/groups.rb
CHANGED
@@ -4,11 +4,7 @@ module Vedeu
|
|
4
4
|
#
|
5
5
|
class Interfaces < Vedeu::Repository
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
alias_method :interfaces, :repository
|
10
|
-
|
11
|
-
end # Eigenclass
|
7
|
+
singleton_class.send(:alias_method, :interfaces, :repository)
|
12
8
|
|
13
9
|
null Vedeu::Null::Interface
|
14
10
|
real Vedeu::Interface
|
data/lib/vedeu/models/menus.rb
CHANGED
@@ -20,7 +20,14 @@ module Vedeu
|
|
20
20
|
|
21
21
|
# @return [void]
|
22
22
|
def by_name
|
23
|
-
|
23
|
+
unless present?(name)
|
24
|
+
fail Vedeu::MissingRequired,
|
25
|
+
'Cannot refresh group with an empty group name.'
|
26
|
+
end
|
27
|
+
|
28
|
+
Vedeu.groups.by_name(name).by_zindex.each do |name|
|
29
|
+
Vedeu::Refresh.by_name(name)
|
30
|
+
end
|
24
31
|
end
|
25
32
|
|
26
33
|
protected
|
@@ -29,28 +36,6 @@ module Vedeu
|
|
29
36
|
# @return [String]
|
30
37
|
attr_reader :name
|
31
38
|
|
32
|
-
private
|
33
|
-
|
34
|
-
# @return [Array<String>]
|
35
|
-
def zindexed
|
36
|
-
interfaces.sort_by(&:zindex).map(&:name)
|
37
|
-
end
|
38
|
-
|
39
|
-
# @return [Array<Vedeu::Interface>]
|
40
|
-
def interfaces
|
41
|
-
members.map { |name| Vedeu.interfaces.by_name(name) }
|
42
|
-
end
|
43
|
-
|
44
|
-
# @return [Set]
|
45
|
-
def members
|
46
|
-
unless present?(name)
|
47
|
-
fail Vedeu::MissingRequired,
|
48
|
-
'Cannot refresh group with an empty group name.'
|
49
|
-
end
|
50
|
-
|
51
|
-
Vedeu.groups.by_name(name).members
|
52
|
-
end
|
53
|
-
|
54
39
|
end # RefreshGroup
|
55
40
|
|
56
41
|
end # Vedeu
|
data/lib/vedeu/plugins.rb
CHANGED
data/lib/vedeu/plugins/plugin.rb
CHANGED
data/lib/vedeu/version.rb
CHANGED
@@ -8,15 +8,16 @@ module Vedeu
|
|
8
8
|
let(:instance) { described.new(colour) }
|
9
9
|
let(:colour) { '#ff0000' }
|
10
10
|
|
11
|
-
describe 'alias methods' do
|
12
|
-
it { instance.must_respond_to(:value) }
|
13
|
-
end
|
14
|
-
|
15
11
|
describe '#initialize' do
|
16
12
|
it { instance.must_be_instance_of(described) }
|
17
13
|
it { instance.instance_variable_get('@colour').must_equal(colour) }
|
18
14
|
end
|
19
15
|
|
16
|
+
describe 'accessors' do
|
17
|
+
it { instance.must_respond_to(:colour) }
|
18
|
+
it { instance.must_respond_to(:value) }
|
19
|
+
end
|
20
|
+
|
20
21
|
describe '.coerce' do
|
21
22
|
let(:_value) {}
|
22
23
|
|
@@ -12,6 +12,10 @@ module Vedeu
|
|
12
12
|
it { instance.instance_variable_get('@storage').must_equal({}) }
|
13
13
|
end
|
14
14
|
|
15
|
+
describe 'accessors' do
|
16
|
+
it { instance.must_respond_to(:storage) }
|
17
|
+
end
|
18
|
+
|
15
19
|
describe '#register' do
|
16
20
|
let(:colour) { 'ff0000' }
|
17
21
|
let(:escape_sequence) { 'fake_escape_sequence' }
|
@@ -12,6 +12,25 @@ module Vedeu
|
|
12
12
|
it { instance.must_be_instance_of(described) }
|
13
13
|
end
|
14
14
|
|
15
|
+
describe 'accessors' do
|
16
|
+
it { instance.must_respond_to(:borders) }
|
17
|
+
it { instance.must_respond_to(:borders=) }
|
18
|
+
it { instance.must_respond_to(:configuration) }
|
19
|
+
it { instance.must_respond_to(:configuration=) }
|
20
|
+
it { instance.must_respond_to(:events) }
|
21
|
+
it { instance.must_respond_to(:events=) }
|
22
|
+
it { instance.must_respond_to(:geometries) }
|
23
|
+
it { instance.must_respond_to(:geometries=) }
|
24
|
+
it { instance.must_respond_to(:interfaces) }
|
25
|
+
it { instance.must_respond_to(:interfaces=) }
|
26
|
+
it { instance.must_respond_to(:keymaps) }
|
27
|
+
it { instance.must_respond_to(:keymaps=) }
|
28
|
+
it { instance.must_respond_to(:menus) }
|
29
|
+
it { instance.must_respond_to(:menus=) }
|
30
|
+
it { instance.must_respond_to(:views) }
|
31
|
+
it { instance.must_respond_to(:views=) }
|
32
|
+
end
|
33
|
+
|
15
34
|
describe '.build' do
|
16
35
|
subject { described.build(attributes) { } }
|
17
36
|
|
@@ -9,8 +9,9 @@ module Vedeu
|
|
9
9
|
let(:described) { Vedeu::DSL::Interface }
|
10
10
|
let(:instance) { described.new(model, client) }
|
11
11
|
let(:model) {
|
12
|
-
Vedeu::Interface.new(name:
|
12
|
+
Vedeu::Interface.new(name: _name)
|
13
13
|
}
|
14
|
+
let(:_name) { 'actinium' }
|
14
15
|
let(:client) {}
|
15
16
|
|
16
17
|
describe '#initialize' do
|
@@ -159,27 +160,18 @@ module Vedeu
|
|
159
160
|
end
|
160
161
|
|
161
162
|
describe '#focus!' do
|
162
|
-
|
163
|
-
before do
|
164
|
-
Vedeu::Focus.reset
|
165
|
-
Vedeu.interface('curium') { focus! }
|
166
|
-
end
|
163
|
+
subject { instance.focus! }
|
167
164
|
|
168
|
-
|
169
|
-
|
170
|
-
|
165
|
+
context 'when the interface does not yet have a name' do
|
166
|
+
let(:_name) {}
|
167
|
+
|
168
|
+
it { subject.must_equal(nil) }
|
171
169
|
end
|
172
170
|
|
173
|
-
context 'when
|
174
|
-
before
|
175
|
-
Vedeu::Focus.reset
|
176
|
-
Vedeu.interface('curium') {}
|
177
|
-
Vedeu.interface('dysprosium') {}
|
178
|
-
end
|
171
|
+
context 'when the interface has a name' do
|
172
|
+
before { Vedeu::Focus.reset }
|
179
173
|
|
180
|
-
it
|
181
|
-
Vedeu.focus.must_equal('curium')
|
182
|
-
end
|
174
|
+
it { subject.must_equal(['actinium']) }
|
183
175
|
end
|
184
176
|
end
|
185
177
|
|
@@ -6,9 +6,28 @@ module Vedeu
|
|
6
6
|
|
7
7
|
let(:described) { Vedeu::Debug }
|
8
8
|
|
9
|
+
before do
|
10
|
+
File.stubs(:open).with('/tmp/profile.html', 'w').returns(:some_code)
|
11
|
+
end
|
12
|
+
|
9
13
|
describe '.debug' do
|
10
|
-
|
11
|
-
|
14
|
+
let(:filename) { 'profile.html' }
|
15
|
+
let(:some_code) { :some_code }
|
16
|
+
|
17
|
+
context 'when the block is not given' do
|
18
|
+
subject { described.debug(filename) }
|
19
|
+
|
20
|
+
it { subject.must_equal(nil) }
|
21
|
+
end
|
22
|
+
|
23
|
+
context 'when the block is given' do
|
24
|
+
subject { described.debug(filename) { some_code } }
|
25
|
+
|
26
|
+
it {
|
27
|
+
::File.expects(:open).with('/tmp/profile.html', 'w')
|
28
|
+
subject
|
29
|
+
}
|
30
|
+
end
|
12
31
|
end
|
13
32
|
|
14
33
|
end # Debug
|
@@ -58,6 +58,15 @@ module Vedeu
|
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
61
|
+
describe '#by_zindex' do
|
62
|
+
subject { instance.by_zindex }
|
63
|
+
|
64
|
+
it { subject.must_be_instance_of(Array) }
|
65
|
+
|
66
|
+
# @todo Add more tests.
|
67
|
+
# it { skip }
|
68
|
+
end
|
69
|
+
|
61
70
|
describe '#hide' do
|
62
71
|
subject { instance.hide }
|
63
72
|
|
@@ -15,6 +15,19 @@ module Vedeu
|
|
15
15
|
}
|
16
16
|
let(:_name) { 'Vedeu::Views::View' }
|
17
17
|
|
18
|
+
describe 'accessors' do
|
19
|
+
it { instance.must_respond_to(:attributes) }
|
20
|
+
it { instance.must_respond_to(:client) }
|
21
|
+
it { instance.must_respond_to(:client=) }
|
22
|
+
it { instance.must_respond_to(:name) }
|
23
|
+
it { instance.must_respond_to(:name=) }
|
24
|
+
it { instance.must_respond_to(:parent) }
|
25
|
+
it { instance.must_respond_to(:parent=) }
|
26
|
+
it { instance.must_respond_to(:lines=) }
|
27
|
+
it { instance.must_respond_to(:zindex) }
|
28
|
+
it { instance.must_respond_to(:zindex=) }
|
29
|
+
end
|
30
|
+
|
18
31
|
describe '#store_immediate' do
|
19
32
|
subject { instance.store_immediate }
|
20
33
|
|
@@ -25,15 +25,9 @@ module Vedeu
|
|
25
25
|
it { instance.instance_variable_get('@name').must_equal(_name) }
|
26
26
|
end
|
27
27
|
|
28
|
-
describe '
|
28
|
+
describe 'accessors' do
|
29
29
|
it { instance.must_respond_to(:maximised) }
|
30
|
-
end
|
31
|
-
|
32
|
-
describe '#maximised=' do
|
33
30
|
it { instance.must_respond_to(:maximised=) }
|
34
|
-
end
|
35
|
-
|
36
|
-
describe '#name' do
|
37
31
|
it { instance.must_respond_to(:name) }
|
38
32
|
end
|
39
33
|
|
@@ -15,11 +15,20 @@ module Vedeu
|
|
15
15
|
it { instance.instance_variable_get('@gem').must_equal(_gem) }
|
16
16
|
it {
|
17
17
|
instance.instance_variable_get('@gem_name').
|
18
|
-
must_equal("
|
18
|
+
must_equal("vedeu_#{_name}")
|
19
19
|
}
|
20
20
|
it { instance.instance_variable_get('@enabled').must_equal(false) }
|
21
21
|
end
|
22
22
|
|
23
|
+
describe 'accessors' do
|
24
|
+
it { instance.must_respond_to(:name) }
|
25
|
+
it { instance.must_respond_to(:gem) }
|
26
|
+
it { instance.must_respond_to(:gem_name) }
|
27
|
+
it { instance.must_respond_to(:enabled) }
|
28
|
+
it { instance.must_respond_to(:enabled=) }
|
29
|
+
it { instance.must_respond_to(:enabled?) }
|
30
|
+
end
|
31
|
+
|
23
32
|
describe '#load!' do
|
24
33
|
subject { instance.load! }
|
25
34
|
|
@@ -52,6 +52,11 @@ module Vedeu
|
|
52
52
|
it { instance.instance_variable_get('@storage').must_equal(storage) }
|
53
53
|
end
|
54
54
|
|
55
|
+
describe 'accessors' do
|
56
|
+
it { instance.must_respond_to(:model) }
|
57
|
+
it { instance.must_respond_to(:storage) }
|
58
|
+
end
|
59
|
+
|
55
60
|
describe '#all' do
|
56
61
|
subject { instance.all }
|
57
62
|
|
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,8 @@
|
|
1
|
-
|
2
|
-
require 'simplecov
|
1
|
+
unless ENV['NO_SIMPLECOV']
|
2
|
+
require 'simplecov'
|
3
|
+
require 'simplecov-console' if ENV['CONSOLE_COVERAGE']
|
4
|
+
end
|
5
|
+
|
3
6
|
require 'pry'
|
4
7
|
require 'minitest/autorun'
|
5
8
|
require 'minitest/pride' unless ENV['NO_COLOR']
|
@@ -8,32 +11,34 @@ require 'minitest/hell'
|
|
8
11
|
# GC.disable # Uncomment to remove ~20ms from test run speed; left uncommented
|
9
12
|
# though makes tests slower over time with 'guard'.
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
14
|
+
unless ENV['NO_SIMPLECOV']
|
15
|
+
SimpleCov.start do
|
16
|
+
formatter SimpleCov::Formatter::Console if ENV['CONSOLE_COVERAGE']
|
17
|
+
command_name 'MiniTest::Spec'
|
18
|
+
add_filter '/test/'
|
19
|
+
add_group 'application', 'vedeu/application'
|
20
|
+
add_group 'bindings', 'vedeu/bindings'
|
21
|
+
add_group 'borders', 'vedeu/borders'
|
22
|
+
add_group 'buffers', 'vedeu/buffers'
|
23
|
+
add_group 'cli', 'vedeu/cli'
|
24
|
+
add_group 'colours', 'vedeu/colours'
|
25
|
+
add_group 'configuration', 'vedeu/configuration'
|
26
|
+
add_group 'cursor', 'vedeu/cursor'
|
27
|
+
add_group 'distributed', 'vedeu/distributed'
|
28
|
+
add_group 'dsl', 'vedeu/dsl'
|
29
|
+
add_group 'events', 'vedeu/events'
|
30
|
+
add_group 'geometry', 'vedeu/geometry'
|
31
|
+
add_group 'input', 'vedeu/input'
|
32
|
+
add_group 'log', 'vedeu/log'
|
33
|
+
add_group 'models', 'vedeu/models'
|
34
|
+
add_group 'null', 'vedeu/null'
|
35
|
+
add_group 'output', 'vedeu/output'
|
36
|
+
add_group 'plugins', 'vedeu/plygins'
|
37
|
+
add_group 'repositories', 'vedeu/repositories'
|
38
|
+
add_group 'runtime', 'vedeu/runtime'
|
39
|
+
add_group 'templating', 'vedeu/templating'
|
40
|
+
end
|
41
|
+
end
|
37
42
|
|
38
43
|
module VedeuMiniTestPlugin
|
39
44
|
# def before_setup
|
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.5.
|
4
|
+
version: 0.5.8
|
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-08-
|
11
|
+
date: 2015-08-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -241,7 +241,6 @@ files:
|
|
241
241
|
- docs/object_graph.md
|
242
242
|
- examples/borders_app.rb
|
243
243
|
- examples/colour_support.sh
|
244
|
-
- examples/colours_app.rb
|
245
244
|
- examples/configuration_app.rb
|
246
245
|
- examples/drb_app.rb
|
247
246
|
- examples/focus_app.rb
|
data/examples/colours_app.rb
DELETED
@@ -1,48 +0,0 @@
|
|
1
|
-
#!/usr/bin/env ruby
|
2
|
-
|
3
|
-
lib_dir = File.dirname(__FILE__) + '/../lib'
|
4
|
-
$LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
|
5
|
-
|
6
|
-
require 'vedeu'
|
7
|
-
|
8
|
-
# An example application to demonstrate colours.
|
9
|
-
#
|
10
|
-
# If you have cloned this repository from GitHub, you can run this example:
|
11
|
-
#
|
12
|
-
# ./examples/colours_app.rb
|
13
|
-
#
|
14
|
-
class VedeuColoursApp
|
15
|
-
|
16
|
-
Vedeu.bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
|
17
|
-
|
18
|
-
# Be aware that running an application with debugging enabled will affect
|
19
|
-
# performance.
|
20
|
-
Vedeu.configure do
|
21
|
-
# debug!
|
22
|
-
log '/tmp/vedeu_colours_app.log'
|
23
|
-
end
|
24
|
-
|
25
|
-
Vedeu.interface 'colours_256' do
|
26
|
-
geometry do
|
27
|
-
centred!
|
28
|
-
height 16
|
29
|
-
width 80
|
30
|
-
end
|
31
|
-
end
|
32
|
-
|
33
|
-
Vedeu.renders do
|
34
|
-
view('colours_256') do
|
35
|
-
lines do
|
36
|
-
0.upto(16) do |row|
|
37
|
-
line do
|
38
|
-
0.upto(15) do |column|
|
39
|
-
code = (row * 15) + column
|
40
|
-
right "#{code}", width: 5, background: code, foreground: '#ffffff'
|
41
|
-
end
|
42
|
-
end
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
end # VedeuColoursApp
|