vedeu 0.4.40 → 0.4.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +23 -28
  3. data/Guardfile +0 -8
  4. data/Rakefile +0 -6
  5. data/docs/applications.md +0 -1
  6. data/docs/dsl.md +7 -12
  7. data/examples/borders_app.rb +5 -0
  8. data/examples/configuration_app.rb +5 -0
  9. data/examples/drb_app.rb +5 -0
  10. data/examples/geometry_app.rb +5 -0
  11. data/examples/material_colours_app.rb +5 -0
  12. data/examples/panel_app.rb +5 -0
  13. data/examples/typed_commands/typed_commands_app.rb +5 -0
  14. data/examples/view_templates_app/view_templates_app.rb +5 -0
  15. data/lib/vedeu/api.rb +8 -8
  16. data/lib/vedeu/application/all.rb +3 -0
  17. data/lib/vedeu/application/application_controller.rb +4 -0
  18. data/lib/vedeu/application/application_helper.rb +4 -0
  19. data/lib/vedeu/application/application_view.rb +6 -0
  20. data/lib/vedeu/application/controller.rb +23 -0
  21. data/lib/vedeu/application/helper.rb +23 -0
  22. data/lib/vedeu/application/view.rb +23 -0
  23. data/lib/vedeu/application.rb +1 -3
  24. data/lib/vedeu/bindings.rb +64 -65
  25. data/lib/vedeu/bootstrap.rb +2 -0
  26. data/lib/vedeu/buffers/buffer.rb +44 -0
  27. data/lib/vedeu/configuration/api.rb +44 -119
  28. data/lib/vedeu/configuration/cli.rb +2 -0
  29. data/lib/vedeu/configuration/configuration.rb +4 -20
  30. data/lib/vedeu/cursor/cursor.rb +7 -7
  31. data/lib/vedeu/cursor/reposition.rb +2 -0
  32. data/lib/vedeu/dsl/border.rb +58 -2
  33. data/lib/vedeu/dsl/composition.rb +5 -3
  34. data/lib/vedeu/dsl/geometry.rb +14 -5
  35. data/lib/vedeu/dsl/group.rb +2 -0
  36. data/lib/vedeu/dsl/interface.rb +23 -3
  37. data/lib/vedeu/dsl/keymap.rb +11 -6
  38. data/lib/vedeu/dsl/line.rb +8 -0
  39. data/lib/vedeu/dsl/menu.rb +3 -1
  40. data/lib/vedeu/dsl/presentation.rb +12 -3
  41. data/lib/vedeu/dsl/text.rb +2 -0
  42. data/lib/vedeu/dsl/view.rb +6 -1
  43. data/lib/vedeu/events/event.rb +3 -1
  44. data/lib/vedeu/generator/application.rb +2 -7
  45. data/lib/vedeu/generator/templates/application/app/models/keymaps/_global_.rb +5 -0
  46. data/lib/vedeu/generator/templates/application/app/views/interfaces/name.erb +10 -0
  47. data/lib/vedeu/generator/view.rb +2 -0
  48. data/lib/vedeu/geometry/geometry.rb +14 -0
  49. data/lib/vedeu/geometry/index_position.rb +1 -0
  50. data/lib/vedeu/geometry/position.rb +5 -0
  51. data/lib/vedeu/input/all.rb +0 -8
  52. data/lib/vedeu/input/input.rb +24 -8
  53. data/lib/vedeu/input/mapper.rb +5 -12
  54. data/lib/vedeu/models/composition.rb +3 -3
  55. data/lib/vedeu/models/escape_char.rb +2 -0
  56. data/lib/vedeu/models/focus.rb +8 -0
  57. data/lib/vedeu/models/interface.rb +1 -1
  58. data/lib/vedeu/models/line.rb +1 -5
  59. data/lib/vedeu/models/menu.rb +4 -2
  60. data/lib/vedeu/models/panel.rb +2 -0
  61. data/lib/vedeu/null/buffer.rb +2 -0
  62. data/lib/vedeu/null/interface.rb +2 -0
  63. data/lib/vedeu/output/background.rb +1 -1
  64. data/lib/vedeu/output/border.rb +5 -157
  65. data/lib/vedeu/output/compressor.rb +2 -0
  66. data/lib/vedeu/output/foreground.rb +1 -1
  67. data/lib/vedeu/output/refresh.rb +5 -9
  68. data/lib/vedeu/output/render_border.rb +230 -0
  69. data/lib/vedeu/output/renderers/escape_sequence.rb +2 -3
  70. data/lib/vedeu/output/renderers/file.rb +10 -9
  71. data/lib/vedeu/repositories/collections/all.rb +4 -4
  72. data/lib/vedeu/repositories/repositories/all.rb +4 -4
  73. data/lib/vedeu/repositories/repositories/{background_colours.rb → backgrounds.rb} +3 -3
  74. data/lib/vedeu/repositories/repositories/cursors.rb +3 -0
  75. data/lib/vedeu/repositories/repositories/{events_repository.rb → events.rb} +5 -5
  76. data/lib/vedeu/repositories/repositories/{foreground_colours.rb → foregrounds.rb} +3 -3
  77. data/lib/vedeu/repositories/repositories/{interfaces_repository.rb → interfaces.rb} +4 -4
  78. data/lib/vedeu/storage/associative_store.rb +2 -0
  79. data/lib/vedeu/storage/conveyor_store.rb +2 -0
  80. data/lib/vedeu/storage/fifo_store.rb +2 -0
  81. data/lib/vedeu/storage/store.rb +7 -7
  82. data/lib/vedeu/support/options.rb +2 -0
  83. data/lib/vedeu/support/terminal.rb +3 -3
  84. data/lib/vedeu/support/timer.rb +2 -0
  85. data/lib/vedeu/support/visibility.rb +2 -0
  86. data/lib/vedeu/templating/directive.rb +2 -0
  87. data/lib/vedeu/templating/preprocessor.rb +2 -0
  88. data/lib/vedeu/version.rb +1 -1
  89. data/lib/vedeu.rb +3 -1
  90. data/test/lib/vedeu/bindings_test.rb +15 -0
  91. data/test/lib/vedeu/buffers/buffer_test.rb +12 -0
  92. data/test/lib/vedeu/configuration/api_test.rb +0 -39
  93. data/test/lib/vedeu/configuration/configuration_test.rb +0 -9
  94. data/test/lib/vedeu/cursor/cursor_test.rb +6 -0
  95. data/test/lib/vedeu/dsl/border_test.rb +12 -0
  96. data/test/lib/vedeu/dsl/composition_test.rb +2 -2
  97. data/test/lib/vedeu/geometry/index_position_test.rb +2 -0
  98. data/test/lib/vedeu/geometry/position_test.rb +6 -0
  99. data/test/lib/vedeu/models/cell_test.rb +16 -8
  100. data/test/lib/vedeu/models/char_test.rb +8 -0
  101. data/test/lib/vedeu/models/composition_test.rb +2 -2
  102. data/test/lib/vedeu/models/interface_test.rb +10 -0
  103. data/test/lib/vedeu/models/line_test.rb +12 -0
  104. data/test/lib/vedeu/models/stream_test.rb +1 -13
  105. data/test/lib/vedeu/output/border_test.rb +1 -0
  106. data/test/lib/vedeu/output/presentation_test.rb +2 -0
  107. data/test/lib/vedeu/output/render_border_test.rb +16 -0
  108. data/test/lib/vedeu/output/renderers/file_test.rb +32 -16
  109. data/test/lib/vedeu/repositories/collection_test.rb +7 -0
  110. data/test/lib/vedeu/repositories/collections/all_test.rb +18 -6
  111. data/test/lib/vedeu/repositories/model_test.rb +33 -7
  112. data/test/lib/vedeu/repositories/repositories/{background_colours_test.rb → backgrounds_test.rb} +3 -3
  113. data/test/lib/vedeu/repositories/repositories/borders_test.rb +7 -17
  114. data/test/lib/vedeu/repositories/repositories/buffers_test.rb +7 -22
  115. data/test/lib/vedeu/repositories/repositories/cursors_test.rb +32 -0
  116. data/test/lib/vedeu/repositories/repositories/events_test.rb +22 -0
  117. data/test/lib/vedeu/repositories/repositories/{foreground_colours_test.rb → foregrounds_test.rb} +3 -3
  118. data/test/lib/vedeu/repositories/repositories/geometries_test.rb +7 -21
  119. data/test/lib/vedeu/repositories/repositories/groups_test.rb +11 -0
  120. data/test/lib/vedeu/repositories/repositories/{interfaces_repositories_test.rb → interfaces_test.rb} +14 -3
  121. data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +10 -1
  122. data/test/lib/vedeu/repositories/repositories/menus_test.rb +10 -1
  123. data/test/lib/vedeu/repositories/repository_test.rb +15 -9
  124. data/test/lib/vedeu/storage/conveyor_store_test.rb +2 -4
  125. data/test/lib/vedeu/support/terminal_test.rb +2 -2
  126. data/test/lib/vedeu/templating/helpers_test.rb +4 -0
  127. data/vedeu.gemspec +0 -2
  128. metadata +20 -54
  129. data/config/cucumber.yml +0 -8
  130. data/features/cli_vedeu.feature +0 -5
  131. data/features/start_stop.feature +0 -27
  132. data/features/step_definitions/vedeu_steps.rb +0 -0
  133. data/features/support/env.rb +0 -15
  134. data/lib/vedeu/generator/templates/application/app/models/keymaps/_system_.rb +0 -7
  135. data/test/lib/vedeu/repositories/repositories/events_repository_test.rb +0 -13
  136. data/test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb +0 -11
@@ -32,6 +32,7 @@ module Vedeu
32
32
  def []
33
33
  Vedeu::Position.new(y, x)
34
34
  end
35
+ alias_method :to_position, :[]
35
36
 
36
37
  # An object is equal when its values are the same.
37
38
  #
@@ -75,6 +75,11 @@ module Vedeu
75
75
  [y, x]
76
76
  end
77
77
 
78
+ # @return [Vedeu::Position]
79
+ def to_position
80
+ self
81
+ end
82
+
78
83
  # Return the escape sequence required to position the cursor at a particular
79
84
  # point on the screen. When passed a block, will do the aforementioned,
80
85
  # call the block and then reposition to this location.
@@ -5,14 +5,6 @@ require_relative 'keymap'
5
5
 
6
6
  module Vedeu
7
7
 
8
- # Define a keymap called '_system_' which will hold some vital keys needed by
9
- # Vedeu to run effectively.
10
- Vedeu::DSL::Keymap.keymap('_system_') do |keymap|
11
- Vedeu::Configuration.system_keys.each do |label, keypress|
12
- keymap.key(keypress) { Vedeu.trigger(("_#{label}_").to_sym) }
13
- end
14
- end
15
-
16
8
  # Define a keymap called '_global_' which will respond no matter which
17
9
  # interface is in focus.
18
10
  #
@@ -86,14 +86,30 @@ module Vedeu
86
86
  "\eOQ" => :f2,
87
87
  "\eOR" => :f3,
88
88
  "\eOS" => :f4,
89
- "\e[15~" => :f5,
90
- "\e[17~" => :f6,
91
- "\e[18~" => :f7,
92
- "\e[19~" => :f8,
93
- "\e[20~" => :f9,
94
- "\e[21~" => :f10,
95
- "\e[23~" => :f11,
96
- "\e[24~" => :f12,
89
+ "\e[15~" => :f5,
90
+ "\e[15;2~" => :shift_f5,
91
+ "\e[15;5~" => :ctrl_f5,
92
+ "\e[17~" => :f6,
93
+ "\e[17;2~" => :shift_f6,
94
+ "\e[17;5~" => :ctrl_f6,
95
+ "\e[18~" => :f7,
96
+ "\e[18;2~" => :shift_f7,
97
+ "\e[18;5~" => :ctrl_f6,
98
+ "\e[19~" => :f8,
99
+ "\e[19;2~" => :shift_f8,
100
+ "\e[19;5~" => :ctrl_f6,
101
+ "\e[20~" => :f9,
102
+ "\e[20;2~" => :shift_f9,
103
+ "\e[20;5~" => :ctrl_f6,
104
+ "\e[21~" => :f10,
105
+ "\e[21;2~" => :shift_f10,
106
+ "\e[21;5~" => :ctrl_f6,
107
+ "\e[23~" => :f11,
108
+ "\e[23;2~" => :shift_f11,
109
+ "\e[23;5~" => :ctrl_f6,
110
+ "\e[24~" => :f12,
111
+ "\e[24;2~" => :shift_f12,
112
+ "\e[24;5~" => :ctrl_f6,
97
113
  "\e[1;2P" => :print_screen,
98
114
  "\e[1;2Q" => :scroll_lock,
99
115
  "\e[1;2R" => :pause_break,
@@ -46,27 +46,27 @@ module Vedeu
46
46
  end
47
47
 
48
48
  # Returns a boolean indicating that the key is registered to the current
49
- # keymap or the global or system keymap.
49
+ # keymap, or the global keymap.
50
50
  #
51
51
  # @return [Boolean]
52
52
  def keypress
53
53
  return false unless key
54
54
 
55
+ Vedeu.log(type: :debug, message: "Key detected: #{key.inspect}")
56
+
55
57
  return true if key_defined? && keymap.use(key)
56
58
 
57
59
  return true if global_key? && keymap('_global_').use(key)
58
60
 
59
- return true if system_key? && keymap('_system_').use(key)
60
-
61
61
  false
62
62
  end
63
63
 
64
64
  # Returns a boolean indicating that the key is not registered to the current
65
- # keymap, the global keymap or the system keymap.
65
+ # keymap, or the global keymap.
66
66
  #
67
67
  # @return [Boolean]
68
68
  def valid?
69
- return false if !key || key_defined? || global_key? || system_key?
69
+ return false if !key || key_defined? || global_key?
70
70
 
71
71
  true
72
72
  end
@@ -90,13 +90,6 @@ module Vedeu
90
90
  key_defined?('_global_')
91
91
  end
92
92
 
93
- # Is the key a system key?
94
- #
95
- # @return [Boolean]
96
- def system_key?
97
- key_defined?('_system_')
98
- end
99
-
100
93
  # Is the key defined in the named keymap?
101
94
  #
102
95
  # @param named [NilClass|String]
@@ -8,7 +8,7 @@ module Vedeu
8
8
  include Vedeu::Model
9
9
  include Vedeu::Presentation
10
10
 
11
- collection Vedeu::Interfaces
11
+ collection Vedeu::InterfaceCollection
12
12
  member Vedeu::Interface
13
13
 
14
14
  # @!attribute [r] attributes
@@ -29,12 +29,12 @@ module Vedeu
29
29
  end
30
30
 
31
31
  # @param child [Vedeu::Interface]
32
- # @return [Vedeu::Interfaces]
32
+ # @return [Vedeu::InterfaceCollection]
33
33
  def add(child)
34
34
  @interfaces = interfaces.add(child)
35
35
  end
36
36
 
37
- # @return [Vedeu::Interfaces]
37
+ # @return [Vedeu::InterfaceCollection]
38
38
  def interfaces
39
39
  collection.coerce(@interfaces, self)
40
40
  end
@@ -11,6 +11,8 @@ module Vedeu
11
11
  alias_method :to_s, :value
12
12
  alias_method :to_str, :value
13
13
 
14
+ # Returns a new instance of Vedeu::EscapeChar.
15
+ #
14
16
  # @param value [String]
15
17
  # @return [Vedeu::EscapeChar]
16
18
  def initialize(value)
@@ -4,6 +4,14 @@ module Vedeu
4
4
  # serving to store and manipulate the which interface is currently being
5
5
  # focussed.
6
6
  #
7
+ # @note
8
+ # - Interfaces are added to the collection in the order they are defined.
9
+ # - If the interface definition contains `focus!`,
10
+ # (see Vedeu::DSL::Interface#focus!) then that interface is prepended to
11
+ # the list.
12
+ # - If the `Vedeu.focus_by_name 'some_interface'` declaration is used, then
13
+ # the list pointer (`current`) is set to the interface of that name.
14
+ #
7
15
  # @api private
8
16
  module Focus
9
17
 
@@ -65,7 +65,7 @@ module Vedeu
65
65
  # @option attributes lines [Vedeu::Lines]
66
66
  # @option attributes name [String]
67
67
  # @option attributes parent [Vedeu::Composition]
68
- # @option attributes repository [Vedeu::InterfacesRepository]
68
+ # @option attributes repository [Vedeu::Interfaces]
69
69
  # @option attributes style [Vedeu::Style]
70
70
  # @option attributes visible [Boolean]
71
71
  # @option attributes zindex [Fixnum]
@@ -17,11 +17,6 @@ module Vedeu
17
17
  # @return [Interface]
18
18
  attr_accessor :parent
19
19
 
20
- # @!attribute [rw] streams
21
- # @return [Streams]
22
- attr_accessor :streams
23
- alias_method :value, :streams
24
-
25
20
  # @!attribute [r] attributes
26
21
  # @return [Hash]
27
22
  attr_reader :attributes
@@ -79,6 +74,7 @@ module Vedeu
79
74
  def streams
80
75
  @_streams ||= collection.coerce(@streams, self)
81
76
  end
77
+ alias_method :value, :streams
82
78
 
83
79
  # Delegate to Vedeu::Interface#width if available.
84
80
  #
@@ -41,12 +41,14 @@ module Vedeu
41
41
  # @example
42
42
  # Vedeu.menu 'my_interface' do
43
43
  # items [:item_1, :item_2, :item_3]
44
- # ...
44
+ # # ...
45
+ # end
45
46
  #
46
47
  # Vedeu.menu do
47
48
  # name 'menus_must_have_a_name'
48
49
  # items Track.all_my_favourites
49
- # ...
50
+ # # ...
51
+ # end
50
52
  #
51
53
  # @raise [InvalidSyntax] The required block was not given.
52
54
  # @return [API::Menu]
@@ -5,6 +5,8 @@ module Vedeu
5
5
  # @api private
6
6
  class Panel
7
7
 
8
+ # Returns a new instance of Vedeu::Panel.
9
+ #
8
10
  # @return [Vedeu::Panel]
9
11
  def initialize
10
12
  end
@@ -12,6 +12,8 @@ module Vedeu
12
12
  # @return [String]
13
13
  attr_reader :name
14
14
 
15
+ # Returns a new instance of Vedeu::Null::Buffer.
16
+ #
15
17
  # @param name [String]
16
18
  # @return [Vedeu::Null::Buffer]
17
19
  def initialize(name)
@@ -7,6 +7,8 @@ module Vedeu
7
7
  # @api private
8
8
  class Interface
9
9
 
10
+ # Returns a new instance of Vedeu::Null::Interface.
11
+ #
10
12
  # @param name [String]
11
13
  # @return [Vedeu::Null::Interface]
12
14
  def initialize(name = nil)
@@ -18,7 +18,7 @@ module Vedeu
18
18
  "\e[48;5;"
19
19
  end
20
20
 
21
- # @return [Vedeu::BackgroundColours]
21
+ # @return [Vedeu::Backgrounds]
22
22
  def repository
23
23
  Vedeu.background_colours
24
24
  end
@@ -1,3 +1,5 @@
1
+ require 'vedeu/output/render_border'
2
+
1
3
  module Vedeu
2
4
 
3
5
  # Provides the mechanism to decorate an interface with a border on all edges,
@@ -82,7 +84,7 @@ module Vedeu
82
84
 
83
85
  # @!attribute [r] enabled
84
86
  # @return [Boolean]
85
- attr_reader :enabled
87
+ attr_accessor :enabled
86
88
  alias_method :enabled?, :enabled
87
89
 
88
90
  # Returns a new instance of Vedeu::Border.
@@ -156,18 +158,7 @@ module Vedeu
156
158
 
157
159
  # @return [Array<Array<Vedeu::Char>>]
158
160
  def render
159
- return [] unless visible?
160
- return [] unless enabled?
161
-
162
- Vedeu.timer("Rendering border: #{name}") do
163
- out = [top, bottom]
164
-
165
- height.times do |y|
166
- out << [left(y), right(y)]
167
- end
168
-
169
- out.flatten
170
- end
161
+ @render ||= Vedeu::RenderBorder.with(self)
171
162
  end
172
163
 
173
164
  # @return [String]
@@ -176,152 +167,8 @@ module Vedeu
176
167
  end
177
168
  alias_method :to_str, :to_s
178
169
 
179
- # Renders the bottom border for the interface.
180
- #
181
- # @return [String]
182
- def bottom
183
- return [] unless bottom?
184
-
185
- out = []
186
- out << border(bottom_left, :bottom_left, *[yn, x]) if left?
187
- out << horizontal_border(:bottom_horizontal, yn)
188
- out << border(bottom_right, :bottom_right, *[yn, xn]) if right?
189
- out
190
- end
191
-
192
- # Renders the left border for the interface.
193
- #
194
- # @param iy [Fixnum]
195
- # @return [String]
196
- def left(iy = 0)
197
- return [] unless left?
198
-
199
- border(vertical, :left_vertical, *[(by + iy), x])
200
- end
201
-
202
- # Renders the right border for the interface.
203
- #
204
- # @param iy [Fixnum]
205
- # @return [String]
206
- def right(iy = 0)
207
- return [] unless right?
208
-
209
- border(vertical, :left_vertical, *[(by + iy), xn])
210
- end
211
-
212
- # Renders the top border for the interface.
213
- #
214
- # @note
215
- # If a title has been specified, then the top border will include this
216
- # title unless the size of the interface is smaller than the padded title
217
- # length.
218
- #
219
- # @return [String]
220
- def top
221
- return [] unless top?
222
-
223
- out = []
224
- out << border(top_left, :top_left, *[y, x]) if left?
225
- if title? && width > title_characters.size
226
- out << titlebar
227
-
228
- else
229
- out << horizontal_border(:top_horizontal, y)
230
-
231
- end
232
- out << border(top_right, :top_right, *[y, xn]) if right?
233
- out
234
- end
235
-
236
- # The parent of a border is always an interface.
237
- #
238
- # @return [Vedeu::Interface]
239
- def parent
240
- interface
241
- end
242
-
243
170
  private
244
171
 
245
- # @param position [Symbol] Either :top_horizontal, or :bottom_horizontal.
246
- # @return [Array<Vedeu::Char>]
247
- def horizontal_border(position, y_coordinate)
248
- width.times.each_with_object([]) do |ix, a|
249
- a << border(horizontal, position, *[y_coordinate, (bx + ix)])
250
- end
251
- end
252
-
253
- # From the second element of {#title_characters} remove the border from each
254
- # {#horizontal_border} Vedeu::Char, and add the title character.
255
- #
256
- # @return [Array<Vedeu::Char>]
257
- def titlebar
258
- horizontal_border(:top_horizontal, y).each_with_index do |char, index|
259
- if index >= 1 && index <= title_characters.size
260
- char.border = nil
261
- char.value = title_characters[(index - 1)]
262
- end
263
- end
264
- end
265
-
266
- # @return [Array<String>]
267
- def title_characters
268
- @title_characters ||= padded_title.chars
269
- end
270
-
271
- # Pads the title with a single whitespace either side.
272
- #
273
- # @example
274
- # title = 'Truncated!'
275
- # width = 20
276
- # # => ' Truncated! '
277
- #
278
- # width = 10
279
- # # => ' Trunca '
280
- #
281
- # @return [String]
282
- # @see #truncated_title
283
- def padded_title
284
- truncated_title.center(truncated_title.size + 2)
285
- end
286
-
287
- # Truncates the title to the width of the interface, minus characters needed
288
- # to ensure there is at least a single character of horizontal border and a
289
- # whitespace on either side of the title.
290
- #
291
- # @example
292
- # title = 'Truncated!'
293
- # width = 20
294
- # # => 'Truncated!'
295
- #
296
- # width = 10
297
- # # => 'Trunca'
298
- #
299
- # @return [String]
300
- def truncated_title
301
- title.chomp.slice(0..(width - 5))
302
- end
303
-
304
- # Return boolean indicating whether this border has a non-empty title.
305
- #
306
- # @return [Boolean]
307
- def title?
308
- present?(title)
309
- end
310
-
311
- # @param value [String]
312
- # @param type [Symbol|NilClass]
313
- # @param iy [Fixnum]
314
- # @param ix [Fixnum]
315
- # @return [Vedeu::Char]
316
- def border(value, type = :border, iy = 0, ix = 0)
317
- Vedeu::Char.new(value: value,
318
- parent: interface,
319
- colour: colour,
320
- style: style,
321
- position: Vedeu::Position[iy, ix],
322
- border: type)
323
- end
324
-
325
172
  # @return [Vedeu::Geometry]
326
173
  def geometry
327
174
  Vedeu.geometries.by_name(name)
@@ -331,6 +178,7 @@ module Vedeu
331
178
  def interface
332
179
  @interface ||= Vedeu.interfaces.by_name(name)
333
180
  end
181
+ alias_method :parent, :interface
334
182
 
335
183
  # The default values for a new instance of this class.
336
184
  #
@@ -13,6 +13,8 @@ module Vedeu
13
13
  new(output).render
14
14
  end
15
15
 
16
+ # Returns a new instance of Vedeu::Compressor.
17
+ #
16
18
  # @param output [Array<Array<Vedeu::Char>>]
17
19
  # @return [Vedeu::Compressor]
18
20
  def initialize(output)
@@ -18,7 +18,7 @@ module Vedeu
18
18
  "\e[38;5;"
19
19
  end
20
20
 
21
- # @return [Vedeu::ForegroundColours]
21
+ # @return [Vedeu::Foregrounds]
22
22
  def repository
23
23
  Vedeu.foreground_colours
24
24
  end
@@ -11,9 +11,7 @@ module Vedeu
11
11
  #
12
12
  # @return [Array]
13
13
  def all
14
- message = 'Refreshing all interfaces'
15
-
16
- Vedeu.timer(message) do
14
+ Vedeu.timer('Refreshing all interfaces') do
17
15
  Vedeu.interfaces.zindexed.each { |model| by_name(model.name) }
18
16
  end
19
17
  end
@@ -36,9 +34,7 @@ module Vedeu
36
34
  # @return [Array|ModelNotFound] A collection of the names of interfaces
37
35
  # refreshed, or an exception if the group was not found.
38
36
  def by_group(group_name)
39
- message = "Refreshing group: '#{group_name}'"
40
-
41
- Vedeu.timer(message) do
37
+ Vedeu.timer("Refreshing group: '#{group_name}'") do
42
38
  members = Vedeu.groups.find!(group_name).members
43
39
  interfaces = members.each { |name| Vedeu.interfaces.by_name(name) }
44
40
  by_zindex = interfaces.sort { |a, b| a.zindex <=> b.zindex }
@@ -52,9 +48,9 @@ module Vedeu
52
48
  # named buffer.
53
49
  # @return [Array|ModelNotFound]
54
50
  def by_name(name)
55
- message = "Refreshing interface: '#{name}'"
56
-
57
- Vedeu.timer(message) { Vedeu.buffers.by_name(name).render }
51
+ Vedeu.timer("Refreshing interface: '#{name}'") do
52
+ Vedeu.buffers.by_name(name).render
53
+ end
58
54
  end
59
55
 
60
56
  end # Refresh