vedeu 0.4.56 → 0.4.57

Sign up to get free protection for your applications and to get access to all the features.
Files changed (129) hide show
  1. checksums.yaml +4 -4
  2. data/examples/borders_app.rb +22 -24
  3. data/examples/colours_app.rb +4 -6
  4. data/examples/configuration_app.rb +5 -7
  5. data/examples/drb_app.rb +1 -1
  6. data/examples/focus_app.rb +1 -1
  7. data/examples/geometry_app.rb +8 -10
  8. data/examples/hello_world.rb +4 -6
  9. data/examples/material_colours_app.rb +19 -9
  10. data/examples/material_colours_app_20150721.svg +2285 -0
  11. data/examples/panel_app.rb +6 -8
  12. data/examples/typed_commands/typed_commands_app.rb +15 -17
  13. data/examples/view_templates_app/view_templates_app.rb +1 -1
  14. data/lib/vedeu/all.rb +82 -10
  15. data/lib/vedeu/api.rb +34 -14
  16. data/lib/vedeu/application.rb +0 -1
  17. data/lib/vedeu/application/application_controller.rb +0 -1
  18. data/lib/vedeu/application/application_helper.rb +0 -1
  19. data/lib/vedeu/application/application_view.rb +0 -1
  20. data/lib/vedeu/application/controller.rb +0 -1
  21. data/lib/vedeu/application/helper.rb +0 -1
  22. data/lib/vedeu/application/view.rb +0 -1
  23. data/lib/vedeu/bindings/all.rb +0 -1
  24. data/lib/vedeu/bindings/visibility.rb +2 -19
  25. data/lib/vedeu/buffers/buffer.rb +0 -1
  26. data/lib/vedeu/buffers/display_buffer.rb +0 -1
  27. data/lib/vedeu/cli/generator/application.rb +0 -1
  28. data/lib/vedeu/cli/generator/helpers.rb +0 -1
  29. data/lib/vedeu/cli/generator/view.rb +0 -1
  30. data/lib/vedeu/colours/background.rb +0 -1
  31. data/lib/vedeu/colours/colour.rb +0 -1
  32. data/lib/vedeu/colours/colour_translator.rb +0 -1
  33. data/lib/vedeu/colours/foreground.rb +0 -1
  34. data/lib/vedeu/common.rb +0 -1
  35. data/lib/vedeu/configuration/configuration.rb +0 -1
  36. data/lib/vedeu/cursor/cursor.rb +0 -1
  37. data/lib/vedeu/cursor/move.rb +0 -1
  38. data/lib/vedeu/cursor/refresh_cursor.rb +0 -1
  39. data/lib/vedeu/cursor/reposition.rb +0 -1
  40. data/lib/vedeu/distributed/client.rb +2 -0
  41. data/lib/vedeu/distributed/server.rb +2 -0
  42. data/lib/vedeu/distributed/uri.rb +2 -1
  43. data/lib/vedeu/exceptions.rb +0 -7
  44. data/lib/vedeu/geometry/area.rb +0 -1
  45. data/lib/vedeu/geometry/coordinate.rb +0 -1
  46. data/lib/vedeu/geometry/dimension.rb +14 -1
  47. data/lib/vedeu/geometry/geometry.rb +0 -1
  48. data/lib/vedeu/geometry/index_position.rb +0 -1
  49. data/lib/vedeu/geometry/position.rb +0 -1
  50. data/lib/vedeu/geometry/position_index.rb +0 -1
  51. data/lib/vedeu/geometry/position_validator.rb +0 -1
  52. data/lib/vedeu/input/input.rb +0 -1
  53. data/lib/vedeu/input/key.rb +0 -1
  54. data/lib/vedeu/input/keymap.rb +0 -1
  55. data/lib/vedeu/input/mapper.rb +0 -1
  56. data/lib/vedeu/log.rb +0 -1
  57. data/lib/vedeu/main_loop.rb +0 -1
  58. data/lib/vedeu/models/cell.rb +0 -1
  59. data/lib/vedeu/models/char.rb +0 -1
  60. data/lib/vedeu/models/composition.rb +0 -1
  61. data/lib/vedeu/models/escape.rb +0 -1
  62. data/lib/vedeu/models/focus.rb +0 -1
  63. data/lib/vedeu/models/group.rb +37 -15
  64. data/lib/vedeu/models/interface.rb +1 -2
  65. data/lib/vedeu/models/line.rb +0 -1
  66. data/lib/vedeu/models/menu.rb +0 -1
  67. data/lib/vedeu/models/stream.rb +0 -1
  68. data/lib/vedeu/models/toggleable.rb +21 -11
  69. data/lib/vedeu/null/all.rb +0 -1
  70. data/lib/vedeu/null/border.rb +0 -1
  71. data/lib/vedeu/null/buffer.rb +0 -1
  72. data/lib/vedeu/null/generic.rb +0 -1
  73. data/lib/vedeu/null/geometry.rb +0 -1
  74. data/lib/vedeu/null/interface.rb +0 -1
  75. data/lib/vedeu/output/border.rb +0 -1
  76. data/lib/vedeu/output/clear/named_group.rb +3 -2
  77. data/lib/vedeu/output/clear/named_interface.rb +2 -1
  78. data/lib/vedeu/output/compressor.rb +0 -1
  79. data/lib/vedeu/output/html_char.rb +0 -1
  80. data/lib/vedeu/output/output.rb +0 -1
  81. data/lib/vedeu/output/presentation.rb +0 -1
  82. data/lib/vedeu/output/refresh_group.rb +0 -1
  83. data/lib/vedeu/output/render_border.rb +0 -1
  84. data/lib/vedeu/output/renderers/all.rb +0 -1
  85. data/lib/vedeu/output/renderers/escape_sequence.rb +0 -1
  86. data/lib/vedeu/output/renderers/file.rb +0 -1
  87. data/lib/vedeu/output/renderers/html.rb +0 -1
  88. data/lib/vedeu/output/renderers/json.rb +0 -1
  89. data/lib/vedeu/output/renderers/null.rb +0 -1
  90. data/lib/vedeu/output/renderers/renderer_options.rb +0 -1
  91. data/lib/vedeu/output/renderers/terminal.rb +0 -1
  92. data/lib/vedeu/output/renderers/text.rb +0 -1
  93. data/lib/vedeu/output/style.rb +0 -1
  94. data/lib/vedeu/output/text.rb +0 -1
  95. data/lib/vedeu/output/viewport.rb +0 -1
  96. data/lib/vedeu/output/virtual_terminal.rb +0 -1
  97. data/lib/vedeu/output/wordwrap.rb +0 -1
  98. data/lib/vedeu/repositories/collection.rb +0 -7
  99. data/lib/vedeu/repositories/model.rb +0 -1
  100. data/lib/vedeu/repositories/registerable.rb +0 -1
  101. data/lib/vedeu/repositories/repository.rb +0 -1
  102. data/lib/vedeu/repositories/store.rb +0 -1
  103. data/lib/vedeu/templating/directive.rb +1 -1
  104. data/lib/vedeu/templating/helpers.rb +1 -1
  105. data/lib/vedeu/templating/preprocessor.rb +1 -1
  106. data/lib/vedeu/templating/template.rb +1 -1
  107. data/lib/vedeu/traps.rb +0 -1
  108. data/lib/vedeu/version.rb +1 -1
  109. data/test/lib/vedeu/application/controller_test.rb +8 -1
  110. data/test/lib/vedeu/buffers/buffer_test.rb +5 -0
  111. data/test/lib/vedeu/cursor/reposition_test.rb +5 -5
  112. data/test/lib/vedeu/models/group_test.rb +4 -3
  113. data/test/lib/vedeu/models/interface_test.rb +15 -1
  114. data/test/lib/vedeu/null/interface_test.rb +7 -21
  115. data/test/lib/vedeu/output/esc_test.rb +105 -109
  116. metadata +3 -15
  117. data/lib/vedeu/application/all.rb +0 -6
  118. data/lib/vedeu/buffers/all.rb +0 -3
  119. data/lib/vedeu/cli/all.rb +0 -1
  120. data/lib/vedeu/colours/all.rb +0 -7
  121. data/lib/vedeu/configuration/all.rb +0 -3
  122. data/lib/vedeu/cursor/all.rb +0 -7
  123. data/lib/vedeu/distributed/all.rb +0 -15
  124. data/lib/vedeu/events/all.rb +0 -5
  125. data/lib/vedeu/geometry/all.rb +0 -14
  126. data/lib/vedeu/models/all.rb +0 -16
  127. data/lib/vedeu/output/all.rb +0 -21
  128. data/lib/vedeu/output/clear/all.rb +0 -13
  129. data/lib/vedeu/templating/all.rb +0 -13
@@ -11,7 +11,6 @@ module Vedeu
11
11
  # is copied to the 'Front' buffer, the current 'Front' buffer is also copied
12
12
  # to the 'Previous' buffer.
13
13
  #
14
- # @api private
15
14
  class Buffer
16
15
 
17
16
  include Vedeu::Model
@@ -3,7 +3,6 @@ module Vedeu
3
3
  # This module is included in Vedeu::Interface to provide means to store client
4
4
  # application views created with {Vedeu.renders} or {Vedeu.views}.
5
5
  #
6
- # @api private
7
6
  module DisplayBuffer
8
7
 
9
8
  include Vedeu::Common
@@ -9,7 +9,6 @@ module Vedeu
9
9
  # vedeu new your_app_name_here
10
10
  # ```
11
11
  #
12
- # @api private
13
12
  # :nocov:
14
13
  class Application
15
14
 
@@ -7,7 +7,6 @@ module Vedeu
7
7
  # Provides functionality used by the generators to build the client
8
8
  # application.
9
9
  #
10
- # @api private
11
10
  # :nocov:
12
11
  module Helpers
13
12
 
@@ -11,7 +11,6 @@ module Vedeu
11
11
  # vedeu view main_screen
12
12
  # ```
13
13
  #
14
- # @api private
15
14
  # :nocov:
16
15
  class View
17
16
 
@@ -3,7 +3,6 @@ module Vedeu
3
3
  # The class represents one half (the other, can be found at
4
4
  # {Vedeu::Foreground}) of a terminal colour escape sequence.
5
5
  #
6
- # @api private
7
6
  class Background < Vedeu::ColourTranslator
8
7
 
9
8
  private
@@ -30,7 +30,6 @@ module Vedeu
30
30
  # area needs more work in Vedeu.
31
31
  #
32
32
  # @todo Fix colours in all terminals. (GL: 2015-04-13)
33
- # @api private
34
33
  class Colour
35
34
 
36
35
  # @!attribute [r] background
@@ -20,7 +20,6 @@ module Vedeu
20
20
  #
21
21
  # @todo More documentation required (create a fancy chart!)
22
22
  #
23
- # @api private
24
23
  class ColourTranslator
25
24
 
26
25
  # @!attribute [r] colour
@@ -3,7 +3,6 @@ module Vedeu
3
3
  # The class represents one half (the other, can be found at
4
4
  # {Vedeu::Background}) of a terminal colour escape sequence.
5
5
  #
6
- # @api private
7
6
  class Foreground < Vedeu::ColourTranslator
8
7
 
9
8
  private
data/lib/vedeu/common.rb CHANGED
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # A module for common methods used throughout Vedeu.
4
4
  #
5
- # @api private
6
5
  module Common
7
6
 
8
7
  # Removes the module part from the expression in the string.
@@ -27,7 +27,6 @@ module Vedeu
27
27
  # application settings (via the configuration API), or any command-line
28
28
  # arguments provided.
29
29
  #
30
- # @api private
31
30
  class Configuration
32
31
 
33
32
  include Singleton
@@ -5,7 +5,6 @@ module Vedeu
5
5
  # Each interface has its own Cursor which maintains the position and
6
6
  # visibility of the cursor within that interface.
7
7
  #
8
- # @api private
9
8
  class Cursor
10
9
 
11
10
  include Vedeu::Model
@@ -39,7 +39,6 @@ module Vedeu
39
39
  # The view will move freely within the bounds of the interface,
40
40
  # irrespective of content.
41
41
  #
42
- # @api private
43
42
  class Move
44
43
 
45
44
  extend Forwardable
@@ -3,7 +3,6 @@ module Vedeu
3
3
  # Handle the refreshing (redrawing) of a cursor, without redrawing the whole
4
4
  # interface; unless the cursor's offset has caused the view to change.
5
5
  #
6
- # @api private
7
6
  class RefreshCursor
8
7
 
9
8
  extend Forwardable
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Provides the mechanism to arbitrarily move a cursor to a given position.
4
4
  #
5
- # @api private
6
5
  class Reposition
7
6
 
8
7
  # @return [Vedeu::Cursor]
@@ -1,5 +1,7 @@
1
1
  module Vedeu
2
2
 
3
+ # Provides a mechanism to control a running client application via DRb.
4
+ #
3
5
  module Distributed
4
6
 
5
7
  # A class for the client side of the DRb server/client relationship.
@@ -1,5 +1,7 @@
1
1
  module Vedeu
2
2
 
3
+ # Provides a mechanism to control a running client application via DRb.
4
+ #
3
5
  module Distributed
4
6
 
5
7
  # A class for the server side of the DRb server/client relationship.
@@ -1,11 +1,12 @@
1
1
  module Vedeu
2
2
 
3
+ # Provides a mechanism to control a running client application via DRb.
4
+ #
3
5
  module Distributed
4
6
 
5
7
  # Value class which provides the host and port for the DRb server and
6
8
  # client.
7
9
  #
8
- # @api private
9
10
  class Uri
10
11
 
11
12
  # @!attribute [r] host
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Raised with Vedeu attempts to access a named model that does not exist.
4
4
  #
5
- # @api private
6
5
  class ModelNotFound < StandardError
7
6
 
8
7
  end # ModeSwitch
@@ -10,7 +9,6 @@ module Vedeu
10
9
  # Raised when Vedeu attempts to parse a {Vedeu.view} or {Vedeu.interface} and
11
10
  # encounters a problem.
12
11
  #
13
- # @api private
14
12
  class InvalidSyntax < StandardError
15
13
 
16
14
  end # InvalidSyntax
@@ -18,7 +16,6 @@ module Vedeu
18
16
  # Raised when a name is not provided for a model when attempting to store it
19
17
  # in a repository.
20
18
  #
21
- # @api private
22
19
  class MissingRequired < StandardError
23
20
 
24
21
  end # MissingRequired
@@ -28,7 +25,6 @@ module Vedeu
28
25
  #
29
26
  # @see Vedeu::Application
30
27
  #
31
- # @api private
32
28
  class ModeSwitch < StandardError
33
29
 
34
30
  end # ModeSwitch
@@ -38,7 +34,6 @@ module Vedeu
38
34
  #
39
35
  # @see Vedeu::ColourTranslator
40
36
  #
41
- # @api private
42
37
  class NotImplemented < StandardError
43
38
 
44
39
  end # NotImplemented
@@ -48,7 +43,6 @@ module Vedeu
48
43
  #
49
44
  # @see Vedeu::Grid
50
45
  #
51
- # @api private
52
46
  class OutOfRange < StandardError
53
47
 
54
48
  end # OutOfRange
@@ -57,7 +51,6 @@ module Vedeu
57
51
  #
58
52
  # @see Vedeu::MainLoop
59
53
  #
60
- # @api private
61
54
  class VedeuInterrupt < StandardError
62
55
 
63
56
  end # VedeuInterrupt
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Define an area from dimensions or points.
4
4
  #
5
- # @api private
6
5
  class Area
7
6
 
8
7
  # @!attribute [r] y
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Crudely corrects out of range values.
4
4
  #
5
- # @api private
6
5
  class Coordinate
7
6
 
8
7
  extend Forwardable
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # A Dimension is either the height or width of an entity.
4
4
  #
5
- # @api private
6
5
  class Dimension
7
6
 
8
7
  # @param (see #initialize)
@@ -26,16 +25,22 @@ module Vedeu
26
25
  @attributes.each { |key, value| instance_variable_set("@#{key}", value) }
27
26
  end
28
27
 
28
+ # Fetch the starting coordinate.
29
+ #
29
30
  # @return [Fixnum]
30
31
  def d1
31
32
  dimension.first < 1 ? 1 : dimension.first
32
33
  end
33
34
 
35
+ # Fetch the ending coordinate.
36
+ #
34
37
  # @return [Fixnum]
35
38
  def d2
36
39
  dimension.last
37
40
  end
38
41
 
42
+ # Fetch the coordinates.
43
+ #
39
44
  # @return [Array<Fixnum>]
40
45
  def pair
41
46
  dimension
@@ -104,21 +109,29 @@ module Vedeu
104
109
  end
105
110
  end
106
111
 
112
+ # Ascertains the centred starting coordinate.
113
+ #
107
114
  # @return [Fixnum]
108
115
  def centred_d
109
116
  (default / 2) - (length / 2)
110
117
  end
111
118
 
119
+ # Ascertains the centred ending coordinate.
120
+ #
112
121
  # @return [Fixnum]
113
122
  def centred_dn
114
123
  (default / 2) + (length / 2)
115
124
  end
116
125
 
126
+ # Fetch the starting coordinate, or use 1 if not set.
127
+ #
117
128
  # @return [Fixnum]
118
129
  def _d
119
130
  d || 1
120
131
  end
121
132
 
133
+ # Fetch the ending coordinate.
134
+ #
122
135
  # @return [Fixnum]
123
136
  def _dn
124
137
  if dn
@@ -9,7 +9,6 @@ module Vedeu
9
9
  # Calculates and provides interface geometry determined by both the client's
10
10
  # requirements and the terminal's current viewing area.
11
11
  #
12
- # @api private
13
12
  class Geometry
14
13
 
15
14
  extend Forwardable
@@ -5,7 +5,6 @@ module Vedeu
5
5
  # When the optional offset `oy` and `ox` params are given, the they are used
6
6
  # for the starting position.
7
7
  #
8
- # @api private
9
8
  class IndexPosition
10
9
 
11
10
  # @param (see #initialize)
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Change coordinates into an escape sequence to set the cursor position.
4
4
  #
5
- # @api private
6
5
  class Position
7
6
 
8
7
  # @!attribute [r] y
@@ -3,7 +3,6 @@ module Vedeu
3
3
  # Converts a position into an index for the terminal. An index is the position
4
4
  # minus 1.
5
5
  #
6
- # @api private
7
6
  class PositionIndex
8
7
 
9
8
  # Convenience constructor for Vedeu::Position.
@@ -3,7 +3,6 @@ module Vedeu
3
3
  # Validates that the provided coordinates are within the terminal and
4
4
  # interface's geometry (with or without a border).
5
5
  #
6
- # @api private
7
6
  class PositionValidator
8
7
 
9
8
  extend Forwardable
@@ -3,7 +3,6 @@ module Vedeu
3
3
  # Captures input from the user via {Vedeu::Terminal#input} and translates
4
4
  # special characters into symbols.
5
5
  #
6
- # @api private
7
6
  class Input
8
7
 
9
8
  # Instantiate Input and capture keypress(es).
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # A single keypress or combination of keypresses bound to a specific action.
4
4
  #
5
- # @api private
6
5
  class Key
7
6
 
8
7
  # @!attribute [r] input
@@ -5,7 +5,6 @@ module Vedeu
5
5
 
6
6
  # A container class for keys associated with a particular interface.
7
7
  #
8
- # @api private
9
8
  class Keymap
10
9
 
11
10
  include Vedeu::Model
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Maps keys to keymaps.
4
4
  #
5
- # @api private
6
5
  class Mapper
7
6
 
8
7
  # Takes a key as a keypress and sends it to registered keymaps. If found,
data/lib/vedeu/log.rb CHANGED
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Allows the creation of a lock-less log device.
4
4
  #
5
- # @api private
6
5
  class MonoLogger < Logger
7
6
 
8
7
  # Create a trappable Logger instance.
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Provides the main loop for a Vedeu application.
4
4
  #
5
- # @api private
6
5
  class MainLoop
7
6
 
8
7
  trap('SIGTERM') { stop! }
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # A Cell represents a single square of the terminal.
4
4
  #
5
- # @api private
6
5
  class Cell
7
6
 
8
7
  # @!attribute [r] colour
@@ -11,7 +11,6 @@ module Vedeu
11
11
  # Though a multi-character String can be passed as a value, only the first
12
12
  # character is returned in the escape sequence.
13
13
  #
14
- # @api private
15
14
  class Char
16
15
 
17
16
  include Comparable
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # A composition is a collection of interfaces.
4
4
  #
5
- # @api private
6
5
  class Composition
7
6
 
8
7
  include Vedeu::Model
@@ -2,7 +2,6 @@ module Vedeu
2
2
 
3
3
  # Represents an invisible escape character sequence.
4
4
  #
5
- # @api private
6
5
  class Escape
7
6
 
8
7
  # @!attribute [r] value
@@ -12,7 +12,6 @@ module Vedeu
12
12
  # - If the `Vedeu.focus_by_name 'some_interface'` declaration is used, then
13
13
  # the list pointer (`current`) is set to the interface of that name.
14
14
  #
15
- # @api private
16
15
  module Focus
17
16
 
18
17
  extend self