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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b6fef3c64356f6fae8e4aa5d76793f341be2a743
4
- data.tar.gz: a7f195736cbfd4e597a7381450b431a13d1b7ea3
3
+ metadata.gz: 1d8e95a7608c18620329eb247fd9dc9049609b03
4
+ data.tar.gz: 17184d93c7f354a0a8fda4669f49a9a118d4a8da
5
5
  SHA512:
6
- metadata.gz: 4223a8d24f54f96ac5dd2c1bcad229e9ec335bd5d4426091736426d9dd4a86005c7f270fb2b9ab374f59eb4e8a3fb9b0953f36f68aac65e40275bccb1ddfe8f3
7
- data.tar.gz: 91c862b85ab11f9506648a135bde2aa1c2a54d7ad87ccafd017d998fa2f7856a5c12a2d64ee2bb84c9b067ab27071ea72bdf80ff4537bfe2a253ced83b400753
6
+ metadata.gz: d4a866ae01faf6cff714482e53b58bc142efc775b6ce71dd50948a0dfe730cece1a066113e0ed1c146515239a5c73c9ba440cc65696cb42d54a79e13b6637dfd
7
+ data.tar.gz: 63369ed9af5b248f7137eb478ba82de72620dde0612b6bbd13231caa4cec28191534eb74c5d23f4a973fc2080c4fc0c34a68dc0cecfa0047460feb5e2b777f27
data/bin/vedeu CHANGED
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  puts ''
10
7
  puts 'Vedeu is a Ruby gem. This executable serves for a future in which ' \
11
8
  'Vedeu can generate a starting point for your terminal-based GUI ' \
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  require 'vedeu'
10
7
 
11
8
  class VedeuBordersApp
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  require 'vedeu'
10
7
 
11
8
  class VedeuColoursApp
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  require 'vedeu'
10
7
 
11
8
  # This example application shows how configuration works.
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  require 'vedeu'
10
7
 
11
8
  class VedeuCursorApp
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  require 'vedeu'
10
7
 
11
8
  # This example application shows how interface focus works.
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  require 'vedeu'
10
7
 
11
8
  class VedeuGeometryApp
@@ -3,9 +3,6 @@
3
3
  lib_dir = File.dirname(__FILE__) + '/../lib'
4
4
  $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
5
 
6
- -> { its -> { a } }
7
- trap('INT') { exit! }
8
-
9
6
  require 'vedeu'
10
7
 
11
8
  class VedeuLinesApp
@@ -0,0 +1 @@
1
+ Here's a simple example that will be displayed in the main interface of the application.
@@ -0,0 +1,82 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ lib_dir = File.dirname(__FILE__) + '/../../lib'
4
+ $LOAD_PATH.unshift(lib_dir) unless $LOAD_PATH.include?(lib_dir)
5
+
6
+ require 'vedeu'
7
+
8
+ class VedeuViewTemplateApp
9
+ include Vedeu
10
+
11
+ configure do
12
+ colour_mode 16777216
13
+ debug!
14
+ log '/tmp/vedeu_view_templates_app.log'
15
+ end
16
+
17
+ bind(:_initialize_) { Vedeu.trigger(:_refresh_) }
18
+
19
+ interface 'default' do
20
+ colour foreground: '#ff0000', background: '#000000'
21
+ cursor!
22
+ end
23
+
24
+ interface 'prune' do
25
+ colour foreground: '#00ff00', background: '#000000'
26
+ cursor!
27
+ end
28
+
29
+ interface 'wrap' do
30
+ colour foreground: '#0000ff', background: '#000000'
31
+ cursor!
32
+ end
33
+
34
+ keymap('_global_') do
35
+ key(:up, 'k') { Vedeu.trigger(:_cursor_up_) }
36
+ key(:right, 'l') { Vedeu.trigger(:_cursor_right_) }
37
+ key(:down, 'j') { Vedeu.trigger(:_cursor_down_) }
38
+ key(:left, 'h') { Vedeu.trigger(:_cursor_left_) }
39
+ end
40
+
41
+ border('default') do
42
+ colour foreground: '#aadd00', background: '#000000'
43
+ end
44
+ border('prune') do
45
+ colour foreground: '#aadd00', background: '#000000'
46
+ end
47
+ border('wrap') do
48
+ colour foreground: '#aadd00', background: '#000000'
49
+ end
50
+
51
+ geometry('prune') do
52
+ centred!
53
+ height 6
54
+ width 25
55
+ end
56
+
57
+ geometry 'default' do
58
+ height 6
59
+ width 25
60
+ x Vedeu.use('prune').left
61
+ y Vedeu.use('prune').north(7)
62
+ end
63
+
64
+ geometry 'wrap' do
65
+ height 6
66
+ width 25
67
+ x Vedeu.use('prune').left
68
+ y Vedeu.use('prune').south(1)
69
+ end
70
+
71
+ renders do
72
+ template_for('default', (File.dirname(__FILE__) + '/template.erb'), nil)
73
+ template_for('prune', (File.dirname(__FILE__) + '/template.erb'), nil, { mode: :prune, width: 22 })
74
+ template_for('wrap', (File.dirname(__FILE__) + '/template.erb'), nil, { mode: :wrap, width: 25 })
75
+ end
76
+
77
+ def self.start(argv = ARGV)
78
+ Vedeu::Launcher.execute!(argv)
79
+ end
80
+ end
81
+
82
+ VedeuViewTemplateApp.start(ARGV)
data/lib/vedeu/all.rb CHANGED
@@ -24,7 +24,6 @@ require 'vedeu/dsl/all'
24
24
 
25
25
  require 'vedeu/events/all'
26
26
  require 'vedeu/input/all'
27
- require 'vedeu/models/all'
28
27
  require 'vedeu/output/all'
29
28
  require 'vedeu/support/all'
30
29
 
@@ -51,8 +51,8 @@ module Vedeu
51
51
  def start
52
52
  Vedeu.trigger(:_drb_start_)
53
53
 
54
- output = Terminal.open do
55
- Terminal.set_cursor_mode
54
+ output = Vedeu::Terminal.open do
55
+ Vedeu::Terminal.set_cursor_mode
56
56
 
57
57
  Vedeu.trigger(:_initialize_)
58
58
 
@@ -66,6 +66,7 @@ module Vedeu
66
66
 
67
67
  private
68
68
 
69
+ # @!attribute [r] configuration
69
70
  # @return [Configuration]
70
71
  attr_reader :configuration
71
72
 
@@ -93,7 +94,7 @@ module Vedeu
93
94
  # @return [void]
94
95
  def main_sequence
95
96
  if configuration.interactive?
96
- Input.capture(Terminal)
97
+ Vedeu::Input.capture(Terminal)
97
98
 
98
99
  else
99
100
  Vedeu.trigger(:_standalone_)
@@ -107,14 +108,14 @@ module Vedeu
107
108
  #
108
109
  # @return [void]
109
110
  def run_many
110
- MainLoop.start! { yield }
111
+ Vedeu::MainLoop.start! { yield }
111
112
 
112
113
  rescue ModeSwitch
113
- Terminal.switch_mode!
114
+ Vedeu::Terminal.switch_mode!
114
115
 
115
116
  Vedeu.trigger(:_drb_restart_)
116
117
 
117
- Application.restart(configuration)
118
+ Vedeu::Application.restart(configuration)
118
119
 
119
120
  end
120
121
 
@@ -80,30 +80,30 @@ module Vedeu
80
80
  Vedeu.bind(:_cursor_hide_) do |name|
81
81
  named = name ? Vedeu.cursors.by_name(name) : Vedeu.cursor
82
82
 
83
- ToggleCursor.hide(named)
83
+ Vedeu::ToggleCursor.hide(named)
84
84
  end
85
85
 
86
86
  # Show the cursor of the named interface or interface currently in focus.
87
87
  Vedeu.bind(:_cursor_show_) do |name|
88
88
  named = name ? Vedeu.cursors.by_name(name) : Vedeu.cursor
89
89
 
90
- ToggleCursor.show(named)
90
+ Vedeu::ToggleCursor.show(named)
91
91
  end
92
92
 
93
93
  # @see {Vedeu::MoveCursor}
94
- Vedeu.bind(:_cursor_down_) { |name| MoveCursor.by_name(:down, name) }
94
+ Vedeu.bind(:_cursor_down_) { |name| Vedeu::MoveCursor.by_name(:down, name) }
95
95
 
96
96
  # @see {Vedeu::MoveCursor}
97
- Vedeu.bind(:_cursor_left_) { |name| MoveCursor.by_name(:left, name) }
97
+ Vedeu.bind(:_cursor_left_) { |name| Vedeu::MoveCursor.by_name(:left, name) }
98
98
 
99
99
  # @see {Vedeu::MoveCursor}
100
- Vedeu.bind(:_cursor_right_) { |name| MoveCursor.by_name(:right, name) }
100
+ Vedeu.bind(:_cursor_right_) { |name| Vedeu::MoveCursor.by_name(:right, name) }
101
101
 
102
102
  # @see {Vedeu::MoveCursor}
103
- Vedeu.bind(:_cursor_up_) { |name| MoveCursor.by_name(:up, name) }
103
+ Vedeu.bind(:_cursor_up_) { |name| Vedeu::MoveCursor.by_name(:up, name) }
104
104
 
105
105
  # @see {Vedeu::MoveCursor}
106
- Vedeu.bind(:_cursor_origin_) { |name| MoveCursor.by_name(:origin, name) }
106
+ Vedeu.bind(:_cursor_origin_) { |name| Vedeu::MoveCursor.by_name(:origin, name) }
107
107
 
108
108
  # @see {Vedeu::MoveCursor}
109
109
  Vedeu.bind(:_cursor_reset_) { |name| Vedeu.trigger(:_cursor_origin_, name) }
@@ -161,7 +161,7 @@ module Vedeu
161
161
  # if given.
162
162
  Vedeu.bind(:_clear_) do |name|
163
163
  if name && Vedeu.interfaces.registered?(name)
164
- Vedeu::Output.clear(Vedeu.interfaces.find(name))
164
+ Vedeu::Clear.clear(Vedeu.interfaces.find(name))
165
165
 
166
166
  else
167
167
  Vedeu::Terminal.virtual.clear if Vedeu::Configuration.drb?
@@ -1,4 +1,4 @@
1
- require 'vedeu/models/model'
1
+ require 'vedeu/repositories/model'
2
2
 
3
3
  module Vedeu
4
4
 
@@ -16,10 +16,20 @@ module Vedeu
16
16
 
17
17
  include Vedeu::Model
18
18
 
19
- attr_accessor :back,
20
- :front,
21
- :previous
19
+ # @!attribute [rw] back
20
+ # @return [Interface]
21
+ attr_accessor :back
22
22
 
23
+ # @!attribute [rw] front
24
+ # @return [Interface]
25
+ attr_accessor :front
26
+
27
+ # @!attribute [rw] previous
28
+ # @return [Interface]
29
+ attr_accessor :previous
30
+
31
+ # @!attribute [r] name
32
+ # @return [String]
23
33
  attr_reader :name
24
34
 
25
35
  # Return a new instance of Buffer.
@@ -1,4 +1,4 @@
1
- require 'vedeu/repositories/repository'
1
+ require 'vedeu/repositories/all'
2
2
 
3
3
  module Vedeu
4
4
 
@@ -48,7 +48,7 @@ module Vedeu
48
48
  Vedeu.buffers.find(name).add(self)
49
49
 
50
50
  else
51
- Buffer.new(name, self).store
51
+ Vedeu::Buffer.new(name, self).store
52
52
 
53
53
  end
54
54
 
@@ -124,7 +124,13 @@ module Vedeu
124
124
 
125
125
  private
126
126
 
127
- attr_reader :args, :options
127
+ # @!attribute [r] args
128
+ # @return [Array<String>]
129
+ attr_reader :args
130
+
131
+ # @!attribute [r] options
132
+ # @return [Hash]
133
+ attr_reader :options
128
134
 
129
135
  end # CLI
130
136
 
@@ -214,6 +214,8 @@ module Vedeu
214
214
 
215
215
  end # Configuration eigenclass
216
216
 
217
+ # @!attribute [r] options
218
+ # @return [Hash]
217
219
  attr_reader :options
218
220
 
219
221
  # Create a new singleton instance of Configuration.
@@ -237,7 +239,7 @@ module Vedeu
237
239
 
238
240
  @options.merge!(Config::CLI.configure(args)) if args.any?
239
241
 
240
- Configuration
242
+ Vedeu::Configuration
241
243
  end
242
244
 
243
245
  # Reset the configuration to the default values.
@@ -268,7 +270,7 @@ module Vedeu
268
270
  stdin: nil,
269
271
  stdout: nil,
270
272
  stderr: nil,
271
- system_keys: Configuration.default_system_keys,
273
+ system_keys: Vedeu::Configuration.default_system_keys,
272
274
  terminal_mode: :raw,
273
275
  trace: false,
274
276
  }
@@ -1,4 +1,4 @@
1
- require 'vedeu/repositories/repository'
1
+ require 'vedeu/repositories/all'
2
2
  require 'vedeu/cursor/cursor'
3
3
  require 'vedeu/cursor/move_cursor'
4
4
  require 'vedeu/cursor/toggle_cursor'
@@ -1,5 +1,4 @@
1
1
  require 'vedeu/cursor/all'
2
- require 'vedeu/models/model'
3
2
  require 'vedeu/geometry/position'
4
3
  require 'vedeu/support/visible'
5
4
 
@@ -16,7 +15,33 @@ module Vedeu
16
15
 
17
16
  include Vedeu::Model
18
17
 
19
- attr_reader :attributes, :name, :ox, :oy, :state, :x, :y
18
+ # @!attribute [r] attributes
19
+ # @return [Hash]
20
+ attr_reader :attributes
21
+
22
+ # @!attribute [r] name
23
+ # @return [String]
24
+ attr_reader :name
25
+
26
+ # @!attribute [r] ox
27
+ # @return [Fixnum]
28
+ attr_reader :ox
29
+
30
+ # @!attribute [r] oy
31
+ # @return [Fixnum]
32
+ attr_reader :oy
33
+
34
+ # @!attribute [r] state
35
+ # @return [Boolean|Symbol]
36
+ attr_reader :state
37
+
38
+ # @!attribute [r] x
39
+ # @return [Fixnum]
40
+ attr_reader :x
41
+
42
+ # @!attribute [r] y
43
+ # @return [Fixnum]
44
+ attr_reader :y
20
45
 
21
46
  # Returns a new instance of Cursor.
22
47
  #
@@ -70,6 +95,8 @@ module Vedeu
70
95
 
71
96
  private
72
97
 
98
+ # @!attribute [r] position
99
+ # @return [Vedeu::Position]
73
100
  attr_reader :position
74
101
 
75
102
  # The default values for a new instance of this class.
@@ -74,14 +74,14 @@ module Vedeu
74
74
  if name
75
75
  cursor = Vedeu.cursors.by_name(name)
76
76
  interface = Vedeu.interfaces.find(name)
77
- new_cursor = MoveCursor.send(direction, cursor, interface)
78
- Refresh.by_name(name)
77
+ new_cursor = Vedeu::MoveCursor.send(direction, cursor, interface)
78
+ Vedeu::Refresh.by_name(name)
79
79
 
80
80
  else
81
81
  cursor = Vedeu.cursor
82
82
  interface = Vedeu.interfaces.current
83
- new_cursor = MoveCursor.send(direction, cursor, interface)
84
- Refresh.by_focus
83
+ new_cursor = Vedeu::MoveCursor.send(direction, cursor, interface)
84
+ Vedeu::Refresh.by_focus
85
85
 
86
86
  end
87
87
  new_cursor
@@ -140,12 +140,26 @@ module Vedeu
140
140
  #
141
141
  # @return [Cursor]
142
142
  def move
143
- Cursor.new(cursor.attributes.merge!(moved_attributes)).store
143
+ Vedeu::Cursor.new(cursor.attributes.merge!(moved_attributes)).store
144
144
  end
145
145
 
146
146
  private
147
147
 
148
- attr_reader :cursor, :dx, :dy, :interface
148
+ # @!attribute [r] cursor
149
+ # @return [Vedeu::Cursor]
150
+ attr_reader :cursor
151
+
152
+ # @!attribute [r] dx
153
+ # @return [Fixnum]
154
+ attr_reader :dx
155
+
156
+ # @!attribute [r] dy
157
+ # @return [Fixnum]
158
+ attr_reader :dy
159
+
160
+ # @!attribute [r] interface
161
+ # @return [Vedeu::Interface]
162
+ attr_reader :interface
149
163
 
150
164
  # @return [Hash]
151
165
  def moved_attributes
@@ -48,6 +48,8 @@ module Vedeu
48
48
 
49
49
  private
50
50
 
51
+ # @!attribute [r] cursor
52
+ # @return [Vedeu::Cursor]
51
53
  attr_reader :cursor
52
54
 
53
55
  end # ToggleCursor
@@ -91,6 +91,8 @@ module Vedeu
91
91
 
92
92
  private
93
93
 
94
+ # @!attribute [r] uri
95
+ # @return [String]
94
96
  attr_reader :uri
95
97
 
96
98
  # @return [void]
@@ -97,7 +97,7 @@ module Vedeu
97
97
 
98
98
  Vedeu.trigger(:_exit_)
99
99
 
100
- Terminal.restore_screen
100
+ Vedeu::Terminal.restore_screen
101
101
  end
102
102
 
103
103
  # @return [Vedeu::Distributed::Server]
@@ -161,6 +161,8 @@ module Vedeu
161
161
 
162
162
  private
163
163
 
164
+ # @!attribute [r] configuration
165
+ # @return [Configuration]
164
166
  attr_reader :configuration
165
167
 
166
168
  # @return [Boolean]
@@ -44,7 +44,12 @@ module Vedeu
44
44
 
45
45
  private
46
46
 
47
- attr_reader :application
47
+ # @!attribute [r] application
48
+ # @return [Vedeu::TestApplication]
49
+ attr_reader :application
50
+
51
+ # @!attribute [rw] pid
52
+ # @return [Fixnum]
48
53
  attr_accessor :pid
49
54
 
50
55
  # @return [String]
@@ -16,14 +16,37 @@ module Vedeu
16
16
  #
17
17
  class TestApplication
18
18
 
19
- attr_accessor :borders,
20
- :configuration,
21
- :events,
22
- :geometries,
23
- :interfaces,
24
- :keymaps,
25
- :menus,
26
- :views
19
+ # @!attribute [rw] borders
20
+ # @return [String]
21
+ attr_accessor :borders
22
+
23
+ # @!attribute [rw] configuration
24
+ # @return [String]
25
+ attr_accessor :configuration
26
+
27
+ # @!attribute [rw] events
28
+ # @return [String]
29
+ attr_accessor :events
30
+
31
+ # @!attribute [rw] geometries
32
+ # @return [String]
33
+ attr_accessor :geometries
34
+
35
+ # @!attribute [rw] interfaces
36
+ # @return [String]
37
+ attr_accessor :interfaces
38
+
39
+ # @!attribute [rw] keymaps
40
+ # @return [String]
41
+ attr_accessor :keymaps
42
+
43
+ # @!attribute [rw] menus
44
+ # @return [String]
45
+ attr_accessor :menus
46
+
47
+ # @!attribute [rw] views
48
+ # @return [String]
49
+ attr_accessor :views
27
50
 
28
51
  # @param attributes [Hash]
29
52
  # @param block [Proc]
@@ -55,7 +78,7 @@ module Vedeu
55
78
  def build(&block)
56
79
  self.instance_eval(&block) if block_given?
57
80
 
58
- Template.parse(self, template)
81
+ Vedeu::Template.parse(self, template)
59
82
  end
60
83
 
61
84
  # @return [String]
@@ -7,7 +7,13 @@ module Vedeu
7
7
  #
8
8
  class Uri
9
9
 
10
- attr_reader :host, :port
10
+ # @!attribute [r] host
11
+ # @return [String]
12
+ attr_reader :host
13
+
14
+ # @!attribute [r] port
15
+ # @return [Fixnum|String]
16
+ attr_reader :port
11
17
 
12
18
  # @param host [String] Hostname or IP address.
13
19
  # @param port [Fixnum|String]
@@ -275,9 +275,11 @@ module Vedeu
275
275
 
276
276
  private
277
277
 
278
+ # @!attribute [r] client
278
279
  # @return [Object]
279
280
  attr_reader :client
280
281
 
282
+ # @!attribute [r] model
281
283
  # @return [Border]
282
284
  attr_reader :model
283
285
 
@@ -136,9 +136,11 @@ module Vedeu
136
136
 
137
137
  private
138
138
 
139
+ # @!attribute [r] client
139
140
  # @return [Object]
140
141
  attr_reader :client
141
142
 
143
+ # @!attribute [r] model
142
144
  # @return [Geometry]
143
145
  attr_reader :model
144
146
 
@@ -126,9 +126,11 @@ module Vedeu
126
126
 
127
127
  private
128
128
 
129
+ # @!attribute [r] client
129
130
  # @return [Object]
130
131
  attr_reader :client
131
132
 
133
+ # @!attribute [r] model
132
134
  # @return [Keymap]
133
135
  attr_reader :model
134
136
 
@@ -75,10 +75,12 @@ module Vedeu
75
75
 
76
76
  private
77
77
 
78
+ # @!attribute [r] client
78
79
  # @return [Object]
79
80
  attr_reader :client
80
81
 
81
- # @return [Menu]
82
+ # @!attribute [r] model
83
+ # @return [Vedeu::Menu]
82
84
  attr_reader :model
83
85
 
84
86
  end # Menu