vedeu 0.4.5 → 0.4.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/bin/vedeu +0 -3
  3. data/examples/borders_app.rb +0 -3
  4. data/examples/colours_app.rb +0 -3
  5. data/examples/configuration_app.rb +0 -3
  6. data/examples/cursor_app.rb +0 -3
  7. data/examples/focus_app.rb +0 -3
  8. data/examples/geometry_app.rb +0 -3
  9. data/examples/lines_app.rb +0 -3
  10. data/examples/view_templates_app/template.erb +1 -0
  11. data/examples/view_templates_app/view_templates_app.rb +82 -0
  12. data/lib/vedeu/all.rb +0 -1
  13. data/lib/vedeu/application.rb +7 -6
  14. data/lib/vedeu/bindings.rb +8 -8
  15. data/lib/vedeu/buffers/buffer.rb +14 -4
  16. data/lib/vedeu/buffers/display_buffer.rb +2 -2
  17. data/lib/vedeu/configuration/cli.rb +7 -1
  18. data/lib/vedeu/configuration/configuration.rb +4 -2
  19. data/lib/vedeu/cursor/all.rb +1 -1
  20. data/lib/vedeu/cursor/cursor.rb +29 -2
  21. data/lib/vedeu/cursor/move_cursor.rb +20 -6
  22. data/lib/vedeu/cursor/toggle_cursor.rb +2 -0
  23. data/lib/vedeu/distributed/client.rb +2 -0
  24. data/lib/vedeu/distributed/server.rb +3 -1
  25. data/lib/vedeu/distributed/subprocess.rb +6 -1
  26. data/lib/vedeu/distributed/test_application.rb +32 -9
  27. data/lib/vedeu/distributed/uri.rb +7 -1
  28. data/lib/vedeu/dsl/components/border.rb +2 -0
  29. data/lib/vedeu/dsl/components/geometry.rb +2 -0
  30. data/lib/vedeu/dsl/components/keymap.rb +2 -0
  31. data/lib/vedeu/dsl/components/menu.rb +3 -1
  32. data/lib/vedeu/dsl/composition.rb +31 -2
  33. data/lib/vedeu/dsl/group.rb +2 -0
  34. data/lib/vedeu/dsl/interface.rb +3 -1
  35. data/lib/vedeu/dsl/line.rb +2 -0
  36. data/lib/vedeu/dsl/shared/style.rb +1 -1
  37. data/lib/vedeu/dsl/shared/text.rb +1 -2
  38. data/lib/vedeu/dsl/stream.rb +2 -0
  39. data/lib/vedeu/dsl/view.rb +1 -1
  40. data/lib/vedeu/events/all.rb +1 -1
  41. data/lib/vedeu/events/event.rb +26 -10
  42. data/lib/vedeu/events/trigger.rb +11 -3
  43. data/lib/vedeu/geometry/all.rb +2 -0
  44. data/lib/vedeu/geometry/bounding_area.rb +7 -2
  45. data/lib/vedeu/geometry/content_geometry.rb +2 -0
  46. data/lib/vedeu/geometry/coordinate.rb +15 -6
  47. data/lib/vedeu/geometry/grid.rb +3 -1
  48. data/lib/vedeu/geometry/index_position.rb +77 -0
  49. data/lib/vedeu/geometry/limit.rb +15 -1
  50. data/lib/vedeu/geometry/position.rb +7 -2
  51. data/lib/vedeu/{output → geometry}/position_index.rb +12 -2
  52. data/lib/vedeu/geometry/position_validator.rb +9 -1
  53. data/lib/vedeu/input/all.rb +0 -1
  54. data/lib/vedeu/input/input.rb +2 -0
  55. data/lib/vedeu/input/keymap.rb +5 -3
  56. data/lib/vedeu/input/mapper.rb +7 -1
  57. data/lib/vedeu/launcher.rb +1 -1
  58. data/lib/vedeu/models/all.rb +6 -3
  59. data/lib/vedeu/models/char.rb +157 -0
  60. data/lib/vedeu/models/{view/composition.rb → composition.rb} +1 -4
  61. data/lib/vedeu/models/geometry.rb +36 -12
  62. data/lib/vedeu/models/group.rb +7 -3
  63. data/lib/vedeu/models/{view/interface.rb → interface.rb} +26 -10
  64. data/lib/vedeu/models/{view/line.rb → line.rb} +8 -4
  65. data/lib/vedeu/models/menu.rb +11 -3
  66. data/lib/vedeu/models/{view/stream.rb → stream.rb} +9 -4
  67. data/lib/vedeu/output/all.rb +3 -2
  68. data/lib/vedeu/output/background.rb +2 -2
  69. data/lib/vedeu/output/border.rb +65 -22
  70. data/lib/vedeu/output/char_builder.rb +36 -0
  71. data/lib/vedeu/output/clear.rb +62 -0
  72. data/lib/vedeu/output/colour.rb +15 -7
  73. data/lib/vedeu/output/compositor.rb +3 -1
  74. data/lib/vedeu/output/esc.rb +2 -2
  75. data/lib/vedeu/output/foreground.rb +2 -2
  76. data/lib/vedeu/output/html_char.rb +2 -0
  77. data/lib/vedeu/output/html_renderer.rb +6 -3
  78. data/lib/vedeu/output/output.rb +20 -92
  79. data/lib/vedeu/output/presentation.rb +21 -21
  80. data/lib/vedeu/output/renderer.rb +2 -0
  81. data/lib/vedeu/output/style.rb +4 -2
  82. data/lib/vedeu/output/text.rb +7 -1
  83. data/lib/vedeu/output/translator.rb +4 -2
  84. data/lib/vedeu/output/viewport.rb +4 -2
  85. data/lib/vedeu/output/virtual_buffer.rb +11 -1
  86. data/lib/vedeu/output/virtual_terminal.rb +34 -11
  87. data/lib/vedeu/output/wordwrap.rb +31 -20
  88. data/lib/vedeu/repositories/all.rb +3 -0
  89. data/lib/vedeu/repositories/collection.rb +83 -0
  90. data/lib/vedeu/repositories/collections.rb +35 -0
  91. data/lib/vedeu/{models → repositories}/model.rb +2 -0
  92. data/lib/vedeu/repositories/repository.rb +7 -1
  93. data/lib/vedeu/support/log.rb +1 -1
  94. data/lib/vedeu/support/sentence.rb +7 -1
  95. data/lib/vedeu/support/template.rb +14 -2
  96. data/lib/vedeu/support/terminal.rb +6 -6
  97. data/lib/vedeu/support/trace.rb +4 -4
  98. data/lib/vedeu/support/visible.rb +4 -4
  99. data/test/lib/vedeu/dsl/composition_test.rb +23 -0
  100. data/test/lib/vedeu/geometry/index_position_test.rb +121 -0
  101. data/test/lib/vedeu/{output → geometry}/position_index_test.rb +6 -0
  102. data/test/lib/vedeu/input/keymap_test.rb +2 -2
  103. data/test/lib/vedeu/models/{view/char_test.rb → char_test.rb} +31 -15
  104. data/test/lib/vedeu/models/{view/composition_test.rb → composition_test.rb} +0 -0
  105. data/test/lib/vedeu/models/{view/interface_test.rb → interface_test.rb} +0 -0
  106. data/test/lib/vedeu/models/line_test.rb +156 -0
  107. data/test/lib/vedeu/models/{view/stream_test.rb → stream_test.rb} +1 -16
  108. data/test/lib/vedeu/output/char_builder_test.rb +50 -0
  109. data/test/lib/vedeu/output/clear_test.rb +26 -0
  110. data/test/lib/vedeu/output/compositor_test.rb +0 -10
  111. data/test/lib/vedeu/output/html_renderer_test.rb +8 -3
  112. data/test/lib/vedeu/output/output_test.rb +0 -39
  113. data/test/lib/vedeu/output/viewport_test.rb +10 -66
  114. data/test/lib/vedeu/output/virtual_buffer_test.rb +18 -2
  115. data/test/lib/vedeu/output/virtual_terminal_test.rb +3 -14
  116. data/test/lib/vedeu/output/wordwrap_test.rb +8 -15
  117. data/test/lib/vedeu/repositories/collection_test.rb +108 -0
  118. data/test/lib/vedeu/repositories/collections_test.rb +71 -0
  119. data/test/lib/vedeu/{models → repositories}/model_test.rb +0 -0
  120. data/test/lib/vedeu/support/template_test.rb +21 -1
  121. data/test/support/helpers/model_test_class.rb +1 -1
  122. data/test/test_helper.rb +0 -1
  123. data/vedeu.gemspec +1 -1
  124. metadata +40 -44
  125. data/lib/vedeu/events/events.rb +0 -10
  126. data/lib/vedeu/input/keys.rb +0 -10
  127. data/lib/vedeu/models/collection.rb +0 -81
  128. data/lib/vedeu/models/view/all.rb +0 -12
  129. data/lib/vedeu/models/view/char.rb +0 -99
  130. data/lib/vedeu/models/view/chars.rb +0 -10
  131. data/lib/vedeu/models/view/interfaces.rb +0 -10
  132. data/lib/vedeu/models/view/lines.rb +0 -10
  133. data/lib/vedeu/models/view/streams.rb +0 -10
  134. data/lib/vedeu/output/index_position.rb +0 -35
  135. data/test/lib/vedeu/models/collection_test.rb +0 -112
  136. data/test/lib/vedeu/models/view/chars_test.rb +0 -16
  137. data/test/lib/vedeu/models/view/interfaces_test.rb +0 -16
  138. data/test/lib/vedeu/models/view/line_test.rb +0 -214
  139. data/test/lib/vedeu/models/view/lines_test.rb +0 -16
  140. data/test/lib/vedeu/models/view/streams_test.rb +0 -16
  141. data/test/lib/vedeu/output/index_position_test.rb +0 -64
@@ -1,4 +1,4 @@
1
- require 'vedeu/models/view/interface'
1
+ require 'vedeu/models/interface'
2
2
 
3
3
  module Vedeu
4
4
 
@@ -38,7 +38,7 @@ module Vedeu
38
38
  # ...
39
39
  #
40
40
  # @raise [InvalidSyntax] The required block was not given.
41
- # @return [Vedeu::Model::Collection<Vedeu::Interface>]
41
+ # @return [Vedeu::Interfaces<Vedeu::Interface>]
42
42
  def view(name = '', &block)
43
43
  fail InvalidSyntax, 'block not given' unless block_given?
44
44
 
@@ -47,11 +47,40 @@ module Vedeu
47
47
  model.add(new_model)
48
48
  end
49
49
 
50
+ # Load content from an ERb template.
51
+ #
52
+ # @example
53
+ # Vedeu.renders do
54
+ # template_for('my_interface',
55
+ # '/path/to/template.erb',
56
+ # @some_object, options)
57
+ #
58
+ # @todo More documentation required.
59
+ #
60
+ # @param name [String] The name of interface for which this template's
61
+ # content belongs to.
62
+ # @param filename [String] The filename (including path) to the template
63
+ # to be used.
64
+ # @param object [Object] The object for which the values of template's
65
+ # variables can be obtained.
66
+ # @param options [Hash] See {Vedeu::Wordwrap}
67
+ # @return [Vedeu::Interfaces<Vedeu::Interface>]
68
+ def template_for(name, filename, object = nil, options = {})
69
+ content = Vedeu::Template.parse(object, filename)
70
+ lines = Vedeu::Wordwrap.for(content, options)
71
+
72
+ new_model = model.member.build(new_attributes(name).merge!({ lines: lines }))
73
+
74
+ model.add(new_model)
75
+ end
76
+
50
77
  private
51
78
 
79
+ # @!attribute [r] client
52
80
  # @return [Object]
53
81
  attr_reader :client
54
82
 
83
+ # @!attribute [r] model
55
84
  # @return [Composition]
56
85
  attr_reader :model
57
86
 
@@ -60,9 +60,11 @@ module Vedeu
60
60
 
61
61
  private
62
62
 
63
+ # @!attribute [r] client
63
64
  # @return [Object]
64
65
  attr_reader :client
65
66
 
67
+ # @!attribute [r] model
66
68
  # @return [Group]
67
69
  attr_reader :model
68
70
 
@@ -2,7 +2,7 @@ require 'vedeu/cursor/cursor'
2
2
  require 'vedeu/models/focus'
3
3
  require 'vedeu/models/geometry'
4
4
  require 'vedeu/models/group'
5
- require 'vedeu/models/view/line'
5
+ require 'vedeu/models/line'
6
6
  require 'vedeu/output/border'
7
7
  require 'vedeu/support/common'
8
8
 
@@ -209,9 +209,11 @@ module Vedeu
209
209
 
210
210
  private
211
211
 
212
+ # @!attribute [r] client
212
213
  # @return [Object]
213
214
  attr_reader :client
214
215
 
216
+ # @!attribute [r] model
215
217
  # @return [Interface]
216
218
  attr_reader :model
217
219
 
@@ -113,9 +113,11 @@ module Vedeu
113
113
 
114
114
  private
115
115
 
116
+ # @!attribute [r] client
116
117
  # @return [Object]
117
118
  attr_reader :client
118
119
 
120
+ # @!attribute [r] model
119
121
  # @return [Line]
120
122
  attr_reader :model
121
123
 
@@ -11,7 +11,7 @@ module Vedeu
11
11
 
12
12
  # Define a style or styles for an interface, line or a stream.
13
13
  #
14
- # @param value [Array|Symbol|String]
14
+ # @param value [Array<Symbol>|Array<String>|Symbol|String]
15
15
  #
16
16
  # @example
17
17
  # interface 'my_interface' do
@@ -1,6 +1,5 @@
1
1
  require 'vedeu/output/text'
2
- require 'vedeu/models/view/line'
3
- require 'vedeu/models/view/stream'
2
+ require 'vedeu/models/all'
4
3
 
5
4
  module Vedeu
6
5
 
@@ -36,9 +36,11 @@ module Vedeu
36
36
 
37
37
  private
38
38
 
39
+ # @!attribute [r] client
39
40
  # @return [Object]
40
41
  attr_reader :client
41
42
 
43
+ # @!attribute [r] model
42
44
  # @return [Stream]
43
45
  attr_reader :model
44
46
 
@@ -1,4 +1,4 @@
1
- require 'vedeu/models/view/composition'
1
+ require 'vedeu/models/composition'
2
2
 
3
3
  module Vedeu
4
4
 
@@ -1,4 +1,4 @@
1
- require 'vedeu/events/events'
1
+ require 'vedeu/repositories/collections'
2
2
  require 'vedeu/events/event'
3
3
  require 'vedeu/events/trigger'
4
4
 
@@ -1,5 +1,4 @@
1
- require 'vedeu/models/model'
2
- require 'vedeu/repositories/repository'
1
+ require 'vedeu/repositories/all'
3
2
  require 'vedeu/events/trigger'
4
3
 
5
4
  module Vedeu
@@ -82,7 +81,7 @@ module Vedeu
82
81
  #
83
82
  # @return [TrueClass]
84
83
  def bind(name, options = {}, &block)
85
- Vedeu.log(type: :event, message: "Binding: '#{name}'")
84
+ Vedeu.log(type: :event, message: "Binding: '#{name.inspect}'")
86
85
 
87
86
  new(name, options, block).bind
88
87
  end
@@ -96,7 +95,7 @@ module Vedeu
96
95
  def unbind(name)
97
96
  return false unless Vedeu.events.registered?(name)
98
97
 
99
- Vedeu.log(type: :event, message: "Unbinding: '#{name}")
98
+ Vedeu.log(type: :event, message: "Unbinding: '#{name.inspect}'")
100
99
 
101
100
  Vedeu.events.remove(name)
102
101
  true
@@ -156,12 +155,29 @@ module Vedeu
156
155
 
157
156
  private
158
157
 
159
- attr_reader :closure, :name
160
- attr_accessor :deadline, :executed_at, :now
158
+ # @!attribute [r] closure
159
+ # @return [String]
160
+ attr_reader :closure
161
+
162
+ # @!attribute [r] name
163
+ # @return [String]
164
+ attr_reader :name
165
+
166
+ # @!attribute [rw] deadline
167
+ # @return [String]
168
+ attr_accessor :deadline
169
+
170
+ # @!attribute [rw] executed_at
171
+ # @return [String]
172
+ attr_accessor :executed_at
173
+
174
+ # @!attribute [rw] now
175
+ # @return [String]
176
+ attr_accessor :now
161
177
 
162
178
  # Execute the code stored in the event closure.
163
179
  #
164
- # @param args []
180
+ # @param args [void]
165
181
  # @return [void]
166
182
  def execute(*args)
167
183
  reset_deadline
@@ -170,7 +186,7 @@ module Vedeu
170
186
 
171
187
  reset_time
172
188
 
173
- Vedeu.log(type: :event, message: "Triggering: '#{name}'")
189
+ Vedeu.log(type: :event, message: "Triggering: '#{name.inspect}'")
174
190
 
175
191
  closure.call(*args)
176
192
  end
@@ -192,7 +208,7 @@ module Vedeu
192
208
  def throttle_expired?
193
209
  return true if elapsed_time > delay
194
210
 
195
- Vedeu.log(type: :event, message: "Throttling: '#{name}'")
211
+ Vedeu.log(type: :event, message: "Throttling: '#{name.inspect}'")
196
212
 
197
213
  false
198
214
  end
@@ -216,7 +232,7 @@ module Vedeu
216
232
  def debounce_expired?
217
233
  return true if set_executed > deadline
218
234
 
219
- Vedeu.log(type: :event, message: "Debouncing: '#{name}'")
235
+ Vedeu.log(type: :event, message: "Debouncing: '#{name.inspect}'")
220
236
 
221
237
  false
222
238
  end
@@ -40,9 +40,17 @@ module Vedeu
40
40
 
41
41
  private
42
42
 
43
- attr_reader :name,
44
- :args,
45
- :repository
43
+ # @!attribute [r] name
44
+ # @return [Symbol]
45
+ attr_reader :name
46
+
47
+ # @!attribute [r] args
48
+ # @return [Array]
49
+ attr_reader :args
50
+
51
+ # @!attribute [r]
52
+ # @return [Vedeu::Repository]
53
+ attr_reader :repository
46
54
 
47
55
  # @return [Array<void>|void]
48
56
  def results
@@ -2,7 +2,9 @@ require 'vedeu/geometry/bounding_area'
2
2
  require 'vedeu/geometry/content_geometry'
3
3
  require 'vedeu/geometry/coordinate'
4
4
  require 'vedeu/geometry/grid'
5
+ require 'vedeu/geometry/index_position'
5
6
  require 'vedeu/geometry/limit'
7
+ require 'vedeu/geometry/position_index'
6
8
  require 'vedeu/geometry/position'
7
9
  require 'vedeu/geometry/position_validator'
8
10
 
@@ -5,8 +5,13 @@ module Vedeu
5
5
  #
6
6
  class BoundingArea
7
7
 
8
- attr_reader :height,
9
- :width
8
+ # @!attribute [r] height
9
+ # @return [Fixnum]
10
+ attr_reader :height
11
+
12
+ # @!attribute [r] width
13
+ # @return [Fixnum]
14
+ attr_reader :width
10
15
 
11
16
  # Returns an instance of BoundingArea.
12
17
  #
@@ -41,6 +41,8 @@ module Vedeu
41
41
 
42
42
  private
43
43
 
44
+ # @!attribute [r] interface
45
+ # @return [Vedeu::Interface]
44
46
  attr_reader :interface
45
47
 
46
48
  # Returns the number of lines of content for this interface.
@@ -4,10 +4,21 @@ module Vedeu
4
4
  #
5
5
  class Coordinate
6
6
 
7
- attr_reader :height,
8
- :width,
9
- :x,
10
- :y
7
+ # @!attribute [r] height
8
+ # @return [Fixnum]
9
+ attr_reader :height
10
+
11
+ # @!attribute [r] width
12
+ # @return [Fixnum]
13
+ attr_reader :width
14
+
15
+ # @!attribute [r] x
16
+ # @return [Fixnum]
17
+ attr_reader :x
18
+
19
+ # @!attribute [r] y
20
+ # @return [Fixnum]
21
+ attr_reader :y
11
22
 
12
23
  # @param height [Fixnum]
13
24
  # @param width [Fixnum]
@@ -157,8 +168,6 @@ module Vedeu
157
168
 
158
169
  private
159
170
 
160
- attr_reader :height, :width
161
-
162
171
  # Returns the maximum y index for an area.
163
172
  #
164
173
  # @example
@@ -50,6 +50,8 @@ module Vedeu
50
50
 
51
51
  private
52
52
 
53
+ # @!attribute [r] value
54
+ # @return [Fixnum]
53
55
  attr_reader :value
54
56
 
55
57
  # Returns the width of a single column in characters.
@@ -61,7 +63,7 @@ module Vedeu
61
63
 
62
64
  # @return [Fixnum]
63
65
  def actual
64
- Terminal.width
66
+ Vedeu::Terminal.width
65
67
  end
66
68
 
67
69
  # @return [Boolean]
@@ -0,0 +1,77 @@
1
+ module Vedeu
2
+
3
+ # Converts an index into a position for the terminal.
4
+ #
5
+ # When the optional offset `oy` and `ox` params are given, the they are used
6
+ # for the starting position.
7
+ #
8
+ class IndexPosition
9
+
10
+ # @param iy [Fixnum]
11
+ # @param ix [Fixnum]
12
+ # @param oy [Fixnum]
13
+ # @param ox [Fixnum]
14
+ # @return [Array]
15
+ def self.[](iy, ix, oy = 1, ox = 1)
16
+ new(iy, ix, oy, ox).[]
17
+ end
18
+
19
+ # @param iy [Fixnum]
20
+ # @param ix [Fixnum]
21
+ # @param oy [Fixnum]
22
+ # @param ox [Fixnum]
23
+ # @return [Vedeu::IndexPosition]
24
+ def initialize(iy, ix, oy = 1, ox = 1)
25
+ @iy = iy
26
+ @ix = ix
27
+ @oy = oy
28
+ @ox = ox
29
+ end
30
+
31
+ # @return [Array]
32
+ def []
33
+ [y, x]
34
+ end
35
+
36
+ # @return [Vedeu::Position]
37
+ def to_position
38
+ Vedeu::Position.new(y, x)
39
+ end
40
+
41
+ # @return [Fixnum]
42
+ def y
43
+ (iy <= 0) ? oy : (iy + oy)
44
+ end
45
+ alias_method :first, :y
46
+
47
+ # @return [Fixnum]
48
+ def x
49
+ (ix <= 0) ? ox : (ix + ox)
50
+ end
51
+ alias_method :last, :x
52
+
53
+ private
54
+
55
+ # @return [Fixnum]
56
+ def iy
57
+ @_iy ||= (@iy <= 0) ? 0 : @iy
58
+ end
59
+
60
+ # @return [Fixnum]
61
+ def ix
62
+ @_ix ||= (@ix <= 0) ? 0 : @ix
63
+ end
64
+
65
+ # @return [Fixnum]
66
+ def oy
67
+ @_oy ||= (@oy <= 1) ? 1 : @oy
68
+ end
69
+
70
+ # @return [Fixnum]
71
+ def ox
72
+ @_ox ||= (@ox <= 1) ? 1 : @ox
73
+ end
74
+
75
+ end # IndexPosition
76
+
77
+ end # Vedeu
@@ -35,7 +35,21 @@ module Vedeu
35
35
 
36
36
  private
37
37
 
38
- attr_reader :v, :vn, :min, :max
38
+ # @!attribute [r] v
39
+ # @return [Fixnum]
40
+ attr_reader :v
41
+
42
+ # @!attribute [r] vn
43
+ # @return [Fixnum]
44
+ attr_reader :vn
45
+
46
+ # @!attribute [r] min
47
+ # @return [Fixnum]
48
+ attr_reader :min
49
+
50
+ # @!attribute [r] max
51
+ # @return [Fixnum]
52
+ attr_reader :max
39
53
 
40
54
  end # Limit
41
55
 
@@ -4,8 +4,13 @@ module Vedeu
4
4
  #
5
5
  class Position
6
6
 
7
- attr_reader :y,
8
- :x
7
+ # @!attribute [r] y
8
+ # @return [Fixnum]
9
+ attr_reader :y
10
+
11
+ # @!attribute [r] x
12
+ # @return [Fixnum]
13
+ attr_reader :x
9
14
 
10
15
  alias_method :first, :y
11
16
  alias_method :last, :x
@@ -4,8 +4,13 @@ module Vedeu
4
4
  #
5
5
  class PositionIndex
6
6
 
7
- attr_reader :y,
8
- :x
7
+ # @!attribute [r] y
8
+ # @return [Fixnum]
9
+ attr_reader :y
10
+
11
+ # @!attribute [r] x
12
+ # @return [Fixnum]
13
+ attr_reader :x
9
14
 
10
15
  alias_method :first, :y
11
16
  alias_method :last, :x
@@ -30,6 +35,11 @@ module Vedeu
30
35
  [y, x]
31
36
  end
32
37
 
38
+ # @return [Vedeu::Position]
39
+ def to_position
40
+ Vedeu::Position.new(y, x)
41
+ end
42
+
33
43
  end # PositionIndex
34
44
 
35
45
  end # Vedeu
@@ -32,7 +32,13 @@ module Vedeu
32
32
  :top,
33
33
  :bottom
34
34
 
35
- attr_accessor :x, :y
35
+ # @!attribute [rw] x
36
+ # @return [Fixnum]
37
+ attr_accessor :x
38
+
39
+ # @!attribute [rw] x
40
+ # @return [Fixnum]
41
+ attr_accessor :y
36
42
 
37
43
  # @param interface [Interface]
38
44
  # @param x [Fixnum]
@@ -63,6 +69,8 @@ module Vedeu
63
69
 
64
70
  private
65
71
 
72
+ # @!attribute [r] interface
73
+ # @return [Vedeu::Interface]
66
74
  attr_reader :interface
67
75
 
68
76
  # Validate the x and y coordinates are within the dimensions of the
@@ -1,6 +1,5 @@
1
1
  require 'vedeu/repositories/all'
2
2
  require 'vedeu/input/mapper'
3
- require 'vedeu/input/keys'
4
3
  require 'vedeu/input/key'
5
4
  require 'vedeu/input/input'
6
5
  require 'vedeu/input/keymap'
@@ -32,6 +32,8 @@ module Vedeu
32
32
 
33
33
  private
34
34
 
35
+ # @!attribute [r] reader
36
+ # @return [IO]
35
37
  attr_reader :reader
36
38
 
37
39
  # Returns the input from the terminal.
@@ -1,6 +1,7 @@
1
1
  require 'vedeu/exceptions'
2
- require 'vedeu/models/model'
2
+ require 'vedeu/repositories/all'
3
3
  require 'vedeu/dsl/components/all'
4
+ require 'vedeu/input/key'
4
5
 
5
6
  module Vedeu
6
7
 
@@ -13,12 +14,13 @@ module Vedeu
13
14
  collection Vedeu::Keys
14
15
  member Vedeu::Key
15
16
 
17
+ # @!attribute [rw] name
18
+ # @return [String]
16
19
  attr_accessor :name
17
20
 
18
21
  # @param attributes [Hash]
19
22
  # @option attributes name [String] The name of the keymap.
20
- # @option attributes keys [Vedeu::Model::Collection|Array] A collection of
21
- # keys.
23
+ # @option attributes keys [Vedeu::Keys|Array] A collection of keys.
22
24
  # @option attributes repository [Vedeu::Repository] This model's storage.
23
25
  # @return [Vedeu::Keymap]
24
26
  def initialize(attributes = {})
@@ -63,7 +63,13 @@ module Vedeu
63
63
 
64
64
  private
65
65
 
66
- attr_reader :key, :repository
66
+ # @!attribute [r] key
67
+ # @return [String|Symbol]
68
+ attr_reader :key
69
+
70
+ # @!attribute [r] repository
71
+ # @return [Vedeu::Repository]
72
+ attr_reader :repository
67
73
 
68
74
  # Is the key a global key?
69
75
  #
@@ -63,7 +63,7 @@ module Vedeu
63
63
  def execute!
64
64
  $stdin, $stdout, $stderr = @stdin, @stdout, @stderr
65
65
 
66
- Application.start(configuration)
66
+ Vedeu::Application.start(configuration)
67
67
 
68
68
  @exit_code = 0
69
69
 
@@ -1,12 +1,15 @@
1
- require 'vedeu/models/collection'
1
+ require 'vedeu/repositories/all'
2
2
 
3
- require 'vedeu/models/view/all'
3
+ require 'vedeu/models/char'
4
+ require 'vedeu/models/stream'
5
+ require 'vedeu/models/line'
6
+ require 'vedeu/models/interface'
7
+ require 'vedeu/models/composition'
4
8
 
5
9
  require 'vedeu/models/focus'
6
10
  require 'vedeu/models/geometry'
7
11
  require 'vedeu/models/group'
8
12
  require 'vedeu/models/menu'
9
- require 'vedeu/models/model'
10
13
 
11
14
  module Vedeu
12
15
  end # Vedeu