vedeu 0.8.10 → 0.8.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (209) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +0 -1
  3. data/docs/api.md +1 -1
  4. data/docs/dsl/by_method/add_command.md +1 -0
  5. data/docs/dsl/by_method/add_keypress.md +1 -0
  6. data/docs/dsl/by_method/all_commands.md +1 -0
  7. data/docs/dsl/by_method/all_keypresses.md +1 -0
  8. data/docs/dsl/by_method/background_colours.md +1 -0
  9. data/docs/dsl/by_method/bind.md +1 -0
  10. data/docs/dsl/by_method/bind_alias.md +1 -0
  11. data/docs/dsl/by_method/borders.md +1 -0
  12. data/docs/dsl/by_method/bottom.md +1 -0
  13. data/docs/dsl/by_method/bottom_horizontal.md +1 -0
  14. data/docs/dsl/by_method/bottom_left.md +1 -0
  15. data/docs/dsl/by_method/bottom_right.md +1 -0
  16. data/docs/dsl/by_method/bound.md +1 -0
  17. data/docs/dsl/by_method/buffer_update.md +4 -1
  18. data/docs/dsl/by_method/buffer_write.md +5 -1
  19. data/docs/dsl/by_method/buffers.md +1 -0
  20. data/docs/dsl/by_method/caption.md +1 -0
  21. data/docs/dsl/by_method/clear.md +1 -0
  22. data/docs/dsl/by_method/clear_by_group.md +1 -0
  23. data/docs/dsl/by_method/clear_by_name.md +1 -0
  24. data/docs/dsl/by_method/clear_content_by_name.md +1 -0
  25. data/docs/dsl/by_method/configuration.md +1 -0
  26. data/docs/dsl/by_method/configure.md +1 -0
  27. data/docs/dsl/by_method/cursor.md +1 -0
  28. data/docs/dsl/by_method/cursors.md +1 -0
  29. data/docs/dsl/by_method/debug.md +1 -0
  30. data/docs/dsl/by_method/direct_write.md +6 -1
  31. data/docs/dsl/by_method/disable.md +1 -0
  32. data/docs/dsl/by_method/documents.md +1 -0
  33. data/docs/dsl/by_method/drb_restart.md +1 -0
  34. data/docs/dsl/by_method/drb_start.md +1 -0
  35. data/docs/dsl/by_method/drb_status.md +1 -0
  36. data/docs/dsl/by_method/drb_stop.md +1 -0
  37. data/docs/dsl/by_method/enable.md +1 -0
  38. data/docs/dsl/by_method/esc.md +50 -0
  39. data/docs/dsl/by_method/events.md +1 -0
  40. data/docs/dsl/by_method/exit.md +1 -0
  41. data/docs/dsl/by_method/focus.md +1 -0
  42. data/docs/dsl/by_method/focus_by_name.md +1 -0
  43. data/docs/dsl/by_method/focus_next.md +1 -0
  44. data/docs/dsl/by_method/focus_previous.md +1 -0
  45. data/docs/dsl/by_method/focussed.md +1 -0
  46. data/docs/dsl/by_method/foreground_colours.md +1 -0
  47. data/docs/dsl/by_method/geometries.md +1 -0
  48. data/docs/dsl/by_method/geometry.md +1 -0
  49. data/docs/dsl/by_method/goto.md +1 -0
  50. data/docs/dsl/by_method/group.md +1 -0
  51. data/docs/dsl/by_method/groups.md +1 -0
  52. data/docs/dsl/by_method/height.md +1 -0
  53. data/docs/dsl/by_method/hide_cursor.md +1 -0
  54. data/docs/dsl/by_method/hide_group.md +1 -0
  55. data/docs/dsl/by_method/hide_interface.md +1 -0
  56. data/docs/dsl/by_method/horizontal.md +1 -0
  57. data/docs/dsl/by_method/interface.md +1 -0
  58. data/docs/dsl/by_method/interfaces.md +1 -0
  59. data/docs/dsl/by_method/keymap.md +1 -0
  60. data/docs/dsl/by_method/keymaps.md +1 -0
  61. data/docs/dsl/by_method/keypress.md +2 -0
  62. data/docs/dsl/by_method/last_command.md +1 -0
  63. data/docs/dsl/by_method/last_keypress.md +1 -0
  64. data/docs/dsl/by_method/left.md +1 -0
  65. data/docs/dsl/by_method/left_vertical.md +1 -0
  66. data/docs/dsl/by_method/log.md +1 -0
  67. data/docs/dsl/by_method/log_stderr.md +1 -0
  68. data/docs/dsl/by_method/log_stdout.md +1 -0
  69. data/docs/dsl/by_method/log_timestamp.md +1 -0
  70. data/docs/dsl/by_method/menu.md +1 -0
  71. data/docs/dsl/by_method/menus.md +1 -0
  72. data/docs/dsl/by_method/profile.md +1 -0
  73. data/docs/dsl/by_method/ready.md +1 -0
  74. data/docs/dsl/by_method/refresh.md +1 -0
  75. data/docs/dsl/by_method/render_output.md +5 -1
  76. data/docs/dsl/by_method/renderer.md +1 -0
  77. data/docs/dsl/by_method/renderers.md +1 -0
  78. data/docs/dsl/by_method/resize.md +1 -0
  79. data/docs/dsl/by_method/right.md +1 -0
  80. data/docs/dsl/by_method/right_vertical.md +1 -0
  81. data/docs/dsl/by_method/show_cursor.md +1 -0
  82. data/docs/dsl/by_method/show_group.md +1 -0
  83. data/docs/dsl/by_method/show_interface.md +1 -0
  84. data/docs/dsl/by_method/timer.md +1 -0
  85. data/docs/dsl/by_method/title.md +1 -0
  86. data/docs/dsl/by_method/toggle_cursor.md +1 -0
  87. data/docs/dsl/by_method/toggle_group.md +1 -0
  88. data/docs/dsl/by_method/toggle_interface.md +1 -0
  89. data/docs/dsl/by_method/top.md +1 -0
  90. data/docs/dsl/by_method/top_horizontal.md +1 -0
  91. data/docs/dsl/by_method/top_left.md +1 -0
  92. data/docs/dsl/by_method/top_right.md +1 -0
  93. data/docs/dsl/by_method/trigger.md +1 -0
  94. data/docs/dsl/by_method/unbind.md +1 -0
  95. data/docs/dsl/by_method/unbind_alias.md +1 -0
  96. data/docs/dsl/by_method/vertical.md +1 -0
  97. data/docs/dsl/by_method/width.md +1 -0
  98. data/docs/dsl/by_method/write.md +1 -0
  99. data/docs/dsl_elements.md +107 -100
  100. data/examples/dsl_alignment.rb +1 -1
  101. data/examples/dsl_colours.rb +1 -1
  102. data/examples/dsl_editor.rb +1 -1
  103. data/examples/dsl_horizontal_alignment.rb +1 -1
  104. data/examples/dsl_vertical_alignment.rb +1 -1
  105. data/examples/views/misc_view.rb +1 -1
  106. data/lib/vedeu/application/application_controller.rb +2 -0
  107. data/lib/vedeu/application/application_view.rb +2 -0
  108. data/lib/vedeu/borders/dsl.rb +1 -0
  109. data/lib/vedeu/borders/repository.rb +1 -0
  110. data/lib/vedeu/buffers/empty.rb +1 -0
  111. data/lib/vedeu/buffers/repository.rb +1 -0
  112. data/lib/vedeu/buffers/terminal.rb +3 -1
  113. data/lib/vedeu/cells/border.rb +0 -5
  114. data/lib/vedeu/cells/char.rb +0 -5
  115. data/lib/vedeu/cells/clear.rb +0 -5
  116. data/lib/vedeu/cells/cursor.rb +0 -5
  117. data/lib/vedeu/cells/empty.rb +0 -5
  118. data/lib/vedeu/cells/escape.rb +0 -5
  119. data/lib/vedeu/cells/support/html.rb +2 -0
  120. data/lib/vedeu/colours/backgrounds.rb +1 -0
  121. data/lib/vedeu/colours/foregrounds.rb +1 -0
  122. data/lib/vedeu/common.rb +0 -9
  123. data/lib/vedeu/configuration/configuration.rb +5 -0
  124. data/lib/vedeu/cursors/cursor.rb +3 -0
  125. data/lib/vedeu/cursors/repository.rb +2 -0
  126. data/lib/vedeu/distributed/server.rb +4 -0
  127. data/lib/vedeu/dsl/helpers/attributes.rb +4 -0
  128. data/lib/vedeu/dsl/views.rb +3 -0
  129. data/lib/vedeu/editor/repository.rb +1 -0
  130. data/lib/vedeu/esc/background.rb +2 -0
  131. data/lib/vedeu/esc/foreground.rb +2 -0
  132. data/lib/vedeu/events/aliases.rb +2 -0
  133. data/lib/vedeu/events/all.rb +1 -1
  134. data/lib/vedeu/events/event.rb +4 -1
  135. data/lib/vedeu/events/{collection.rb → events.rb} +3 -2
  136. data/lib/vedeu/events/repository.rb +4 -1
  137. data/lib/vedeu/events/trigger.rb +3 -0
  138. data/lib/vedeu/geometries/dsl/dsl.rb +1 -0
  139. data/lib/vedeu/geometries/repository.rb +1 -0
  140. data/lib/vedeu/groups/clear.rb +1 -0
  141. data/lib/vedeu/groups/dsl.rb +1 -0
  142. data/lib/vedeu/groups/group.rb +3 -0
  143. data/lib/vedeu/groups/repository.rb +1 -0
  144. data/lib/vedeu/input/capture.rb +1 -1
  145. data/lib/vedeu/input/dsl.rb +1 -0
  146. data/lib/vedeu/input/mapper.rb +1 -0
  147. data/lib/vedeu/input/read.rb +1 -0
  148. data/lib/vedeu/input/repository.rb +1 -0
  149. data/lib/vedeu/input/store.rb +6 -0
  150. data/lib/vedeu/interfaces/clear.rb +3 -1
  151. data/lib/vedeu/interfaces/dsl.rb +1 -0
  152. data/lib/vedeu/interfaces/interface.rb +3 -0
  153. data/lib/vedeu/interfaces/repository.rb +1 -0
  154. data/lib/vedeu/logging/clock_time.rb +1 -0
  155. data/lib/vedeu/logging/debug.rb +2 -0
  156. data/lib/vedeu/logging/log.rb +4 -0
  157. data/lib/vedeu/logging/timer.rb +1 -0
  158. data/lib/vedeu/menus/menu.rb +1 -0
  159. data/lib/vedeu/menus/repository.rb +1 -0
  160. data/lib/vedeu/models/focus.rb +6 -0
  161. data/lib/vedeu/output/all.rb +1 -0
  162. data/lib/vedeu/output/compressor.rb +17 -104
  163. data/lib/vedeu/output/compressor_cache.rb +43 -20
  164. data/lib/vedeu/output/compressors/all.rb +26 -0
  165. data/lib/vedeu/output/compressors/character.rb +105 -0
  166. data/lib/vedeu/output/compressors/simple.rb +67 -0
  167. data/lib/vedeu/output/output.rb +30 -24
  168. data/lib/vedeu/output/write.rb +1 -0
  169. data/lib/vedeu/renderers/all.rb +1 -0
  170. data/lib/vedeu/renderers/options.rb +1 -1
  171. data/lib/vedeu/renderers/terminal.rb +8 -7
  172. data/lib/vedeu/repositories/storage.rb +2 -0
  173. data/lib/vedeu/runtime/application.rb +15 -2
  174. data/lib/vedeu/runtime/flags.rb +4 -0
  175. data/lib/vedeu/runtime/router.rb +1 -0
  176. data/lib/vedeu/sentence.rb +2 -0
  177. data/lib/vedeu/support/point.rb +2 -0
  178. data/lib/vedeu/terminal/terminal.rb +1 -0
  179. data/lib/vedeu/version.rb +1 -1
  180. data/lib/vedeu/views/all.rb +2 -0
  181. data/lib/vedeu/views/composition.rb +5 -1
  182. data/lib/vedeu/views/line.rb +2 -0
  183. data/lib/vedeu/views/stream.rb +2 -0
  184. data/lib/vedeu/views/view.rb +3 -1
  185. data/test/lib/vedeu/cells/border_test.rb +0 -6
  186. data/test/lib/vedeu/cells/char_test.rb +0 -6
  187. data/test/lib/vedeu/cells/clear_test.rb +0 -6
  188. data/test/lib/vedeu/cells/cursor_test.rb +0 -4
  189. data/test/lib/vedeu/cells/empty_test.rb +0 -6
  190. data/test/lib/vedeu/cells/escape_test.rb +0 -4
  191. data/test/lib/vedeu/common_test.rb +0 -10
  192. data/test/lib/vedeu/events/{collection_test.rb → events_test.rb} +3 -3
  193. data/test/lib/vedeu/events/repository_test.rb +1 -1
  194. data/test/lib/vedeu/output/compressor_cache_test.rb +87 -63
  195. data/test/lib/vedeu/output/compressor_test.rb +31 -8
  196. data/test/lib/vedeu/output/compressors/character_test.rb +40 -0
  197. data/test/lib/vedeu/output/compressors/simple_test.rb +42 -0
  198. data/test/lib/vedeu/repositories/storage_test.rb +2 -0
  199. data/test/lib/vedeu/sentence_test.rb +2 -0
  200. data/test/lib/vedeu/support/point_test.rb +2 -0
  201. data/test/support/coverage.rb +2 -0
  202. data/test/support/examples/drb_app.rb +2 -0
  203. data/test/support/examples/focus_app.rb +2 -0
  204. data/test/support/examples/hello_world.rb +2 -0
  205. data/test/support/examples/material_colours_app.rb +7 -4
  206. data/test/support/examples/view_templates_app/view_templates_app.rb +2 -0
  207. data/test/support/ttyrec.rb +2 -0
  208. data/test/support/who.rb +2 -0
  209. metadata +13 -5
@@ -0,0 +1,105 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vedeu
4
+
5
+ module Output
6
+
7
+ module Compressors
8
+
9
+ # A simple character based compressor which compressed based on
10
+ # the previous character's attributes.
11
+ #
12
+ # @api private
13
+ #
14
+ class Character
15
+
16
+ # @param (see #initialize)
17
+ # @return (see #with)
18
+ def self.with(content)
19
+ new(content).with
20
+ end
21
+
22
+ # @param content [Array<void>]
23
+ # @return [Vedeu::Output::Compressors::Character]
24
+ def initialize(content)
25
+ @content = content
26
+ @colour = ''
27
+ @style = ''
28
+ end
29
+
30
+ # @return [String]
31
+ def with
32
+ @same = ''
33
+ @compress ||= Vedeu.timer(message) do
34
+ content.map do |cell|
35
+ rendered = [
36
+ cell.position.to_s,
37
+ colour_for(cell),
38
+ style_for(cell),
39
+ cell.value,
40
+ ].join
41
+
42
+ if @same == rendered
43
+ next
44
+
45
+ else
46
+ @same = rendered
47
+ @same
48
+
49
+ end
50
+ end.join.tap do |out|
51
+ Vedeu.log(type: :compress,
52
+ message: "#{message} -> #{out.size} characters")
53
+ end
54
+ end
55
+ end
56
+
57
+ protected
58
+
59
+ # @!attribute [r] content
60
+ # @return [void]
61
+ attr_reader :content
62
+
63
+ # Compress by not repeatedly sending the same colours for each
64
+ # character which has the same colours as the last character
65
+ # output.
66
+ #
67
+ # @param char [Vedeu::Cells::Char]
68
+ # @return [String]
69
+ def colour_for(char)
70
+ return '' if char.colour == @colour
71
+
72
+ @colour = char.colour
73
+ @colour.to_s
74
+ end
75
+
76
+ # @return [String]
77
+ def message
78
+ "Compression for #{original_size} objects"
79
+ end
80
+
81
+ # @return [Fixnum]
82
+ def original_size
83
+ content.size
84
+ end
85
+
86
+ # Compress by not repeatedly sending the same style(s) for each
87
+ # character which has the same style(s) as the last character
88
+ # output.
89
+ #
90
+ # @param char [Vedeu::Cells::Char]
91
+ # @return [String]
92
+ def style_for(char)
93
+ return '' if char.style == @style
94
+
95
+ @style = char.style
96
+ @style.to_s
97
+ end
98
+
99
+ end # Character
100
+
101
+ end # Compressors
102
+
103
+ end # Output
104
+
105
+ end # Vedeu
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Vedeu
4
+
5
+ module Output
6
+
7
+ module Compressors
8
+
9
+ # A simple compressor which does not compress- it converts each
10
+ # buffer object into a string and returns the resulting blob of
11
+ # text.
12
+ #
13
+ # @api private
14
+ #
15
+ class Simple
16
+
17
+ # @param (see #initialize)
18
+ # @return (see #with)
19
+ def self.with(content)
20
+ new(content).with
21
+ end
22
+
23
+ # @param content [Array<void>]
24
+ # @return [Vedeu::Output::Compressors::Simple]
25
+ def initialize(content)
26
+ @content = content
27
+ end
28
+
29
+ # @return [String]
30
+ def with
31
+ Vedeu.log(type: :compress,
32
+ message: "No compression for #{original_size} objects -> " \
33
+ "#{compress_size} characters")
34
+
35
+ compress
36
+ end
37
+
38
+ protected
39
+
40
+ # @!attribute [r] content
41
+ # @return [void]
42
+ attr_reader :content
43
+
44
+ private
45
+
46
+ # @return [String]
47
+ def compress
48
+ @_compress ||= content.map(&:to_s).join
49
+ end
50
+
51
+ # @return [Fixnum]
52
+ def compress_size
53
+ compress.size
54
+ end
55
+
56
+ # @return [Fixnum]
57
+ def original_size
58
+ content.size
59
+ end
60
+
61
+ end # Simple
62
+
63
+ end # Compressors
64
+
65
+ end # Output
66
+
67
+ end # Vedeu
@@ -14,28 +14,28 @@ module Vedeu
14
14
 
15
15
  class << self
16
16
 
17
- # @param (see #output)
18
- # @return (see #buffer_update)
17
+ # @param (see Vedeu::Output::Output#initialize)
18
+ # @return (see Vedeu::Output::Output#buffer_update)
19
19
  def buffer_update(output)
20
20
  new(output).buffer_update
21
21
  end
22
22
 
23
- # @param (see #output)
24
- # @return (see #buffer_write)
23
+ # @param (see Vedeu::Output::Output#initialize)
24
+ # @return (see Vedeu::Output::Output#buffer_write)
25
25
  def buffer_write(output)
26
26
  new(output).buffer_write
27
27
  end
28
28
 
29
- # @param (see #output)
30
- # @return (see #direct_write)
29
+ # @param (see Vedeu::Output::Output#initialize)
30
+ # @return (see Vedeu::Output::Output#direct_write)
31
31
  def direct_write(output)
32
32
  new(output).direct_write
33
33
  end
34
34
 
35
- # Writes output to the defined renderers.
35
+ # {include:file:docs/dsl/by_method/render_output.md}
36
36
  #
37
- # @param (see #output)
38
- # @return (see #render_output)
37
+ # @param (see Vedeu::Output::Output#initialize)
38
+ # @return (see Vedeu::Output::Output#render_output)
39
39
  def render_output(output)
40
40
  new(output).render_output
41
41
  end
@@ -44,7 +44,7 @@ module Vedeu
44
44
 
45
45
  # Return a new instance of Vedeu::Output::Output.
46
46
  #
47
- # @param (see #output)
47
+ # @param output [String]
48
48
  # @return [Vedeu::Output::Output]
49
49
  def initialize(output)
50
50
  @output = output
@@ -73,6 +73,8 @@ module Vedeu
73
73
  # not other renderers.
74
74
  #
75
75
  # @return [Array<String>|String|NilClass]
76
+ # @see #buffer_write
77
+ # @see #direct_write
76
78
  def render_output
77
79
  if escape?(output)
78
80
  direct_write
@@ -94,20 +96,24 @@ module Vedeu
94
96
 
95
97
  end # Output
96
98
 
97
- # Write the given output to the configured or default renderers.
98
- #
99
- # @example
100
- # Vedeu.buffer_update(output)
101
- # Vedeu.buffer_write(output)
102
- # Vedeu.direct_write(output)
103
- # Vedeu.render_output(output)
104
- #
99
+ # @api public
100
+ # @!method buffer_update
101
+ # @see file:docs/dsl/by_method/buffer_update.md
102
+ def_delegators Vedeu::Output::Output, :buffer_update
103
+
104
+ # @api public
105
+ # @!method buffer_write
106
+ # @see file:docs/dsl/by_method/buffer_write.md
107
+ def_delegators Vedeu::Output::Output, :buffer_write
108
+
109
+ # @api public
110
+ # @!method direct_write
111
+ # @see file:docs/dsl/by_method/direct_write.md
112
+ def_delegators Vedeu::Output::Output, :direct_write
113
+
114
+ # @api public
105
115
  # @!method render_output
106
- # @return (see Vedeu::Output::Output#render_output)
107
- def_delegators Vedeu::Output::Output,
108
- :buffer_update,
109
- :buffer_write,
110
- :direct_write,
111
- :render_output
116
+ # @see file:docs/dsl/by_method/render_output.md
117
+ def_delegators Vedeu::Output::Output, :render_output
112
118
 
113
119
  end # Vedeu
@@ -109,6 +109,7 @@ module Vedeu
109
109
 
110
110
  end # Output
111
111
 
112
+ # @api public
112
113
  # @!method write
113
114
  # @see Vedeu::Output::Write#write
114
115
  def_delegators Vedeu::Output::Write,
@@ -124,6 +124,7 @@ module Vedeu
124
124
  # @example
125
125
  # Vedeu.renderers
126
126
  #
127
+ # @api public
127
128
  # @!method renderers
128
129
  # @see Vedeu::Renderers#renderers
129
130
  def_delegators Vedeu::Renderers,
@@ -134,7 +134,7 @@ module Vedeu
134
134
  options[:start_row_tag]
135
135
  end
136
136
 
137
- # @return [void]
137
+ # @return [Array<void>]
138
138
  def output
139
139
  options[:output]
140
140
  end
@@ -24,13 +24,7 @@ module Vedeu
24
24
  #
25
25
  # @return [String]
26
26
  def write
27
- if write_file?
28
- Vedeu::Terminal.output(write_file)
29
-
30
- else
31
- Vedeu::Terminal.output(content)
32
-
33
- end
27
+ Vedeu.direct_write(writable_data)
34
28
  end
35
29
 
36
30
  private
@@ -43,6 +37,13 @@ module Vedeu
43
37
  compression
44
38
  end
45
39
 
40
+ # @return [String]
41
+ def writable_data
42
+ return write_file if write_file?
43
+
44
+ content
45
+ end
46
+
46
47
  end # Terminal
47
48
 
48
49
  end # Renderers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Repositories
@@ -82,9 +82,13 @@ module Vedeu
82
82
  # @param block [Proc]
83
83
  # @return [void]
84
84
  def runner(&block)
85
- return yield if Vedeu.config.once?
85
+ if Vedeu.config.once?
86
+ run_once { yield }
86
87
 
87
- run_many { yield }
88
+ else
89
+ run_many { yield }
90
+
91
+ end
88
92
  end
89
93
 
90
94
  # For an interactive application we capture input, (usually from
@@ -120,12 +124,21 @@ module Vedeu
120
124
  Vedeu::Runtime::Application.restart
121
125
  end
122
126
 
127
+ # @param block [Proc]
128
+ # @return [void]
129
+ def run_once(&block)
130
+ yield.tap do
131
+ # Vedeu.debug(binding)
132
+ end
133
+ end
134
+
123
135
  # :nocov:
124
136
 
125
137
  end # Application
126
138
 
127
139
  end # Runtime
128
140
 
141
+ # @api public
129
142
  # @!method exit
130
143
  # @see Vedeu::Runtime::Application.stop
131
144
  def_delegators Vedeu::Runtime::Application,
@@ -68,8 +68,12 @@ module Vedeu
68
68
 
69
69
  # Manipulate the internal flags.
70
70
  #
71
+ # @api public
71
72
  # @!method ready?
73
+ # @see Vedeu::Runtime::Flags#ready?
74
+ # @api public
72
75
  # @!method ready!
76
+ # @see Vedeu::Runtime::Flags#ready!
73
77
  # @return [Boolean]
74
78
  def_delegators Vedeu::Runtime::Flags,
75
79
  :ready?,
@@ -170,6 +170,7 @@ module Vedeu
170
170
 
171
171
  end # Runtime
172
172
 
173
+ # @api public
173
174
  # @!method goto
174
175
  # @see Vedeu::Runtime::Router#goto
175
176
  def_delegators Vedeu::Runtime::Router,
@@ -6,6 +6,8 @@ module Vedeu
6
6
  # sentence with the penultimate and ultimate elements separated with
7
7
  # the word 'and'.
8
8
  #
9
+ # @api public
10
+ #
9
11
  class Sentence
10
12
 
11
13
  # @param (see #initialize)
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  # A `Vedeu::Point` represents part of a coordinate within the 2D
@@ -163,6 +163,7 @@ module Vedeu
163
163
 
164
164
  end # Terminal
165
165
 
166
+ # @api public
166
167
  # @!method resize
167
168
  # @see Vedeu::Terminal#resize
168
169
  def_delegators Vedeu::Terminal,
data/lib/vedeu/version.rb CHANGED
@@ -3,6 +3,6 @@
3
3
  module Vedeu
4
4
 
5
5
  # The current version of Vedeu.
6
- VERSION = '0.8.10'.freeze
6
+ VERSION = '0.8.12'.freeze
7
7
 
8
8
  end
@@ -4,6 +4,8 @@ module Vedeu
4
4
 
5
5
  # View related models.
6
6
  #
7
+ # @api mixed
8
+ #
7
9
  module Views
8
10
 
9
11
  end # Views
@@ -24,9 +24,11 @@ module Vedeu
24
24
 
25
25
  # Returns a new instance of Vedeu::Views::Composition.
26
26
  #
27
- # @param attributes [Hash]
27
+ # @param attributes [Hash<Symbol => void>]
28
28
  # @option attributes client [void]
29
29
  # @option attributes colour [Vedeu::Colours::Colour]
30
+ # @option attributes parent [NilClass] The parent of a
31
+ # Vedeu::Views::Composition should be nil.
30
32
  # @option attributes style [Vedeu::Presentation::Style]
31
33
  # @option attributes value [Vedeu::Views::Views]
32
34
  # @return [Vedeu::Views::Composition]
@@ -36,6 +38,8 @@ module Vedeu
36
38
  end
37
39
  end
38
40
 
41
+ # Adds the child to the collection.
42
+ #
39
43
  # @param child [Vedeu::Views::View]
40
44
  # @return [Vedeu::Views::Views]
41
45
  def add(child)
@@ -56,6 +56,8 @@ module Vedeu
56
56
  end
57
57
  end
58
58
 
59
+ # Adds the child to the collection.
60
+ #
59
61
  # @param child [Vedeu::Views::Stream]
60
62
  # @return [Vedeu::Views::Stream]
61
63
  def add(child)
@@ -64,6 +64,8 @@ module Vedeu
64
64
  end
65
65
  end
66
66
 
67
+ # Adds the child to the collection.
68
+ #
67
69
  # @param child [Vedeu::Views::Stream]
68
70
  # @return [Vedeu::Views::Streams]
69
71
  def add(child)
@@ -53,7 +53,7 @@ module Vedeu
53
53
  # @!attribute [rw] wordwrap
54
54
  # @return [Boolean]
55
55
  attr_accessor :wordwrap
56
- alias_method :wordwrap?, :wordwrap
56
+ alias wordwrap? wordwrap
57
57
 
58
58
  # @!attribute [rw] zindex
59
59
  # @return [Fixnum]
@@ -78,6 +78,8 @@ module Vedeu
78
78
  end
79
79
  end
80
80
 
81
+ # Adds the child to the collection.
82
+ #
81
83
  # @param child [Vedeu::Views::Line]
82
84
  # @return [Vedeu::Views::Lines]
83
85
  def add(child)
@@ -23,12 +23,6 @@ module Vedeu
23
23
  it { subject.must_be_instance_of(Hash) }
24
24
  end
25
25
 
26
- describe '#cell?' do
27
- subject { instance.cell? }
28
-
29
- it { subject.must_equal(false) }
30
- end
31
-
32
26
  describe '#name=' do
33
27
  subject { instance.name=(_value) }
34
28
 
@@ -23,12 +23,6 @@ module Vedeu
23
23
  end
24
24
  end
25
25
 
26
- describe '#cell?' do
27
- subject { instance.cell? }
28
-
29
- it { subject.must_equal(false) }
30
- end
31
-
32
26
  describe '#text' do
33
27
  subject { instance.text }
34
28
 
@@ -17,12 +17,6 @@ module Vedeu
17
17
  }
18
18
  let(:_value) { ' ' }
19
19
 
20
- describe '#cell?' do
21
- subject { instance.cell? }
22
-
23
- it { subject.must_equal(false) }
24
- end
25
-
26
20
  describe '#value' do
27
21
  subject { instance.value }
28
22
 
@@ -25,10 +25,6 @@ module Vedeu
25
25
  it { instance.instance_variable_get('@value').must_equal(_value) }
26
26
  end
27
27
 
28
- describe '#cell?' do
29
- it { instance.cell?.must_equal(false) }
30
- end
31
-
32
28
  describe '#null' do
33
29
  it { instance.null.must_equal(nil) }
34
30
  it { instance.background.must_equal(nil) }
@@ -39,12 +39,6 @@ module Vedeu
39
39
  it { instance.must_respond_to(:value) }
40
40
  end
41
41
 
42
- describe '#cell?' do
43
- subject { instance.cell? }
44
-
45
- it { subject.must_equal(true) }
46
- end
47
-
48
42
  describe '#eql?' do
49
43
  let(:other) { instance }
50
44
 
@@ -25,10 +25,6 @@ module Vedeu
25
25
  it { instance.instance_variable_get('@value').must_equal(_value) }
26
26
  end
27
27
 
28
- describe '#cell?' do
29
- it { instance.cell?.must_equal(false) }
30
- end
31
-
32
28
  describe '#null' do
33
29
  it { instance.null.must_equal(nil) }
34
30
  it { instance.background.must_equal(nil) }
@@ -63,16 +63,6 @@ module Vedeu
63
63
  end
64
64
  end
65
65
 
66
- describe '#become' do
67
- let(:instance) { Vedeu::Cells::Border.new }
68
- let(:klass) { Vedeu::Cells::Char }
69
- let(:attributes) { instance.attributes }
70
-
71
- subject { instance.become(klass, attributes) }
72
-
73
- it { subject.must_be_instance_of(Vedeu::Cells::Char) }
74
- end
75
-
76
66
  describe '#boolean' do
77
67
  subject { instance.boolean(_value) }
78
68
 
@@ -6,9 +6,9 @@ module Vedeu
6
6
 
7
7
  module Events
8
8
 
9
- describe Collection do
9
+ describe Events do
10
10
 
11
- let(:described) { Vedeu::Events::Collection }
11
+ let(:described) { Vedeu::Events::Events }
12
12
  let(:instance) { described.new }
13
13
 
14
14
  it { described.superclass.must_equal(Vedeu::Repositories::Collection) }
@@ -17,7 +17,7 @@ module Vedeu
17
17
  it { instance.must_be_instance_of(described) }
18
18
  end
19
19
 
20
- end # Collection
20
+ end # Events
21
21
 
22
22
  end # Events
23
23
 
@@ -18,7 +18,7 @@ module Vedeu
18
18
  it { described.must_respond_to(:reset) }
19
19
 
20
20
  it do
21
- described.expects(:new).with(Vedeu::Events::Collection)
21
+ described.expects(:new).with(Vedeu::Events::Events)
22
22
  subject
23
23
  end
24
24
  end