vedeu 0.4.48 → 0.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/vedeu/api.rb +3 -1
- data/lib/vedeu/dsl/use.rb +7 -3
- data/lib/vedeu/events/event.rb +14 -3
- data/lib/vedeu/models/char.rb +9 -20
- data/lib/vedeu/null/border.rb +5 -0
- data/lib/vedeu/null/buffer.rb +5 -0
- data/lib/vedeu/null/generic.rb +5 -0
- data/lib/vedeu/null/geometry.rb +5 -0
- data/lib/vedeu/null/interface.rb +5 -0
- data/lib/vedeu/output/clear/all.rb +10 -0
- data/lib/vedeu/output/clear/named_interface.rb +10 -26
- data/lib/vedeu/output/render_border.rb +51 -61
- data/lib/vedeu/repositories/all.rb +0 -1
- data/lib/vedeu/version.rb +1 -1
- data/test/lib/vedeu/api_test.rb +1 -0
- data/test/lib/vedeu/bindings/bindings_test.rb +19 -19
- data/test/lib/vedeu/bindings/drb_test.rb +7 -7
- data/test/lib/vedeu/bindings/menus_test.rb +10 -10
- data/test/lib/vedeu/bindings/movement_test.rb +13 -13
- data/test/lib/vedeu/bindings/visibility_test.rb +9 -9
- data/test/lib/vedeu/dsl/use_test.rb +2 -0
- data/test/lib/vedeu/events/event_test.rb +17 -0
- data/test/lib/vedeu/null/border_test.rb +6 -0
- data/test/lib/vedeu/null/buffer_test.rb +6 -0
- data/test/lib/vedeu/null/generic_test.rb +6 -0
- data/test/lib/vedeu/null/geometry_test.rb +6 -0
- data/test/lib/vedeu/null/interface_test.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: aba52b40e7308a950ef038f55ad681f6605aa57f
|
|
4
|
+
data.tar.gz: c1040133b462db4cc0fd796674b8c0c7f2965c81
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: b0c936fd80c9b324ffe99a7e800ae7571510bb7c9714512c7db7e1da643f6b3b9a8d698f3f762aeaa50d376a1fd880d0e22130c6af596b4da4d7cd3531c53ff1
|
|
7
|
+
data.tar.gz: de9ca0380433479fc06ccbd95dde1836c65e9085abb76dbc6d5049a053e99e968dd6118591ac7293ddc48c2a9ca3aa7f6ade8df0aa3e10d8c170dca256992b43
|
data/lib/vedeu/api.rb
CHANGED
|
@@ -115,9 +115,11 @@ module Vedeu
|
|
|
115
115
|
|
|
116
116
|
# @!method bind
|
|
117
117
|
# @see Vedeu::Event.bind
|
|
118
|
+
# @!method bound?
|
|
119
|
+
# @see Vedeu::Event.bound?
|
|
118
120
|
# @!method unbind
|
|
119
121
|
# @see Vedeu::Event.unbind
|
|
120
|
-
def_delegators Vedeu::Event, :bind, :unbind
|
|
122
|
+
def_delegators Vedeu::Event, :bind, :bound?, :unbind
|
|
121
123
|
|
|
122
124
|
# Manipulate the repository of events.
|
|
123
125
|
#
|
data/lib/vedeu/dsl/use.rb
CHANGED
|
@@ -32,9 +32,13 @@ module Vedeu
|
|
|
32
32
|
# @param name [String] The name of the model to duplicate.
|
|
33
33
|
# @return [void] The new model based on the original.
|
|
34
34
|
def duplicate(name)
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
35
|
+
original = model.repository.by_name(name)
|
|
36
|
+
|
|
37
|
+
unless original.respond_to?(:null?)
|
|
38
|
+
duplicated = original.dup
|
|
39
|
+
duplicated.name = model.name
|
|
40
|
+
duplicated.store
|
|
41
|
+
end
|
|
38
42
|
end
|
|
39
43
|
|
|
40
44
|
# Use the attribute of stored model.
|
data/lib/vedeu/events/event.rb
CHANGED
|
@@ -88,17 +88,28 @@ module Vedeu
|
|
|
88
88
|
alias_method :event, :bind
|
|
89
89
|
alias_method :register, :bind
|
|
90
90
|
|
|
91
|
+
# Return a boolean indicating whether the named event is registered.
|
|
92
|
+
#
|
|
93
|
+
# @example
|
|
94
|
+
# Vedeu.bound?(:some_event)
|
|
95
|
+
#
|
|
96
|
+
# @param name [Symbol]
|
|
97
|
+
# @return [Boolean]
|
|
98
|
+
def bound?(name)
|
|
99
|
+
Vedeu.events.registered?(name)
|
|
100
|
+
end
|
|
101
|
+
|
|
91
102
|
# Unbind events from a named handler.
|
|
92
103
|
#
|
|
93
104
|
# Removes all events associated with the given name.
|
|
94
105
|
#
|
|
95
106
|
# @example
|
|
96
|
-
# Vedeu.unbind(
|
|
107
|
+
# Vedeu.unbind(:some_event)
|
|
97
108
|
#
|
|
98
|
-
# @param name [
|
|
109
|
+
# @param name [Symbol]
|
|
99
110
|
# @return [Boolean]
|
|
100
111
|
def unbind(name)
|
|
101
|
-
return false unless Vedeu.
|
|
112
|
+
return false unless Vedeu.bound?(name)
|
|
102
113
|
|
|
103
114
|
Vedeu.log(type: :event, message: "Unbinding: '#{name.inspect}'")
|
|
104
115
|
|
data/lib/vedeu/models/char.rb
CHANGED
|
@@ -49,12 +49,10 @@ module Vedeu
|
|
|
49
49
|
# border 'piece' this Char represents.
|
|
50
50
|
# @return [Char]
|
|
51
51
|
def initialize(attributes = {})
|
|
52
|
-
@attributes =
|
|
53
|
-
|
|
54
|
-
@
|
|
55
|
-
@
|
|
56
|
-
@value = @attributes[:value]
|
|
57
|
-
@position = Vedeu::Position.coerce(@attributes[:position])
|
|
52
|
+
@attributes = attributes
|
|
53
|
+
@border = @attributes[:border]
|
|
54
|
+
@parent = @attributes[:parent]
|
|
55
|
+
@value = @attributes[:value]
|
|
58
56
|
end
|
|
59
57
|
|
|
60
58
|
# When {Vedeu::Viewport#padded_lines} has less lines that required to fill
|
|
@@ -85,6 +83,11 @@ module Vedeu
|
|
|
85
83
|
"<Vedeu::Char '#{Vedeu::Esc.escape(to_s)}'>"
|
|
86
84
|
end
|
|
87
85
|
|
|
86
|
+
# @return [Vedeu::Position]
|
|
87
|
+
def position
|
|
88
|
+
@position = Vedeu::Position.coerce(@attributes[:position])
|
|
89
|
+
end
|
|
90
|
+
|
|
88
91
|
# Sets the position of the Char.
|
|
89
92
|
#
|
|
90
93
|
# @param value [Vedeu::Position]
|
|
@@ -151,20 +154,6 @@ module Vedeu
|
|
|
151
154
|
}
|
|
152
155
|
end
|
|
153
156
|
|
|
154
|
-
# The default values for a new instance of this class.
|
|
155
|
-
#
|
|
156
|
-
# @return [Hash]
|
|
157
|
-
def defaults
|
|
158
|
-
{
|
|
159
|
-
border: nil,
|
|
160
|
-
colour: nil,
|
|
161
|
-
parent: nil,
|
|
162
|
-
position: nil,
|
|
163
|
-
style: nil,
|
|
164
|
-
value: '',
|
|
165
|
-
}
|
|
166
|
-
end
|
|
167
|
-
|
|
168
157
|
# @return [Hash]
|
|
169
158
|
def parent_to_hash
|
|
170
159
|
{
|
data/lib/vedeu/null/border.rb
CHANGED
data/lib/vedeu/null/buffer.rb
CHANGED
data/lib/vedeu/null/generic.rb
CHANGED
data/lib/vedeu/null/geometry.rb
CHANGED
data/lib/vedeu/null/interface.rb
CHANGED
|
@@ -60,38 +60,22 @@ module Vedeu
|
|
|
60
60
|
# @return [Array<Array<Vedeu::Char>>]
|
|
61
61
|
def output
|
|
62
62
|
Vedeu.timer("Clearing: #{name}") do
|
|
63
|
-
@
|
|
64
|
-
|
|
63
|
+
@y = geometry.y
|
|
64
|
+
@x = geometry.x
|
|
65
|
+
@width = geometry.width
|
|
66
|
+
@height = geometry.height
|
|
67
|
+
@colour = interface.colour
|
|
68
|
+
|
|
69
|
+
@clear ||= Array.new(@width) do |iy|
|
|
70
|
+
Array.new(@height) do |ix|
|
|
65
71
|
Vedeu::Char.new(value: ' ',
|
|
66
|
-
colour: colour,
|
|
67
|
-
position:
|
|
72
|
+
colour: @colour,
|
|
73
|
+
position: [@y + iy, @x + ix])
|
|
68
74
|
end
|
|
69
75
|
end
|
|
70
76
|
end
|
|
71
77
|
end
|
|
72
78
|
|
|
73
|
-
def colour
|
|
74
|
-
@colour ||= interface.colour
|
|
75
|
-
end
|
|
76
|
-
|
|
77
|
-
def height
|
|
78
|
-
@height ||= geometry.height
|
|
79
|
-
end
|
|
80
|
-
|
|
81
|
-
def width
|
|
82
|
-
@width ||= geometry.width
|
|
83
|
-
end
|
|
84
|
-
|
|
85
|
-
# @return [Fixnum]
|
|
86
|
-
def x
|
|
87
|
-
@x ||= geometry.x
|
|
88
|
-
end
|
|
89
|
-
|
|
90
|
-
# @return [Fixnum]
|
|
91
|
-
def y
|
|
92
|
-
@y ||= geometry.y
|
|
93
|
-
end
|
|
94
|
-
|
|
95
79
|
end # NamedInterface
|
|
96
80
|
|
|
97
81
|
end # Clear
|
|
@@ -37,9 +37,6 @@ module Vedeu
|
|
|
37
37
|
:y,
|
|
38
38
|
:yn
|
|
39
39
|
|
|
40
|
-
def_delegators :interface,
|
|
41
|
-
:visible?
|
|
42
|
-
|
|
43
40
|
# @return [Array<Array<Vedeu::Char>>]
|
|
44
41
|
# @see Vedeu::RenderBorder#initialize
|
|
45
42
|
def self.with(border)
|
|
@@ -56,15 +53,13 @@ module Vedeu
|
|
|
56
53
|
|
|
57
54
|
# @return [Array<Array<Vedeu::Char>>]
|
|
58
55
|
def render
|
|
59
|
-
return [] unless visible?
|
|
56
|
+
return [] unless interface.visible?
|
|
60
57
|
return [] unless enabled?
|
|
61
58
|
|
|
62
59
|
Vedeu.timer("Rendering border: #{name}") do
|
|
63
60
|
out = [top, bottom]
|
|
64
61
|
|
|
65
|
-
height.times
|
|
66
|
-
out << [left(y), right(y)]
|
|
67
|
-
end
|
|
62
|
+
height.times { |y| out << [left(y), right(y)] }
|
|
68
63
|
|
|
69
64
|
out.flatten
|
|
70
65
|
end
|
|
@@ -88,15 +83,10 @@ module Vedeu
|
|
|
88
83
|
parent: interface,
|
|
89
84
|
colour: colour,
|
|
90
85
|
style: style,
|
|
91
|
-
position:
|
|
86
|
+
position: [iy, ix],
|
|
92
87
|
border: type)
|
|
93
88
|
end
|
|
94
89
|
|
|
95
|
-
# @return [Array<Vedeu::Char>]
|
|
96
|
-
def build_bottom_horizontal
|
|
97
|
-
horizontal_border(:bottom_horizontal, yn)
|
|
98
|
-
end
|
|
99
|
-
|
|
100
90
|
# @return [Vedeu::Char]
|
|
101
91
|
def build_bottom_left
|
|
102
92
|
build(bottom_left, :bottom_left, *[yn, x]) if left?
|
|
@@ -107,11 +97,6 @@ module Vedeu
|
|
|
107
97
|
build(bottom_right, :bottom_right, *[yn, xn]) if right?
|
|
108
98
|
end
|
|
109
99
|
|
|
110
|
-
# @return [Array<Vedeu::Char>]
|
|
111
|
-
def build_top_horizontal
|
|
112
|
-
horizontal_border(:top_horizontal, y)
|
|
113
|
-
end
|
|
114
|
-
|
|
115
100
|
# @return [Vedeu::Char]
|
|
116
101
|
def build_top_left
|
|
117
102
|
build(top_left, :top_left, *[y, x]) if left?
|
|
@@ -128,7 +113,11 @@ module Vedeu
|
|
|
128
113
|
def bottom
|
|
129
114
|
return [] unless bottom?
|
|
130
115
|
|
|
131
|
-
[
|
|
116
|
+
[
|
|
117
|
+
build_bottom_left,
|
|
118
|
+
build_horizontal(:bottom_horizontal, yn),
|
|
119
|
+
build_bottom_right,
|
|
120
|
+
].compact
|
|
132
121
|
end
|
|
133
122
|
|
|
134
123
|
# @return [Vedeu::Geometry]
|
|
@@ -137,10 +126,11 @@ module Vedeu
|
|
|
137
126
|
end
|
|
138
127
|
|
|
139
128
|
# @param position [Symbol] Either :top_horizontal, or :bottom_horizontal.
|
|
129
|
+
# @param y_coordinate [Fixnum] The value of either y or yn.
|
|
140
130
|
# @return [Array<Vedeu::Char>]
|
|
141
|
-
def
|
|
142
|
-
|
|
143
|
-
|
|
131
|
+
def build_horizontal(position, y_coordinate)
|
|
132
|
+
Array.new(width) do |ix|
|
|
133
|
+
build(horizontal, position, *[y_coordinate, (bx + ix)])
|
|
144
134
|
end
|
|
145
135
|
end
|
|
146
136
|
|
|
@@ -162,22 +152,6 @@ module Vedeu
|
|
|
162
152
|
build(vertical, :left_vertical, *[(by + iy), x])
|
|
163
153
|
end
|
|
164
154
|
|
|
165
|
-
# Pads the title with a single whitespace either side.
|
|
166
|
-
#
|
|
167
|
-
# @example
|
|
168
|
-
# title = 'Truncated!'
|
|
169
|
-
# width = 20
|
|
170
|
-
# # => ' Truncated! '
|
|
171
|
-
#
|
|
172
|
-
# width = 10
|
|
173
|
-
# # => ' Trunca '
|
|
174
|
-
#
|
|
175
|
-
# @return [String]
|
|
176
|
-
# @see #truncated_title
|
|
177
|
-
def padded_title
|
|
178
|
-
truncated_title.center(truncated_title.size + 2)
|
|
179
|
-
end
|
|
180
|
-
|
|
181
155
|
# Renders the right border for the interface.
|
|
182
156
|
#
|
|
183
157
|
# @param iy [Fixnum]
|
|
@@ -188,19 +162,18 @@ module Vedeu
|
|
|
188
162
|
build(vertical, :right_vertical, *[(by + iy), xn])
|
|
189
163
|
end
|
|
190
164
|
|
|
191
|
-
#
|
|
165
|
+
# Renders the top border for the interface.
|
|
192
166
|
#
|
|
193
|
-
# @
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
# Return boolean indicating whether the title fits within the width of the
|
|
199
|
-
# top border.
|
|
167
|
+
# @note
|
|
168
|
+
# If a title has been specified, then the top border will include this
|
|
169
|
+
# title unless the size of the interface is smaller than the padded title
|
|
170
|
+
# length.
|
|
200
171
|
#
|
|
201
|
-
# @return [
|
|
202
|
-
def
|
|
203
|
-
|
|
172
|
+
# @return [String]
|
|
173
|
+
def top
|
|
174
|
+
return [] unless top?
|
|
175
|
+
|
|
176
|
+
[build_top_left, titlebar, build_top_right].compact
|
|
204
177
|
end
|
|
205
178
|
|
|
206
179
|
# From the second element of {#title_characters} remove the border from each
|
|
@@ -208,9 +181,9 @@ module Vedeu
|
|
|
208
181
|
#
|
|
209
182
|
# @return [Array<Vedeu::Char>]
|
|
210
183
|
def titlebar
|
|
211
|
-
return
|
|
184
|
+
return build_horizontal(:top_horizontal, y) unless title? && title_fits?
|
|
212
185
|
|
|
213
|
-
|
|
186
|
+
build_horizontal(:top_horizontal, y).each_with_index do |char, index|
|
|
214
187
|
if index >= 1 && index <= title_characters.size
|
|
215
188
|
char.border = nil
|
|
216
189
|
char.value = title_characters[(index - 1)]
|
|
@@ -218,23 +191,40 @@ module Vedeu
|
|
|
218
191
|
end
|
|
219
192
|
end
|
|
220
193
|
|
|
194
|
+
# Return boolean indicating whether this border has a non-empty title.
|
|
195
|
+
#
|
|
196
|
+
# @return [Boolean]
|
|
197
|
+
def title?
|
|
198
|
+
present?(title)
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
# Return boolean indicating whether the title fits within the width of the
|
|
202
|
+
# top border.
|
|
203
|
+
#
|
|
204
|
+
# @return [Boolean]
|
|
205
|
+
def title_fits?
|
|
206
|
+
width > title_characters.size
|
|
207
|
+
end
|
|
208
|
+
|
|
221
209
|
# @return [Array<String>]
|
|
222
210
|
def title_characters
|
|
223
|
-
@title_characters ||=
|
|
211
|
+
@title_characters ||= title_padded.chars
|
|
224
212
|
end
|
|
225
213
|
|
|
226
|
-
#
|
|
214
|
+
# Pads the title with a single whitespace either side.
|
|
227
215
|
#
|
|
228
|
-
# @
|
|
229
|
-
#
|
|
230
|
-
#
|
|
231
|
-
#
|
|
216
|
+
# @example
|
|
217
|
+
# title = 'Truncated!'
|
|
218
|
+
# width = 20
|
|
219
|
+
# # => ' Truncated! '
|
|
220
|
+
#
|
|
221
|
+
# width = 10
|
|
222
|
+
# # => ' Trunca '
|
|
232
223
|
#
|
|
233
224
|
# @return [String]
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
[build_top_left, titlebar, build_top_right].compact
|
|
225
|
+
# @see #truncated_title
|
|
226
|
+
def title_padded
|
|
227
|
+
truncated_title.center(truncated_title.size + 2)
|
|
238
228
|
end
|
|
239
229
|
|
|
240
230
|
# Truncates the title to the width of the interface, minus characters needed
|
data/lib/vedeu/version.rb
CHANGED
data/test/lib/vedeu/api_test.rb
CHANGED
|
@@ -19,6 +19,7 @@ module Vedeu
|
|
|
19
19
|
it { Vedeu.must_respond_to(:renders) }
|
|
20
20
|
it { Vedeu.must_respond_to(:views) }
|
|
21
21
|
it { Vedeu.must_respond_to(:bind) }
|
|
22
|
+
it { Vedeu.must_respond_to(:bound?) }
|
|
22
23
|
it { Vedeu.must_respond_to(:unbind) }
|
|
23
24
|
it { Vedeu.must_respond_to(:events) }
|
|
24
25
|
it { Vedeu.must_respond_to(:focus) }
|
|
@@ -5,34 +5,34 @@ module Vedeu
|
|
|
5
5
|
describe Bindings do
|
|
6
6
|
|
|
7
7
|
context 'the system events needed by Vedeu to run are defined' do
|
|
8
|
-
it { Vedeu.
|
|
9
|
-
it { Vedeu.
|
|
10
|
-
it { Vedeu.
|
|
11
|
-
it { Vedeu.
|
|
12
|
-
it { Vedeu.
|
|
13
|
-
it { Vedeu.
|
|
14
|
-
it { Vedeu.
|
|
15
|
-
it { Vedeu.
|
|
16
|
-
it { Vedeu.
|
|
17
|
-
it { Vedeu.
|
|
18
|
-
it { Vedeu.
|
|
19
|
-
it { Vedeu.
|
|
20
|
-
it { Vedeu.
|
|
8
|
+
it { Vedeu.bound?(:_clear_).must_equal(true) }
|
|
9
|
+
it { Vedeu.bound?(:_clear_group_).must_equal(true) }
|
|
10
|
+
it { Vedeu.bound?(:_cleanup_).must_equal(true) }
|
|
11
|
+
it { Vedeu.bound?(:_command_).must_equal(true) }
|
|
12
|
+
it { Vedeu.bound?(:_exit_).must_equal(true) }
|
|
13
|
+
it { Vedeu.bound?(:_initialize_).must_equal(true) }
|
|
14
|
+
it { Vedeu.bound?(:_keypress_).must_equal(true) }
|
|
15
|
+
it { Vedeu.bound?(:_log_).must_equal(true) }
|
|
16
|
+
it { Vedeu.bound?(:_mode_switch_).must_equal(true) }
|
|
17
|
+
it { Vedeu.bound?(:_refresh_).must_equal(true) }
|
|
18
|
+
it { Vedeu.bound?(:_refresh_cursor_).must_equal(true) }
|
|
19
|
+
it { Vedeu.bound?(:_refresh_group_).must_equal(true) }
|
|
20
|
+
it { Vedeu.bound?(:_resize_).must_equal(true) }
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
context 'the geometry specific events are defined' do
|
|
24
|
-
it { Vedeu.
|
|
25
|
-
it { Vedeu.
|
|
24
|
+
it { Vedeu.bound?(:_maximise_).must_equal(true) }
|
|
25
|
+
it { Vedeu.bound?(:_unmaximise_).must_equal(true) }
|
|
26
26
|
end
|
|
27
27
|
|
|
28
28
|
context 'the focus specific events are defined' do
|
|
29
|
-
it { Vedeu.
|
|
30
|
-
it { Vedeu.
|
|
31
|
-
it { Vedeu.
|
|
29
|
+
it { Vedeu.bound?(:_focus_by_name_).must_equal(true) }
|
|
30
|
+
it { Vedeu.bound?(:_focus_next_).must_equal(true) }
|
|
31
|
+
it { Vedeu.bound?(:_focus_prev_).must_equal(true) }
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
context 'the refresh event for all registered interfaces is defined' do
|
|
35
|
-
it { Vedeu.
|
|
35
|
+
it { Vedeu.bound?(:_refresh_).must_equal(true) }
|
|
36
36
|
end
|
|
37
37
|
|
|
38
38
|
end # Bindings
|
|
@@ -7,13 +7,13 @@ module Vedeu
|
|
|
7
7
|
describe DRB do
|
|
8
8
|
|
|
9
9
|
context 'the drb specific events are defined' do
|
|
10
|
-
it { Vedeu.
|
|
11
|
-
it { Vedeu.
|
|
12
|
-
it { Vedeu.
|
|
13
|
-
it { Vedeu.
|
|
14
|
-
it { Vedeu.
|
|
15
|
-
it { Vedeu.
|
|
16
|
-
it { Vedeu.
|
|
10
|
+
it { Vedeu.bound?(:_drb_input_).must_equal(true) }
|
|
11
|
+
it { Vedeu.bound?(:_drb_retrieve_output_).must_equal(true) }
|
|
12
|
+
it { Vedeu.bound?(:_drb_store_output_).must_equal(true) }
|
|
13
|
+
it { Vedeu.bound?(:_drb_restart_).must_equal(true) }
|
|
14
|
+
it { Vedeu.bound?(:_drb_start_).must_equal(true) }
|
|
15
|
+
it { Vedeu.bound?(:_drb_status_).must_equal(true) }
|
|
16
|
+
it { Vedeu.bound?(:_drb_stop_).must_equal(true) }
|
|
17
17
|
end
|
|
18
18
|
|
|
19
19
|
end # DRB
|
|
@@ -7,16 +7,16 @@ module Vedeu
|
|
|
7
7
|
describe Menus do
|
|
8
8
|
|
|
9
9
|
context 'the menu specific events are defined' do
|
|
10
|
-
it { Vedeu.
|
|
11
|
-
it { Vedeu.
|
|
12
|
-
it { Vedeu.
|
|
13
|
-
it { Vedeu.
|
|
14
|
-
it { Vedeu.
|
|
15
|
-
it { Vedeu.
|
|
16
|
-
it { Vedeu.
|
|
17
|
-
it { Vedeu.
|
|
18
|
-
it { Vedeu.
|
|
19
|
-
it { Vedeu.
|
|
10
|
+
it { Vedeu.bound?(:_menu_bottom_).must_equal(true) }
|
|
11
|
+
it { Vedeu.bound?(:_menu_current_).must_equal(true) }
|
|
12
|
+
it { Vedeu.bound?(:_menu_deselect_).must_equal(true) }
|
|
13
|
+
it { Vedeu.bound?(:_menu_items_).must_equal(true) }
|
|
14
|
+
it { Vedeu.bound?(:_menu_next_).must_equal(true) }
|
|
15
|
+
it { Vedeu.bound?(:_menu_prev_).must_equal(true) }
|
|
16
|
+
it { Vedeu.bound?(:_menu_selected_).must_equal(true) }
|
|
17
|
+
it { Vedeu.bound?(:_menu_select_).must_equal(true) }
|
|
18
|
+
it { Vedeu.bound?(:_menu_top_).must_equal(true) }
|
|
19
|
+
it { Vedeu.bound?(:_menu_view_).must_equal(true) }
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
end # Menus
|
|
@@ -7,19 +7,19 @@ module Vedeu
|
|
|
7
7
|
describe Movement do
|
|
8
8
|
|
|
9
9
|
context 'the movement events are defined' do
|
|
10
|
-
it { Vedeu.
|
|
11
|
-
it { Vedeu.
|
|
12
|
-
it { Vedeu.
|
|
13
|
-
it { Vedeu.
|
|
14
|
-
it { Vedeu.
|
|
15
|
-
it { Vedeu.
|
|
16
|
-
it { Vedeu.
|
|
17
|
-
it { Vedeu.
|
|
18
|
-
|
|
19
|
-
it { Vedeu.
|
|
20
|
-
it { Vedeu.
|
|
21
|
-
it { Vedeu.
|
|
22
|
-
it { Vedeu.
|
|
10
|
+
it { Vedeu.bound?(:_cursor_down_).must_equal(true) }
|
|
11
|
+
it { Vedeu.bound?(:_cursor_left_).must_equal(true) }
|
|
12
|
+
it { Vedeu.bound?(:_cursor_origin_).must_equal(true) }
|
|
13
|
+
it { Vedeu.bound?(:_cursor_position_).must_equal(true) }
|
|
14
|
+
it { Vedeu.bound?(:_cursor_reposition_).must_equal(true) }
|
|
15
|
+
it { Vedeu.bound?(:_cursor_reset_).must_equal(true) }
|
|
16
|
+
it { Vedeu.bound?(:_cursor_right_).must_equal(true) }
|
|
17
|
+
it { Vedeu.bound?(:_cursor_up_).must_equal(true) }
|
|
18
|
+
|
|
19
|
+
it { Vedeu.bound?(:_geometry_down_).must_equal(true) }
|
|
20
|
+
it { Vedeu.bound?(:_geometry_left_).must_equal(true) }
|
|
21
|
+
it { Vedeu.bound?(:_geometry_right_).must_equal(true) }
|
|
22
|
+
it { Vedeu.bound?(:_geometry_up_).must_equal(true) }
|
|
23
23
|
end
|
|
24
24
|
|
|
25
25
|
end # Movement
|
|
@@ -7,17 +7,17 @@ module Vedeu
|
|
|
7
7
|
describe Visibility do
|
|
8
8
|
|
|
9
9
|
context 'the visibility events are defined' do
|
|
10
|
-
it { Vedeu.
|
|
11
|
-
it { Vedeu.
|
|
12
|
-
it { Vedeu.
|
|
13
|
-
it { Vedeu.
|
|
10
|
+
it { Vedeu.bound?(:_cursor_hide_).must_equal(true) }
|
|
11
|
+
it { Vedeu.bound?(:_cursor_show_).must_equal(true) }
|
|
12
|
+
it { Vedeu.bound?(:_hide_cursor_).must_equal(true) }
|
|
13
|
+
it { Vedeu.bound?(:_show_cursor_).must_equal(true) }
|
|
14
14
|
|
|
15
|
-
it { Vedeu.
|
|
16
|
-
it { Vedeu.
|
|
15
|
+
it { Vedeu.bound?(:_hide_group_).must_equal(true) }
|
|
16
|
+
it { Vedeu.bound?(:_show_group_).must_equal(true) }
|
|
17
17
|
|
|
18
|
-
it { Vedeu.
|
|
19
|
-
it { Vedeu.
|
|
20
|
-
it { Vedeu.
|
|
18
|
+
it { Vedeu.bound?(:_hide_interface_).must_equal(true) }
|
|
19
|
+
it { Vedeu.bound?(:_show_interface_).must_equal(true) }
|
|
20
|
+
it { Vedeu.bound?(:_toggle_interface_).must_equal(true) }
|
|
21
21
|
end
|
|
22
22
|
|
|
23
23
|
end # Visibility
|
|
@@ -18,6 +18,23 @@ module Vedeu
|
|
|
18
18
|
it { subject.must_be_instance_of(TrueClass) }
|
|
19
19
|
end
|
|
20
20
|
|
|
21
|
+
describe '.bound?' do
|
|
22
|
+
subject { described.bound?(event_name) }
|
|
23
|
+
|
|
24
|
+
context 'when the event is registered' do
|
|
25
|
+
before { Vedeu.bind(event_name) }
|
|
26
|
+
after { Vedeu.unbind(event_name) }
|
|
27
|
+
|
|
28
|
+
it { subject.must_equal(true) }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
context 'when the event is not registered' do
|
|
32
|
+
before { Vedeu.unbind(event_name) }
|
|
33
|
+
|
|
34
|
+
it { subject.must_equal(false) }
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
21
38
|
describe '.unbind' do
|
|
22
39
|
it { described.must_respond_to(:unbind ) }
|
|
23
40
|
end
|
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.49
|
|
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-13 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: guard
|