vedeu 0.4.45 → 0.4.46
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.yardopts +1 -0
- data/Guardfile +1 -1
- data/docs/dsl.md +4 -4
- data/docs/events/drb.md +49 -0
- data/docs/events/main.md +109 -0
- data/docs/events/menus.md +72 -0
- data/docs/events/movement.md +105 -0
- data/docs/events/visibility.md +61 -0
- data/docs/events.md +13 -0
- data/lib/vedeu/api.rb +23 -0
- data/lib/vedeu/application/controller.rb +1 -0
- data/lib/vedeu/application.rb +25 -20
- data/lib/vedeu/bindings/bindings.rb +2 -41
- data/lib/vedeu/bindings/drb.rb +2 -11
- data/lib/vedeu/bindings/menus.rb +1 -19
- data/lib/vedeu/bindings/movement.rb +6 -18
- data/lib/vedeu/bindings/visibility.rb +5 -26
- data/lib/vedeu/configuration/configuration.rb +1 -1
- data/lib/vedeu/distributed/server.rb +15 -0
- data/lib/vedeu/dsl/presentation.rb +13 -7
- data/lib/vedeu/dsl/view.rb +1 -1
- data/lib/vedeu/events/event.rb +1 -1
- data/lib/vedeu/main_loop.rb +1 -1
- data/lib/vedeu/models/interface.rb +3 -0
- data/lib/vedeu/null/interface.rb +11 -0
- data/lib/vedeu/output/clear.rb +3 -1
- data/lib/vedeu/repositories/repositories/borders.rb +7 -3
- data/lib/vedeu/repositories/repositories/buffers.rb +7 -3
- data/lib/vedeu/repositories/repositories/cursors.rb +3 -2
- data/lib/vedeu/repositories/repositories/events.rb +3 -2
- data/lib/vedeu/repositories/repositories/geometries.rb +6 -2
- data/lib/vedeu/repositories/repositories/groups.rb +2 -1
- data/lib/vedeu/repositories/repositories/interfaces.rb +6 -2
- data/lib/vedeu/repositories/repositories/keymaps.rb +2 -1
- data/lib/vedeu/repositories/repositories/menus.rb +2 -1
- data/lib/vedeu/support/log.rb +1 -1
- data/lib/vedeu/support/timer.rb +1 -1
- data/lib/vedeu/support/visibility.rb +31 -3
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/bindings/bindings_test.rb +0 -3
- data/test/lib/vedeu/bindings/movement_test.rb +1 -0
- data/test/lib/vedeu/buffers/buffer_test.rb +9 -17
- data/test/lib/vedeu/null/interface_test.rb +6 -0
- data/test/lib/vedeu/repositories/repositories/borders_test.rb +5 -1
- data/test/lib/vedeu/repositories/repositories/buffers_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/cursors_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/events_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/geometries_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/groups_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/interfaces_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +2 -0
- data/test/lib/vedeu/repositories/repositories/menus_test.rb +2 -0
- data/test/lib/vedeu/support/visibility_test.rb +14 -8
- data/test/test_helper.rb +12 -6
- metadata +8 -2
@@ -5,26 +5,52 @@ module Vedeu
|
|
5
5
|
# @api private
|
6
6
|
class Visibility
|
7
7
|
|
8
|
+
# Hide a named cursor, or without a name, the cursor of the currently
|
9
|
+
# focussed interface.
|
10
|
+
#
|
11
|
+
# @example
|
12
|
+
# Vedeu.hide_cursor(name)
|
13
|
+
#
|
14
|
+
# @param name [String]
|
15
|
+
# @return [Vedeu::Visibility]
|
16
|
+
def self.hide_cursor(name = nil)
|
17
|
+
model = name ? Vedeu.cursors.by_name(name) : Vedeu.cursor
|
18
|
+
|
19
|
+
new(model).hide
|
20
|
+
end
|
21
|
+
|
22
|
+
# Show a named cursor, or without a name, the cursor of the currently
|
23
|
+
# focussed interface.
|
24
|
+
#
|
25
|
+
# @example
|
26
|
+
# Vedeu.show_cursor(name)
|
27
|
+
#
|
8
28
|
# @param name [String]
|
9
29
|
# @return [Vedeu::Visibility]
|
10
|
-
def self.
|
11
|
-
|
30
|
+
def self.show_cursor(name = nil)
|
31
|
+
model = name ? Vedeu.cursors.by_name(name) : Vedeu.cursor
|
12
32
|
|
13
|
-
new(
|
33
|
+
new(model).show
|
14
34
|
end
|
15
35
|
|
36
|
+
# Show the given model.
|
37
|
+
#
|
16
38
|
# @param model [void]
|
17
39
|
# @return [void]
|
18
40
|
def self.show(model)
|
19
41
|
new(model).show
|
20
42
|
end
|
21
43
|
|
44
|
+
# Hide the given model.
|
45
|
+
#
|
22
46
|
# @param model [void]
|
23
47
|
# @return [void]
|
24
48
|
def self.hide(model)
|
25
49
|
new(model).hide
|
26
50
|
end
|
27
51
|
|
52
|
+
# Toggle the visibility of the given model.
|
53
|
+
#
|
28
54
|
# @param model [void]
|
29
55
|
# @return [void]
|
30
56
|
def self.toggle(model)
|
@@ -47,6 +73,7 @@ module Vedeu
|
|
47
73
|
else
|
48
74
|
model.visible = true
|
49
75
|
model.store
|
76
|
+
|
50
77
|
end
|
51
78
|
end
|
52
79
|
|
@@ -73,6 +100,7 @@ module Vedeu
|
|
73
100
|
end
|
74
101
|
end
|
75
102
|
|
103
|
+
|
76
104
|
# @return [void]
|
77
105
|
def toggle
|
78
106
|
if model.visible?
|
data/lib/vedeu/version.rb
CHANGED
@@ -20,10 +20,7 @@ module Vedeu
|
|
20
20
|
it { Vedeu.events.registered?(:_resize_).must_equal(true) }
|
21
21
|
end
|
22
22
|
|
23
|
-
it { Vedeu.events.registered?(:_cursor_position_).must_equal(true) }
|
24
|
-
|
25
23
|
context 'the geometry specific events are defined' do
|
26
|
-
|
27
24
|
it { Vedeu.events.registered?(:_maximise_).must_equal(true) }
|
28
25
|
it { Vedeu.events.registered?(:_unmaximise_).must_equal(true) }
|
29
26
|
end
|
@@ -10,6 +10,7 @@ module Vedeu
|
|
10
10
|
it { Vedeu.events.registered?(:_cursor_down_).must_equal(true) }
|
11
11
|
it { Vedeu.events.registered?(:_cursor_left_).must_equal(true) }
|
12
12
|
it { Vedeu.events.registered?(:_cursor_origin_).must_equal(true) }
|
13
|
+
it { Vedeu.events.registered?(:_cursor_position_).must_equal(true) }
|
13
14
|
it { Vedeu.events.registered?(:_cursor_reposition_).must_equal(true) }
|
14
15
|
it { Vedeu.events.registered?(:_cursor_reset_).must_equal(true) }
|
15
16
|
it { Vedeu.events.registered?(:_cursor_right_).must_equal(true) }
|
@@ -23,8 +23,6 @@ module Vedeu
|
|
23
23
|
before do
|
24
24
|
Vedeu.stubs(:trigger)
|
25
25
|
# Vedeu.interfaces.stubs(:by_name).returns(interface)
|
26
|
-
Vedeu::Visibility.stubs(:show)
|
27
|
-
Vedeu::Visibility.stubs(:hide)
|
28
26
|
end
|
29
27
|
after { Vedeu.interfaces.reset }
|
30
28
|
|
@@ -145,17 +143,14 @@ module Vedeu
|
|
145
143
|
|
146
144
|
describe '#hide' do
|
147
145
|
let(:interface) {
|
148
|
-
Vedeu::Interface.new({ name: _name, visible: visible })
|
146
|
+
Vedeu::Interface.new({ name: _name, visible: visible }).store
|
149
147
|
}
|
150
148
|
let(:_name) { 'Buffer#hide' }
|
151
149
|
let(:visible) {}
|
152
150
|
|
153
151
|
before do
|
154
|
-
interface.store
|
155
152
|
Vedeu::Output.stubs(:render)
|
156
|
-
|
157
|
-
after do
|
158
|
-
Vedeu.interfaces.reset
|
153
|
+
Vedeu::Visibility.stubs(:hide)
|
159
154
|
end
|
160
155
|
|
161
156
|
subject { instance.hide }
|
@@ -178,17 +173,14 @@ module Vedeu
|
|
178
173
|
|
179
174
|
describe '#show' do
|
180
175
|
let(:interface) {
|
181
|
-
Vedeu::Interface.new({ name: _name, visible: visible })
|
176
|
+
Vedeu::Interface.new({ name: _name, visible: visible }).store
|
182
177
|
}
|
183
178
|
let(:_name) { 'Buffer#show' }
|
184
179
|
let(:visible) {}
|
185
180
|
|
186
181
|
before do
|
187
|
-
interface.store
|
188
182
|
Vedeu::Output.stubs(:render)
|
189
|
-
|
190
|
-
after do
|
191
|
-
Vedeu.interfaces.reset
|
183
|
+
Vedeu::Visibility.stubs(:show)
|
192
184
|
end
|
193
185
|
|
194
186
|
subject { instance.show }
|
@@ -211,24 +203,22 @@ module Vedeu
|
|
211
203
|
|
212
204
|
describe '#toggle' do
|
213
205
|
let(:interface) {
|
214
|
-
Vedeu::Interface.new({ name: _name, visible: visible })
|
206
|
+
Vedeu::Interface.new({ name: _name, visible: visible }).store
|
215
207
|
}
|
216
208
|
let(:_name) { 'Buffer#toggle' }
|
217
209
|
let(:visible) {}
|
218
210
|
|
219
211
|
before do
|
220
|
-
interface.store
|
221
212
|
Vedeu::Output.stubs(:render)
|
222
213
|
end
|
223
|
-
after do
|
224
|
-
Vedeu.interfaces.reset
|
225
|
-
end
|
226
214
|
|
227
215
|
subject { instance.toggle }
|
228
216
|
|
229
217
|
context 'when the interface is visible' do
|
230
218
|
let(:visible) { true }
|
231
219
|
|
220
|
+
before { Vedeu::Visibility.stubs(:hide) }
|
221
|
+
|
232
222
|
it {
|
233
223
|
Vedeu::Visibility.expects(:hide).with(interface)
|
234
224
|
subject
|
@@ -238,6 +228,8 @@ module Vedeu
|
|
238
228
|
context 'when the interface is not visible' do
|
239
229
|
let(:visible) { false }
|
240
230
|
|
231
|
+
before { Vedeu::Visibility.stubs(:show) }
|
232
|
+
|
241
233
|
it {
|
242
234
|
Vedeu::Visibility.expects(:show).with(interface)
|
243
235
|
subject
|
@@ -6,13 +6,17 @@ module Vedeu
|
|
6
6
|
|
7
7
|
let(:described) { Vedeu::Borders }
|
8
8
|
|
9
|
-
after { Vedeu.borders.reset }
|
9
|
+
after { Vedeu.borders.reset! }
|
10
10
|
|
11
11
|
it { described.must_respond_to(:borders) }
|
12
12
|
|
13
13
|
describe '.reset!' do
|
14
14
|
subject { described.reset! }
|
15
15
|
|
16
|
+
before { described.stubs(:register) }
|
17
|
+
|
18
|
+
it { described.must_respond_to(:reset) }
|
19
|
+
|
16
20
|
it {
|
17
21
|
described.expects(:register).with(Vedeu::Border)
|
18
22
|
subject
|
@@ -21,20 +21,13 @@ module Vedeu
|
|
21
21
|
let(:instance) { described.new(model) }
|
22
22
|
let(:model) { VisibilityTestModel.new(visible) }
|
23
23
|
let(:visible) { true }
|
24
|
+
let(:_name) { 'Vedeu::Visibility' }
|
24
25
|
|
25
26
|
describe '#initialize' do
|
26
27
|
it { instance.must_be_instance_of(described) }
|
27
28
|
it { instance.instance_variable_get('@model').must_equal(model) }
|
28
29
|
end
|
29
30
|
|
30
|
-
describe '.for_cursor' do
|
31
|
-
let(:_name) {}
|
32
|
-
|
33
|
-
subject { described.for_cursor(_name) }
|
34
|
-
|
35
|
-
it { subject.must_be_instance_of(described) }
|
36
|
-
end
|
37
|
-
|
38
31
|
describe '.show' do
|
39
32
|
subject { described.show(model) }
|
40
33
|
|
@@ -51,6 +44,19 @@ module Vedeu
|
|
51
44
|
it { subject; instance.state.must_equal(:invisible) }
|
52
45
|
end
|
53
46
|
|
47
|
+
describe '.show_cursor' do
|
48
|
+
subject { described.show_cursor(_name) }
|
49
|
+
|
50
|
+
it { subject; instance.state.must_equal(:visible) }
|
51
|
+
end
|
52
|
+
|
53
|
+
describe '.hide_cursor' do
|
54
|
+
subject { described.hide_cursor(_name) }
|
55
|
+
|
56
|
+
# it { subject; instance.state.must_equal(:invisible) }
|
57
|
+
# it { skip }
|
58
|
+
end
|
59
|
+
|
54
60
|
describe '.toggle' do
|
55
61
|
subject { described.toggle(model) }
|
56
62
|
|
data/test/test_helper.rb
CHANGED
@@ -29,7 +29,7 @@ SimpleCov.start do
|
|
29
29
|
add_group 'storage', 'vedeu/storage'
|
30
30
|
add_group 'support', 'vedeu/support'
|
31
31
|
add_group 'templating', 'vedeu/templating'
|
32
|
-
end unless ENV['
|
32
|
+
end unless ENV['NO_SIMPLECOV']
|
33
33
|
|
34
34
|
module VedeuMiniTestPlugin
|
35
35
|
# def before_setup
|
@@ -49,20 +49,26 @@ module VedeuMiniTestPlugin
|
|
49
49
|
# super
|
50
50
|
# Vedeu::Repositories.reset!
|
51
51
|
# end
|
52
|
-
end
|
52
|
+
end # VedeuMiniTestPlugin
|
53
53
|
|
54
54
|
module MiniTest
|
55
|
+
|
55
56
|
class Spec
|
57
|
+
|
56
58
|
# parallelize_me! # uncomment to unleash hell
|
57
59
|
# i_suck_and_my_tests_are_order_dependent! # just incase
|
58
60
|
|
59
|
-
|
61
|
+
include VedeuMiniTestPlugin
|
60
62
|
|
61
63
|
class << self
|
64
|
+
|
62
65
|
alias_method :context, :describe
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
+
|
67
|
+
end # Eigenclass
|
68
|
+
|
69
|
+
end # Spec
|
70
|
+
|
71
|
+
end # MiniTest
|
66
72
|
|
67
73
|
require 'mocha/setup'
|
68
74
|
require 'vedeu'
|
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.46
|
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-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: guard
|
@@ -265,6 +265,12 @@ files:
|
|
265
265
|
- docs/api.md
|
266
266
|
- docs/applications.md
|
267
267
|
- docs/dsl.md
|
268
|
+
- docs/events.md
|
269
|
+
- docs/events/drb.md
|
270
|
+
- docs/events/main.md
|
271
|
+
- docs/events/menus.md
|
272
|
+
- docs/events/movement.md
|
273
|
+
- docs/events/visibility.md
|
268
274
|
- docs/getting_started.md
|
269
275
|
- docs/object_graph.md
|
270
276
|
- docs/views.md
|