vedeu 0.6.20 → 0.6.21

Sign up to get free protection for your applications and to get access to all the features.
Files changed (170) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +1 -1
  3. data/README.md +4 -0
  4. data/Rakefile +13 -0
  5. data/bin/vedeu_drb_server +6 -6
  6. data/docs/api.md +14 -0
  7. data/docs/dsl.md +12 -12
  8. data/docs/events/document.md +4 -2
  9. data/docs/events/drb.md +4 -0
  10. data/docs/events/focus.md +2 -0
  11. data/docs/events/menu.md +2 -0
  12. data/docs/events/movement.md +7 -5
  13. data/docs/events/refresh.md +2 -0
  14. data/docs/events/system.md +5 -0
  15. data/docs/events/view.md +2 -0
  16. data/docs/events/visibility.md +2 -0
  17. data/lib/vedeu.rb +0 -23
  18. data/lib/vedeu/all.rb +2 -4
  19. data/lib/vedeu/application/application_view.rb +1 -1
  20. data/lib/vedeu/borders/all.rb +3 -3
  21. data/lib/vedeu/borders/border.rb +2 -2
  22. data/lib/vedeu/borders/dsl.rb +21 -27
  23. data/lib/vedeu/borders/null.rb +2 -15
  24. data/lib/vedeu/borders/render.rb +1 -1
  25. data/lib/vedeu/borders/repository.rb +9 -0
  26. data/lib/vedeu/buffers/buffer.rb +2 -2
  27. data/lib/vedeu/buffers/null.rb +1 -31
  28. data/lib/vedeu/buffers/refresh.rb +8 -8
  29. data/lib/vedeu/buffers/repository.rb +9 -0
  30. data/lib/vedeu/colours/backgrounds.rb +9 -0
  31. data/lib/vedeu/colours/colour.rb +1 -1
  32. data/lib/vedeu/colours/foregrounds.rb +9 -0
  33. data/lib/vedeu/common.rb +22 -13
  34. data/lib/vedeu/configuration/configuration.rb +6 -0
  35. data/lib/vedeu/cursors/cursor.rb +13 -8
  36. data/lib/vedeu/cursors/refresh.rb +2 -2
  37. data/lib/vedeu/cursors/repository.rb +18 -1
  38. data/lib/vedeu/distributed/server.rb +23 -0
  39. data/lib/vedeu/distributed/templates/default_borders.vedeu +1 -1
  40. data/lib/vedeu/distributed/templates/default_geometries.vedeu +1 -1
  41. data/lib/vedeu/distributed/templates/default_interfaces.vedeu +1 -1
  42. data/lib/vedeu/distributed/templates/default_keymaps.vedeu +1 -1
  43. data/lib/vedeu/distributed/templates/default_menus.vedeu +1 -1
  44. data/lib/vedeu/distributed/templates/default_views.vedeu +1 -1
  45. data/lib/vedeu/dsl/composition.rb +7 -17
  46. data/lib/vedeu/dsl/dsl.rb +12 -0
  47. data/lib/vedeu/dsl/interface.rb +32 -33
  48. data/lib/vedeu/dsl/keymap.rb +13 -19
  49. data/lib/vedeu/dsl/line.rb +3 -13
  50. data/lib/vedeu/dsl/shared.rb +5 -5
  51. data/lib/vedeu/dsl/stream.rb +0 -10
  52. data/lib/vedeu/dsl/use.rb +6 -6
  53. data/lib/vedeu/dsl/view.rb +17 -19
  54. data/lib/vedeu/editor/cursor.rb +32 -10
  55. data/lib/vedeu/editor/document.rb +33 -35
  56. data/lib/vedeu/editor/editor.rb +3 -4
  57. data/lib/vedeu/editor/insert.rb +1 -1
  58. data/lib/vedeu/editor/line.rb +1 -8
  59. data/lib/vedeu/editor/lines.rb +1 -1
  60. data/lib/vedeu/editor/repository.rb +9 -0
  61. data/lib/vedeu/esc/esc.rb +2 -1
  62. data/lib/vedeu/events/aliases.rb +8 -1
  63. data/lib/vedeu/events/event.rb +8 -0
  64. data/lib/vedeu/events/repository.rb +9 -0
  65. data/lib/vedeu/events/trigger.rb +9 -5
  66. data/lib/vedeu/geometry/coordinate.rb +2 -2
  67. data/lib/vedeu/geometry/dsl.rb +32 -38
  68. data/lib/vedeu/geometry/generic_coordinate.rb +1 -1
  69. data/lib/vedeu/geometry/geometry.rb +3 -3
  70. data/lib/vedeu/geometry/null.rb +2 -24
  71. data/lib/vedeu/geometry/repository.rb +9 -0
  72. data/lib/vedeu/groups/clear.rb +7 -3
  73. data/lib/vedeu/groups/dsl.rb +29 -35
  74. data/lib/vedeu/groups/group.rb +28 -4
  75. data/lib/vedeu/groups/refresh.rb +3 -2
  76. data/lib/vedeu/groups/repository.rb +9 -0
  77. data/lib/vedeu/input/capture.rb +1 -1
  78. data/lib/vedeu/input/keymap.rb +2 -1
  79. data/lib/vedeu/input/keymaps.rb +9 -0
  80. data/lib/vedeu/input/mapper.rb +4 -0
  81. data/lib/vedeu/input/translator.rb +1 -1
  82. data/lib/vedeu/logging/debug.rb +13 -0
  83. data/lib/vedeu/logging/log.rb +8 -0
  84. data/lib/vedeu/logging/timer.rb +13 -0
  85. data/lib/vedeu/menus/dsl.rb +8 -18
  86. data/lib/vedeu/menus/menu.rb +8 -4
  87. data/lib/vedeu/menus/null.rb +1 -1
  88. data/lib/vedeu/menus/repository.rb +9 -0
  89. data/lib/vedeu/models/cell.rb +5 -0
  90. data/lib/vedeu/models/escape.rb +5 -0
  91. data/lib/vedeu/models/focus.rb +20 -5
  92. data/lib/vedeu/models/interface.rb +10 -1
  93. data/lib/vedeu/models/interfaces.rb +9 -0
  94. data/lib/vedeu/models/toggleable.rb +19 -4
  95. data/lib/vedeu/models/views/char.rb +6 -1
  96. data/lib/vedeu/models/views/html_char.rb +1 -4
  97. data/lib/vedeu/models/views/line.rb +1 -1
  98. data/lib/vedeu/models/views/view.rb +1 -1
  99. data/lib/vedeu/null/generic.rb +14 -2
  100. data/lib/vedeu/null/interface.rb +1 -1
  101. data/lib/vedeu/null/view.rb +1 -1
  102. data/lib/vedeu/output/clear/interface.rb +5 -1
  103. data/lib/vedeu/output/compressor.rb +8 -4
  104. data/lib/vedeu/output/direct.rb +4 -4
  105. data/lib/vedeu/output/presentation/all.rb +15 -0
  106. data/lib/vedeu/output/presentation/presentation.rb +0 -7
  107. data/lib/vedeu/output/refresh/refresh.rb +1 -3
  108. data/lib/vedeu/output/renderers/all.rb +10 -0
  109. data/lib/vedeu/output/renderers/terminal.rb +1 -3
  110. data/lib/vedeu/repositories/collection.rb +3 -3
  111. data/lib/vedeu/repositories/model.rb +1 -1
  112. data/lib/vedeu/repositories/repository.rb +8 -8
  113. data/lib/vedeu/repositories/store.rb +3 -2
  114. data/lib/vedeu/runtime/application.rb +4 -0
  115. data/lib/vedeu/runtime/bootstrap.rb +1 -1
  116. data/lib/vedeu/runtime/flags.rb +7 -0
  117. data/lib/vedeu/runtime/main_loop.rb +2 -0
  118. data/lib/vedeu/runtime/router.rb +4 -0
  119. data/lib/vedeu/templating/decoder.rb +1 -1
  120. data/lib/vedeu/templating/encoder.rb +1 -1
  121. data/lib/vedeu/templating/helpers.rb +2 -0
  122. data/lib/vedeu/templating/template.rb +1 -1
  123. data/lib/vedeu/terminal/buffer.rb +7 -0
  124. data/lib/vedeu/terminal/terminal.rb +8 -0
  125. data/lib/vedeu/version.rb +1 -1
  126. data/test/lib/vedeu/borders/dsl_test.rb +0 -6
  127. data/test/lib/vedeu/borders/null_test.rb +0 -12
  128. data/test/lib/vedeu/buffers/null_test.rb +0 -37
  129. data/test/lib/vedeu/common_test.rb +33 -0
  130. data/test/lib/vedeu/cursors/cursor_test.rb +1 -1
  131. data/test/lib/vedeu/dsl/composition_test.rb +0 -6
  132. data/test/lib/vedeu/dsl/dsl_test.rb +1 -0
  133. data/test/lib/vedeu/dsl/interface_test.rb +0 -6
  134. data/test/lib/vedeu/dsl/keymap_test.rb +0 -5
  135. data/test/lib/vedeu/dsl/line_test.rb +0 -7
  136. data/test/lib/vedeu/dsl/stream_test.rb +0 -7
  137. data/test/lib/vedeu/editor/cursor_test.rb +23 -8
  138. data/test/lib/vedeu/editor/document_test.rb +27 -23
  139. data/test/lib/vedeu/editor/line_test.rb +0 -30
  140. data/test/lib/vedeu/geometry/dsl_test.rb +0 -5
  141. data/test/lib/vedeu/geometry/null_test.rb +0 -30
  142. data/test/lib/vedeu/groups/dsl_test.rb +0 -6
  143. data/test/lib/vedeu/groups/group_test.rb +15 -7
  144. data/test/lib/vedeu/menus/dsl_test.rb +0 -5
  145. data/test/lib/vedeu/models/cell_test.rb +4 -0
  146. data/test/lib/vedeu/models/escape_test.rb +4 -0
  147. data/test/lib/vedeu/models/views/char_test.rb +4 -0
  148. data/test/lib/vedeu/null/generic_test.rb +13 -0
  149. data/test/lib/vedeu/terminal/buffer_test.rb +3 -2
  150. data/test/lib/vedeu_test.rb +81 -3
  151. data/test/support/examples/borders_app.rb +1 -3
  152. data/test/support/examples/drb_app.rb +1 -3
  153. data/test/support/examples/editor_app.rb +2 -4
  154. data/test/support/examples/focus_app.rb +1 -3
  155. data/test/support/examples/hello_world.rb +1 -6
  156. data/test/support/examples/material_colours_app.rb +1 -3
  157. data/test/support/examples/view_templates_app/view_templates_app.rb +1 -3
  158. data/test/support/helpers/model_test_class.rb +1 -5
  159. data/test/support/who.rb +29 -0
  160. data/test/test_helper.rb +0 -1
  161. metadata +5 -17
  162. data/lib/vedeu/api/all.rb +0 -15
  163. data/lib/vedeu/api/external.rb +0 -194
  164. data/lib/vedeu/api/internal.rb +0 -177
  165. data/test/lib/vedeu/api/external_test.rb +0 -74
  166. data/test/lib/vedeu/api/internal_test.rb +0 -33
  167. data/test/support/examples/typed_commands/command.erb +0 -1
  168. data/test/support/examples/typed_commands/output.erb +0 -1
  169. data/test/support/examples/typed_commands/status.erb +0 -1
  170. data/test/support/examples/typed_commands/typed_commands_app.rb +0 -94
@@ -38,19 +38,19 @@ module Vedeu
38
38
  # items for your users to select; and provide interactivity
39
39
  # within your application.
40
40
  #
41
- # @param name [String]
41
+ # @param name [String|Symbol]
42
42
  # @param block [Proc] A set of attributes which define the
43
43
  # features of the menu. See {Vedeu::Menus::DSL#items} and
44
44
  # {Vedeu::Menus::DSL#name}.
45
45
  #
46
46
  # @example
47
- # Vedeu.menu 'my_interface' do
47
+ # Vedeu.menu :my_interface do
48
48
  # items [:item_1, :item_2, :item_3]
49
49
  # # ...
50
50
  # end
51
51
  #
52
52
  # Vedeu.menu do
53
- # name 'menus_must_have_a_name'
53
+ # name :menus_must_have_a_name
54
54
  # items Track.all_my_favourites
55
55
  # # ...
56
56
  # end
@@ -67,7 +67,7 @@ module Vedeu
67
67
  #
68
68
  # @param attributes [Hash]
69
69
  # @option attributes collection [Array]
70
- # @option attributes name [String]
70
+ # @option attributes name [String|Symbol]
71
71
  # @option attributes current [Fixnum]
72
72
  # @option attributes selected [Fixnum|NilClass]
73
73
  # @return [Vedeu::Menus::Menu]
@@ -228,4 +228,8 @@ module Vedeu
228
228
 
229
229
  end # Menus
230
230
 
231
+ # @!method menu
232
+ # @see Vedeu::Menus::Menu.menu
233
+ def_delegators Vedeu::Menus::Menu, :menu
234
+
231
235
  end # Vedeu
@@ -9,7 +9,7 @@ module Vedeu
9
9
  # Returns an instance of the Vedeu::Menus::Null class.
10
10
  #
11
11
  # @param attributes [Hash<Symbol => void>]
12
- # @option attributes name [String|NilClass]
12
+ # @option attributes name [String|Symbol|NilClass]
13
13
  # @return [Vedeu::Menus::Null]
14
14
  def initialize(attributes = {})
15
15
  @attributes = attributes
@@ -15,4 +15,13 @@ module Vedeu
15
15
 
16
16
  end # Menus
17
17
 
18
+ # Manipulate the repository of menus.
19
+ #
20
+ # @example
21
+ # Vedeu.menus
22
+ #
23
+ # @!method menus
24
+ # @return [Vedeu::Menus::Repository]
25
+ def_delegators Vedeu::Menus::Repository, :menus
26
+
18
27
  end # Vedeu
@@ -34,6 +34,11 @@ module Vedeu
34
34
  end
35
35
  end
36
36
 
37
+ # @return [Boolean]
38
+ def cell?
39
+ true
40
+ end
41
+
37
42
  # An object is equal when its values are the same.
38
43
  #
39
44
  # @param other [Vedeu::Models::Cell]
@@ -23,6 +23,11 @@ module Vedeu
23
23
  end
24
24
  end
25
25
 
26
+ # @return [Boolean]
27
+ def cell?
28
+ false
29
+ end
30
+
26
31
  # @return [NilClass]
27
32
  def null
28
33
  nil
@@ -23,7 +23,7 @@ module Vedeu
23
23
  # Add an interface name to the focus list unless it is already
24
24
  # registered.
25
25
  #
26
- # @param name [String] The name of the interface.
26
+ # @param name [String|Symbol] The name of the interface.
27
27
  # @param focus [Boolean] When true, prepends the interface name
28
28
  # to the collection, making that interface the currently
29
29
  # focussed interface.
@@ -55,10 +55,12 @@ module Vedeu
55
55
  # Vedeu.trigger(:_focus_by_name_, name)
56
56
  # Vedeu.focus_by_name('name')
57
57
  #
58
- # @param name [String] The interface to focus; must be defined.
58
+ # @param name [String|Symbol] The interface to focus; must be
59
+ # defined.
59
60
  # @raise [Vedeu::Error::ModelNotFound] When the interface cannot
60
61
  # be found.
61
- # @return [String] The name of the interface now in focus.
62
+ # @return [String|Symbol] The name of the interface now in
63
+ # focus.
62
64
  def by_name(name)
63
65
  unless registered?(name)
64
66
  fail Vedeu::Error::ModelNotFound,
@@ -89,7 +91,7 @@ module Vedeu
89
91
  # @example
90
92
  # Vedeu.focussed?(name)
91
93
  #
92
- # @param name [String]
94
+ # @param name [String|Symbol]
93
95
  # @return [Boolean]
94
96
  def current?(name)
95
97
  current == name
@@ -186,7 +188,7 @@ module Vedeu
186
188
  # Returns a boolean indicating whether the named model is
187
189
  # registered.
188
190
  #
189
- # @param name [String]
191
+ # @param name [String|Symbol]
190
192
  # @return [Boolean]
191
193
  def registered?(name)
192
194
  return false if empty?
@@ -242,4 +244,17 @@ module Vedeu
242
244
 
243
245
  end # Models
244
246
 
247
+ # @!method focus
248
+ # @see Vedeu::Models::Focus#focus
249
+ # @!method focus_by_name
250
+ # @see Vedeu::Models::Focus#focus_by_name
251
+ # @!method focussed?
252
+ # @see Vedeu::Models::Focus#focussed?
253
+ # @!method focus_next
254
+ # @see Vedeu::Models::Focus#focus_next
255
+ # @!method focus_previous
256
+ # @see Vedeu::Models::Focus#focus_previous
257
+ def_delegators Vedeu::Models::Focus, :focus, :focus_by_name, :focussed?,
258
+ :focus_next, :focus_previous
259
+
245
260
  end # Vedeu
@@ -46,7 +46,7 @@ module Vedeu
46
46
  # @option attributes colour [Vedeu::Colours::Colour]
47
47
  # @option attributes delay [Float]
48
48
  # @option attributes group [String]
49
- # @option attributes name [String]
49
+ # @option attributes name [String|Symbol]
50
50
  # @option attributes parent [Vedeu::Views::Composition]
51
51
  # @option attributes repository [Vedeu::Models::Interfaces]
52
52
  # @option attributes style [Vedeu::Presentation::Style]
@@ -112,4 +112,13 @@ module Vedeu
112
112
 
113
113
  end # Models
114
114
 
115
+ # @!method hide_interface
116
+ # @see Vedeu::Toggleable::ClassMethods#hide
117
+ # @!method show_interface
118
+ # @see Vedeu::Toggleable::ClassMethods#show
119
+ # @!method toggle_interface
120
+ # @see Vedeu::Toggleable::ClassMethods#toggle
121
+ def_delegators Vedeu::Models::Interface, :hide_interface, :show_interface,
122
+ :toggle_interface
123
+
115
124
  end # Vedeu
@@ -32,4 +32,13 @@ module Vedeu
32
32
 
33
33
  end # Models
34
34
 
35
+ # Manipulate the repository of interfaces.
36
+ #
37
+ # @example
38
+ # Vedeu.interfaces
39
+ #
40
+ # @!method interfaces
41
+ # @return [Vedeu::Models::Interfaces]
42
+ def_delegators Vedeu::Models::Interfaces, :interfaces
43
+
35
44
  end # Vedeu
@@ -48,7 +48,12 @@ module Vedeu
48
48
 
49
49
  # Hides the model.
50
50
  #
51
- # @param name [String]
51
+ # @example
52
+ # Vedeu.hide_cursor(name)
53
+ # Vedeu.hide_group(name)
54
+ # Vedeu.hide_interface(name)
55
+ #
56
+ # @param name [String|Symbol]
52
57
  # @return [void]
53
58
  def hide(name = nil)
54
59
  model_by_name(repository, name).hide
@@ -59,7 +64,12 @@ module Vedeu
59
64
 
60
65
  # Shows the model.
61
66
  #
62
- # @param name [String]
67
+ # @example
68
+ # Vedeu.show_cursor(name)
69
+ # Vedeu.show_group(name)
70
+ # Vedeu.show_interface(name)
71
+ #
72
+ # @param name [String|Symbol]
63
73
  # @return [void]
64
74
  def show(name = nil)
65
75
  model_by_name(repository, name).show
@@ -70,7 +80,12 @@ module Vedeu
70
80
 
71
81
  # Toggles the visibility of the model.
72
82
  #
73
- # @param name [String]
83
+ # @example
84
+ # Vedeu.toggle_cursor(name)
85
+ # Vedeu.toggle_group(name)
86
+ # Vedeu.toggle_interface(name)
87
+ #
88
+ # @param name [String|Symbol]
74
89
  # @return [void]
75
90
  def toggle(name = nil)
76
91
  model_by_name(repository, name).toggle
@@ -83,7 +98,7 @@ module Vedeu
83
98
 
84
99
  # Fetch the model by name.
85
100
  #
86
- # @param name [String]
101
+ # @param name [String|Symbol]
87
102
  # @param klass [void] The repository of the model.
88
103
  # @return [void]
89
104
  def model_by_name(klass, name = nil)
@@ -56,6 +56,11 @@ module Vedeu
56
56
  @value = @attributes[:value]
57
57
  end
58
58
 
59
+ # @return [Boolean]
60
+ def cell?
61
+ false
62
+ end
63
+
59
64
  # When {Vedeu::Output::Viewport#show} has less lines that
60
65
  # required to fill the visible area of the interface, it creates
61
66
  # a line that contains a single {Vedeu::Views::Char} containing
@@ -159,7 +164,7 @@ module Vedeu
159
164
  }
160
165
  end
161
166
 
162
- # @return [Has<Symbol => Fixnum>]
167
+ # @return [Hash<Symbol => Fixnum>]
163
168
  def position_to_hash
164
169
  {
165
170
  y: y,
@@ -9,10 +9,7 @@ module Vedeu
9
9
 
10
10
  include Vedeu::Common
11
11
 
12
- # @param char [Vedeu::Views::Char]
13
- # @param options [Hash<Symbol => String>]
14
- # @option options start_tag [String]
15
- # @option options end_tag [String]
12
+ # @param (see #initialize)
16
13
  # @return [String]
17
14
  def self.render(char, options = {})
18
15
  new(char, options).render
@@ -90,7 +90,7 @@ module Vedeu
90
90
 
91
91
  # The default values for a new instance of this class.
92
92
  #
93
- # @return [Hash]
93
+ # @return [Hash<Symbol => void>]
94
94
  def defaults
95
95
  {
96
96
  client: nil,
@@ -50,7 +50,7 @@ module Vedeu
50
50
  # @option attributes client [Vedeu::Client]
51
51
  # @option attributes colour [Vedeu::Colours::Colour]
52
52
  # @option attributes value [Vedeu::Views::Lines]
53
- # @option attributes name [String]
53
+ # @option attributes name [String|Symbol]
54
54
  # @option attributes parent [Vedeu::Views::Composition]
55
55
  # @option attributes style [Vedeu::Presentation::Style]
56
56
  # @option attributes zindex [Fixnum]
@@ -11,25 +11,36 @@ module Vedeu
11
11
  attr_reader :attributes
12
12
 
13
13
  # @!attribute [r] name
14
- # @return [String]
14
+ # @return [String|Symbol]
15
15
  attr_reader :name
16
16
 
17
17
  # Returns an instance of the Vedeu::Null::Generic class.
18
18
  #
19
19
  # @param attributes [Hash<Symbol => void>]
20
- # @option attributes name [String|NilClass]
20
+ # @option attributes name [String|Symbol|NilClass]
21
21
  # @return [Vedeu::Null::Generic]
22
22
  def initialize(attributes = {})
23
23
  @attributes = attributes
24
24
  @name = @attributes[:name]
25
25
  end
26
26
 
27
+ # @return [FalseClass]
28
+ def falsy
29
+ false
30
+ end
31
+ alias_method :centred, :falsy
32
+ alias_method :enabled?, :falsy
33
+ alias_method :maximise, :falsy
34
+ alias_method :maximised?, :falsy
35
+ alias_method :unmaximise, :falsy
36
+
27
37
  # @return [NilClass]
28
38
  def null(*)
29
39
  nil
30
40
  end
31
41
  alias_method :add, :null
32
42
  alias_method :bottom_item, :null
43
+ alias_method :clear, :null
33
44
  alias_method :colour, :null
34
45
  alias_method :current_item, :null
35
46
  alias_method :deselect_item, :null
@@ -39,6 +50,7 @@ module Vedeu
39
50
  alias_method :next_item, :null
40
51
  alias_method :parent, :null
41
52
  alias_method :prev_item, :null
53
+ alias_method :render, :null
42
54
  alias_method :select_item, :null
43
55
  alias_method :selected_item, :null
44
56
  alias_method :show, :null
@@ -15,7 +15,7 @@ module Vedeu
15
15
  # Returns a new instance of Vedeu::Null::Interface.
16
16
  #
17
17
  # @param attributes [Hash<Symbol => void>]
18
- # @option attributes name [String]
18
+ # @option attributes name [String|Symbol]
19
19
  # @return [Vedeu::Null::Interface]
20
20
  def initialize(attributes = {})
21
21
  @attributes = attributes
@@ -11,7 +11,7 @@ module Vedeu
11
11
  # Returns a new instance of Vedeu::Null::View.
12
12
  #
13
13
  # @param attributes [Hash<Symbol => void>]
14
- # @option attributes name [String]
14
+ # @option attributes name [String|Symbol]
15
15
  # @return [Vedeu::Null::View]
16
16
  def initialize(attributes = {})
17
17
  @attributes = attributes
@@ -25,7 +25,7 @@ module Vedeu
25
25
 
26
26
  # Return a new instance of Vedeu::Clear::Interface.
27
27
  #
28
- # @param name [String] The name of the interface to clear.
28
+ # @param name [String|Symbol] The name of the interface to clear.
29
29
  # @return [Vedeu::Clear::Interface]
30
30
  def initialize(name)
31
31
  @name = name
@@ -82,4 +82,8 @@ module Vedeu
82
82
 
83
83
  end # Clear
84
84
 
85
+ # @!method clear_by_name
86
+ # @see Vedeu::Clear::Interface.render
87
+ def_delegators Vedeu::Clear::Interface, :clear_by_name
88
+
85
89
  end # Vedeu
@@ -9,7 +9,9 @@ module Vedeu
9
9
  #
10
10
  class Compressor
11
11
 
12
- # @param output [Array<Array<Vedeu::Views::Char>>]
12
+ include Vedeu::Common
13
+
14
+ # @param (see #initialize)
13
15
  # @return [String]
14
16
  def self.render(output)
15
17
  new(output).render
@@ -44,9 +46,9 @@ module Vedeu
44
46
 
45
47
  # @return [Array]
46
48
  def content
47
- return [] if output.nil? || output.empty?
49
+ return [] if absent?(output)
48
50
 
49
- output.content.delete_if { |cell| cell.is_a?(Vedeu::Models::Cell) }
51
+ @content ||= output.content.delete_if(&:cell?)
50
52
  end
51
53
 
52
54
  # @return [String]
@@ -69,7 +71,9 @@ module Vedeu
69
71
  def uncompress
70
72
  out = ''
71
73
 
72
- content.each { |cell| out << cell.to_s }
74
+ content.each do |cell|
75
+ out << cell.to_s
76
+ end
73
77
 
74
78
  out
75
79
  end
@@ -6,9 +6,7 @@ module Vedeu
6
6
  #
7
7
  class Direct
8
8
 
9
- # @param value [String]
10
- # @param x [Fixnum]
11
- # @param y [Fixnum]
9
+ # @param (see #initialize)
12
10
  # @return [String]
13
11
  def self.write(value:, x:, y:)
14
12
  new(value: value, x: x, y: y).write
@@ -28,6 +26,8 @@ module Vedeu
28
26
 
29
27
  # @return [String]
30
28
  def write
29
+ Vedeu.log(type: :output,
30
+ message: 'Directly writing output to terminal.')
31
31
  Vedeu::Terminal.output(output)
32
32
 
33
33
  output
@@ -51,7 +51,7 @@ module Vedeu
51
51
 
52
52
  # @return [String]
53
53
  def output
54
- (Array(position) + Array(value)).join
54
+ @output ||= (Array(position) + Array(value)).join
55
55
  end
56
56
 
57
57
  # @return [String]
@@ -0,0 +1,15 @@
1
+ require 'vedeu/output/presentation/colour'
2
+ require 'vedeu/output/presentation/styles'
3
+ require 'vedeu/output/presentation/style'
4
+ require 'vedeu/output/presentation/presentation'
5
+
6
+ module Vedeu
7
+
8
+ # This module allows the sharing of presentation concerns between
9
+ # the models: Interface, View, Line and Stream.
10
+ #
11
+ module Presentation
12
+
13
+ end # Presentation
14
+
15
+ end # Vedeu