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
@@ -25,16 +25,15 @@ module Vedeu
25
25
 
26
26
  # Send given input to the named document.
27
27
  #
28
- # @param name [String]
29
- # @param input [String|Symbol]
30
- # @return [String|Symbol]
28
+ # @param (see #initialize)
29
+ # @return (see #keypress)
31
30
  def self.keypress(input:, name:)
32
31
  new(input: input, name: name).keypress
33
32
  end
34
33
 
35
34
  # Returns a new instance of Vedeu::Editor::Editor.
36
35
  #
37
- # @param name [String]
36
+ # @param name [String|Symbol]
38
37
  # @param input [String|Symbol]
39
38
  # @return [Vedeu::Editor::Editor]
40
39
  def initialize(input:, name:)
@@ -6,8 +6,8 @@ module Vedeu
6
6
  #
7
7
  class Insert
8
8
 
9
+ # @param (see #initialize)
9
10
  # @return [Vedeu::Editor::Line|Vedeu::Editor::Lines]
10
- # @see #initialize
11
11
  def self.into(collection, entity, index = nil, size = 0)
12
12
  new(collection, entity, index, size).insert
13
13
  end
@@ -14,7 +14,7 @@ module Vedeu
14
14
  # Coerce a line into a new instance of Vedeu::Editor::Line.
15
15
  #
16
16
  # @param line [String|Vedeu::Editor::Line]
17
- # @return [Vedeu::Editor::Line]
17
+ # @return (see #initialize)
18
18
  def self.coerce(line)
19
19
  return line if line.is_a?(self)
20
20
  return new(line) if line.is_a?(String)
@@ -116,13 +116,6 @@ module Vedeu
116
116
  line.size
117
117
  end
118
118
 
119
- # Return the line as a collection of Vedeu::Views::Char objects.
120
- #
121
- # @return [Array<Vedeu::Views::Char>]
122
- def to_chars
123
- line.chars.map { |char| Vedeu::Views::Char.new(value: char) }
124
- end
125
-
126
119
  end # Line
127
120
 
128
121
  end # Editor
@@ -15,7 +15,7 @@ module Vedeu
15
15
  # Coerce a document into a new instance of Vedeu::Editor::Lines.
16
16
  #
17
17
  # @param document [Array<String>|Vedeu::Editor::Lines]
18
- # @return [Vedeu::Editor::Lines]
18
+ # @return (see #initialize)
19
19
  def self.coerce(document)
20
20
  if document.is_a?(self)
21
21
  new(document.lines)
@@ -15,4 +15,13 @@ module Vedeu
15
15
 
16
16
  end # Editor
17
17
 
18
+ # Manipulate the repository of documents.
19
+ #
20
+ # @example
21
+ # Vedeu.documents
22
+ #
23
+ # @!method documents
24
+ # @return [Vedeu::Editor::Repository]
25
+ def_delegators Vedeu::Editor::Repository, :documents
26
+
18
27
  end # Vedeu
data/lib/vedeu/esc/esc.rb CHANGED
@@ -11,6 +11,7 @@ module Vedeu
11
11
  #
12
12
  module Esc
13
13
 
14
+ include Vedeu::Common
14
15
  include Vedeu::EscapeSequences::Actions
15
16
  include Vedeu::EscapeSequences::Borders
16
17
  include Vedeu::EscapeSequences::Colours
@@ -25,7 +26,7 @@ module Vedeu
25
26
  # @param stream [String]
26
27
  # @return [String]
27
28
  def escape(stream = '')
28
- return stream if stream.nil? || stream.empty?
29
+ return stream if absent?(stream)
29
30
 
30
31
  stream.gsub(/\e/, '\\e')
31
32
  end
@@ -10,6 +10,7 @@ module Vedeu
10
10
  #
11
11
  module Aliases
12
12
 
13
+ include Vedeu::Common
13
14
  extend self
14
15
 
15
16
  # Add events by name to the alias name group. When an alias is
@@ -48,7 +49,7 @@ module Vedeu
48
49
  # @param alias_name [Symbol]
49
50
  # @return [Boolean]
50
51
  def registered?(alias_name)
51
- return false if empty? || alias_name.nil? || alias_name.empty?
52
+ return false if empty? || absent?(alias_name)
52
53
 
53
54
  storage.include?(alias_name)
54
55
  end
@@ -106,4 +107,10 @@ module Vedeu
106
107
 
107
108
  end # Events
108
109
 
110
+ # @!method bind_alias
111
+ # @see Vedeu::Events::Aliases#bind_alias
112
+ # @!method unbind_alias
113
+ # @see Vedeu::Events::Aliases#unbind_alias
114
+ def_delegators Vedeu::Events::Aliases, :bind_alias, :unbind_alias
115
+
109
116
  end # Vedeu
@@ -293,4 +293,12 @@ module Vedeu
293
293
 
294
294
  end # Events
295
295
 
296
+ # @!method bind
297
+ # @see Vedeu::Events::Event.bind
298
+ # @!method bound?
299
+ # @see Vedeu::Events::Event.bound?
300
+ # @!method unbind
301
+ # @see Vedeu::Events::Event.unbind
302
+ def_delegators Vedeu::Events::Event, :bind, :bound?, :unbind
303
+
296
304
  end # Vedeu
@@ -27,4 +27,13 @@ module Vedeu
27
27
 
28
28
  end # Events
29
29
 
30
+ # Manipulate the repository of events.
31
+ #
32
+ # @example
33
+ # Vedeu.events
34
+ #
35
+ # @!method events
36
+ # @return [Vedeu::Events::Repository]
37
+ def_delegators Vedeu::Events::Repository, :events
38
+
30
39
  end # Vedeu
@@ -14,10 +14,7 @@ module Vedeu
14
14
  # @example
15
15
  # Vedeu.trigger(:my_event, :oxidize, 'nitrogen')
16
16
  #
17
- # @param name [Symbol] The name of the event you wish to
18
- # trigger. The event does not have to exist.
19
- # @param args [Array] Any arguments the event needs to execute
20
- # correctly.
17
+ # @param (see #initialize)
21
18
  # @return [Array]
22
19
  def self.trigger(name, *args)
23
20
  new(name, *args).trigger
@@ -25,7 +22,10 @@ module Vedeu
25
22
 
26
23
  # Returns a new instance of Vedeu::Events::Trigger.
27
24
  #
28
- # @param (see .trigger)
25
+ # @param name [Symbol] The name of the event you wish to
26
+ # trigger. The event does not have to exist.
27
+ # @param args [Array] Any arguments the event needs to execute
28
+ # correctly.
29
29
  # @return [Vedeu::Events::Trigger]
30
30
  def initialize(name, *args)
31
31
  @name = name
@@ -81,4 +81,8 @@ module Vedeu
81
81
 
82
82
  end # Events
83
83
 
84
+ # @!method trigger
85
+ # @see Vedeu::Events::Trigger.trigger
86
+ def_delegators Vedeu::Events::Trigger, :trigger
87
+
84
88
  end # Vedeu
@@ -18,7 +18,7 @@ module Vedeu
18
18
 
19
19
  # Returns a new instance of Vedeu::Geometry::Coordinate.
20
20
  #
21
- # @param name [String]
21
+ # @param name [String|Symbol]
22
22
  # @param oy [Fixnum]
23
23
  # @param ox [Fixnum]
24
24
  # @return [Vedeu::Geometry::Coordinate]
@@ -31,7 +31,7 @@ module Vedeu
31
31
  protected
32
32
 
33
33
  # @!attribute [r] name
34
- # @return [String]
34
+ # @return [String|Symbol]
35
35
  attr_reader :name
36
36
 
37
37
  # @!attribute [rw] ox
@@ -13,7 +13,7 @@ module Vedeu
13
13
  #
14
14
  # A standalone geometry definition:
15
15
  #
16
- # Vedeu.geometry 'some_interface' do
16
+ # Vedeu.geometry :some_interface do
17
17
  # height 5 # Sets the height of the view to 5
18
18
  # width 20 # Sets the width of the view to 20
19
19
  # x 3 # Start drawing 3 spaces from left
@@ -24,7 +24,7 @@ module Vedeu
24
24
  #
25
25
  # An interface including a geometry definition:
26
26
  #
27
- # Vedeu.interface 'some_interface' do
27
+ # Vedeu.interface :some_interface do
28
28
  # geometry do
29
29
  # height 5
30
30
  # width 20
@@ -43,14 +43,14 @@ module Vedeu
43
43
  # You can also make a geometry declaration dependent on another
44
44
  # view:
45
45
  #
46
- # Vedeu.interface 'other_panel' do
46
+ # Vedeu.interface :other_panel do
47
47
  # # ... some code here
48
48
  # end
49
49
  #
50
- # Vedeu.interface 'main' do
50
+ # Vedeu.interface :main do
51
51
  # geometry do
52
52
  # height 10
53
- # y { use('other_panel').south }
53
+ # y { use(:other_panel).south }
54
54
  # end
55
55
  # # ... some code here
56
56
  # end
@@ -79,12 +79,12 @@ module Vedeu
79
79
  # Specify the geometry of an interface or view with a simple
80
80
  # DSL.
81
81
  #
82
- # Vedeu.geometry 'some_interface' do
82
+ # Vedeu.geometry :some_interface do
83
83
  # # ...
84
84
  # end
85
85
  #
86
- # @param name [String] The name of the interface or view to
87
- # which this geometry belongs.
86
+ # @param name [String|Symbol] The name of the interface or view
87
+ # to which this geometry belongs.
88
88
  # @param block [Proc]
89
89
  # @raise [Vedeu::Error::RequiresBlock]
90
90
  # @return [Vedeu::Geometry::Geometry]
@@ -94,21 +94,11 @@ module Vedeu
94
94
  Vedeu::Geometry::Geometry.build(name: name, &block).store
95
95
  end
96
96
 
97
- # Returns an instance of Vedeu::Geometry::DSL.
98
- #
99
- # @param model [Vedeu::Geometry::Geometry]
100
- # @param client [Object]
101
- # @return [Vedeu::Geometry::DSL]
102
- def initialize(model, client = nil)
103
- @model = model
104
- @client = client
105
- end
106
-
107
97
  # Instructs Vedeu to calculate x and y geometry automatically
108
98
  # based on the centre character of the terminal, the width and
109
99
  # the height.
110
100
  #
111
- # Vedeu.geometry 'some_interface' do
101
+ # Vedeu.geometry :some_interface do
112
102
  # centred false # or...
113
103
  #
114
104
  # centred true # or...
@@ -130,7 +120,7 @@ module Vedeu
130
120
  # Returns the width in characters for the number of columns
131
121
  # specified.
132
122
  #
133
- # Vedeu.geometry 'main_interface' do
123
+ # Vedeu.geometry :main_interface do
134
124
  # # ... some code
135
125
  # width columns(9) # Vedeu.width # => 92 (for example)
136
126
  # # 92 / 12 = 7
@@ -149,7 +139,7 @@ module Vedeu
149
139
  # Specify the number of characters/rows/lines tall the interface
150
140
  # will be. This value will be ignored when `y` and `yn` are set.
151
141
  #
152
- # Vedeu.geometry 'some_interface' do
142
+ # Vedeu.geometry :some_interface do
153
143
  # height 8
154
144
  # # ... some code
155
145
  # end
@@ -164,7 +154,7 @@ module Vedeu
164
154
  # Returns the height in characters for the number of rows
165
155
  # specified.
166
156
  #
167
- # Vedeu.geometry 'main_interface' do
157
+ # Vedeu.geometry :main_interface do
168
158
  # # ... some code
169
159
  # height rows(3) # Vedeu.height # => 38 (for example)
170
160
  # # 38 / 12 = 3
@@ -183,7 +173,7 @@ module Vedeu
183
173
  # Specify the number of characters/columns wide the interface
184
174
  # will be. This value will be ignored when `x` and `xn` are set.
185
175
  #
186
- # Vedeu.geometry 'some_interface' do
176
+ # Vedeu.geometry :some_interface do
187
177
  # width 25
188
178
  # # ... some code
189
179
  # end
@@ -197,12 +187,12 @@ module Vedeu
197
187
 
198
188
  # Specify the starting x position (column) of the interface.
199
189
  #
200
- # Vedeu.geometry 'some_interface' do
190
+ # Vedeu.geometry :some_interface do
201
191
  # x 7 # start on column 7.
202
192
  #
203
- # # start on column 8, if `other_interface` changes position
204
- # # then `some_interface` will too.
205
- # x { use('other_interface').east }
193
+ # # start on column 8, if :other_interface changes position
194
+ # # then :some_interface will too.
195
+ # x { use(:other_interface).east }
206
196
  # # ... some code
207
197
  # end
208
198
  #
@@ -219,12 +209,12 @@ module Vedeu
219
209
  # Specify the ending x position (column) of the interface.
220
210
  # This value will override `width`.
221
211
  #
222
- # Vedeu.geometry 'some_interface' do
212
+ # Vedeu.geometry :some_interface do
223
213
  # xn 37 # end at column 37.
224
214
  #
225
- # # when `other_interface` changes position,
226
- # # `some_interface` will too.
227
- # xn { use('other_interface').right }
215
+ # # when :other_interface changes position,
216
+ # # :some_interface will too.
217
+ # xn { use(:other_interface).right }
228
218
  # # ... some code
229
219
  # end
230
220
  #
@@ -240,12 +230,12 @@ module Vedeu
240
230
 
241
231
  # Specify the starting y position (row/line) of the interface.
242
232
  #
243
- # Vedeu.geometry 'some_interface' do
233
+ # Vedeu.geometry :some_interface do
244
234
  # y 4 # start at row 4
245
235
  #
246
- # # start on row/line 3, when `other_interface` changes
247
- # # position, `some_interface` will too.
248
- # y { use('other_interface').north }
236
+ # # start on row/line 3, when :other_interface changes
237
+ # # position, :some_interface will too.
238
+ # y { use(:other_interface).north }
249
239
  # # ... some code
250
240
  # end
251
241
  #
@@ -262,12 +252,12 @@ module Vedeu
262
252
  # Specify the ending y position (row/line) of the interface.
263
253
  # This value will override `height`.
264
254
  #
265
- # Vedeu.geometry 'some_interface' do
255
+ # Vedeu.geometry :some_interface do
266
256
  # yn 24 # end at row 24.
267
257
  #
268
- # # if `other_interface` changes position, `some_interface`
258
+ # # if :other_interface changes position, :some_interface
269
259
  # # will too.
270
- # yn { use('other_interface').bottom }
260
+ # yn { use(:other_interface).bottom }
271
261
  # # ... some code
272
262
  # end
273
263
  #
@@ -285,4 +275,8 @@ module Vedeu
285
275
 
286
276
  end # Geometry
287
277
 
278
+ # @!method geometry
279
+ # @see Vedeu::Geometry::DSL.geometry
280
+ def_delegators Vedeu::Geometry::DSL, :geometry
281
+
288
282
  end # Vedeu
@@ -9,7 +9,7 @@ module Vedeu
9
9
  # Return a new instance of Vedeu::Geometry::GenericCoordinate.
10
10
  #
11
11
  # @param attributes [Hash]
12
- # @option attributes name [String]
12
+ # @option attributes name [String|Symbol]
13
13
  # @option attributes type [Symbol]
14
14
  # @option attributes offset [Fixnum]
15
15
  # @return [Vedeu::Geometry::GenericCoordinate]
@@ -72,8 +72,8 @@ module Vedeu
72
72
  # @return [Fixnum]
73
73
  attr_writer :yn
74
74
 
75
- # @param attributes [Hash] See #initialize
76
- # @return [Vedeu::Geometry::Geometry]
75
+ # @param (see #initialize)
76
+ # @return (see #initialize)
77
77
  def self.store(attributes)
78
78
  new(attributes).store
79
79
  end
@@ -84,7 +84,7 @@ module Vedeu
84
84
  # @option attributes centred [Boolean]
85
85
  # @option attributes maximised [Boolean]
86
86
  # @option attributes height [Fixnum]
87
- # @option attributes name [String]
87
+ # @option attributes name [String|Symbol]
88
88
  # @option attributes repository [Vedeu::Geometry::Repository]
89
89
  # @option attributes width [Fixnum]
90
90
  # @option attributes x [Fixnum]
@@ -4,7 +4,7 @@ module Vedeu
4
4
 
5
5
  # Provides a non-existent model to swallow messages.
6
6
  #
7
- class Null
7
+ class Null < Vedeu::Null::Generic
8
8
 
9
9
  extend Forwardable
10
10
 
@@ -35,7 +35,7 @@ module Vedeu
35
35
  # Returns a new instance of Vedeu::Geometry::Null.
36
36
  #
37
37
  # @param attributes [Hash<Symbol => void>]
38
- # @option attributes name [String|NilClass]
38
+ # @option attributes name [String|Symbol|NilClass]
39
39
  # @return [Vedeu::Geometry::Null]
40
40
  def initialize(attributes = {})
41
41
  @attributes = attributes
@@ -43,28 +43,6 @@ module Vedeu
43
43
  @maximised = @attributes.fetch(:maximised, false)
44
44
  end
45
45
 
46
- # @return [FalseClass]
47
- def centred
48
- false
49
- end
50
-
51
- # @return [FalseClass]
52
- def maximised?
53
- false
54
- end
55
- alias_method :maximise, :maximised?
56
- alias_method :unmaximise, :maximised?
57
-
58
- # @return [Boolean]
59
- def null?
60
- true
61
- end
62
-
63
- # @return [Vedeu::Geometry::Null]
64
- def store
65
- self
66
- end
67
-
68
46
  private
69
47
 
70
48
  # @return [Vedeu::Geometry::Area]