vedeu 0.6.10 → 0.6.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/lib/vedeu/all.rb +17 -103
  3. data/lib/vedeu/api/all.rb +15 -0
  4. data/lib/vedeu/api/internal.rb +4 -0
  5. data/lib/vedeu/application/all.rb +6 -0
  6. data/lib/vedeu/bindings/all.rb +32 -0
  7. data/lib/vedeu/bindings/bindings.rb +0 -14
  8. data/lib/vedeu/bindings/refresh.rb +8 -2
  9. data/lib/vedeu/bindings/system.rb +1 -0
  10. data/lib/vedeu/borders/border.rb +1 -1
  11. data/lib/vedeu/borders/repository.rb +1 -1
  12. data/lib/vedeu/buffers/buffer.rb +2 -4
  13. data/lib/vedeu/buffers/repository.rb +1 -1
  14. data/lib/vedeu/colours/background.rb +1 -1
  15. data/lib/vedeu/colours/backgrounds.rb +1 -1
  16. data/lib/vedeu/colours/foreground.rb +1 -1
  17. data/lib/vedeu/colours/foregrounds.rb +1 -1
  18. data/lib/vedeu/colours/translator.rb +4 -3
  19. data/lib/vedeu/configuration/api.rb +2 -1
  20. data/lib/vedeu/configuration/cli.rb +1 -1
  21. data/lib/vedeu/cursors/cursor.rb +26 -26
  22. data/lib/vedeu/cursors/repository.rb +1 -1
  23. data/lib/vedeu/distributed/all.rb +16 -0
  24. data/lib/vedeu/distributed/test_application.rb +3 -3
  25. data/lib/vedeu/dsl/all.rb +22 -0
  26. data/lib/vedeu/dsl/composition.rb +43 -40
  27. data/lib/vedeu/dsl/dsl.rb +6 -3
  28. data/lib/vedeu/dsl/group.rb +23 -16
  29. data/lib/vedeu/dsl/interface.rb +48 -38
  30. data/lib/vedeu/dsl/keymap.rb +6 -7
  31. data/lib/vedeu/dsl/line.rb +6 -3
  32. data/lib/vedeu/dsl/stream.rb +2 -1
  33. data/lib/vedeu/editor/cursor.rb +1 -3
  34. data/lib/vedeu/editor/document.rb +4 -5
  35. data/lib/vedeu/editor/documents.rb +1 -1
  36. data/lib/vedeu/editor/line.rb +2 -3
  37. data/lib/vedeu/editor/lines.rb +2 -3
  38. data/lib/vedeu/esc/all.rb +14 -0
  39. data/lib/vedeu/esc/colours.rb +8 -4
  40. data/lib/vedeu/esc/esc.rb +89 -84
  41. data/lib/vedeu/events/aliases.rb +1 -2
  42. data/lib/vedeu/events/collection.rb +1 -1
  43. data/lib/vedeu/events/event.rb +1 -1
  44. data/lib/vedeu/events/repository.rb +1 -1
  45. data/lib/vedeu/events/trigger.rb +11 -9
  46. data/lib/vedeu/geometry/dimension.rb +1 -3
  47. data/lib/vedeu/geometry/generic_coordinate.rb +1 -3
  48. data/lib/vedeu/geometry/geometry.rb +1 -1
  49. data/lib/vedeu/geometry/repository.rb +3 -3
  50. data/lib/vedeu/input/all.rb +3 -0
  51. data/lib/vedeu/input/keymap.rb +10 -11
  52. data/lib/vedeu/input/keymaps.rb +1 -1
  53. data/lib/vedeu/input/keys.rb +1 -1
  54. data/lib/vedeu/input/mapper.rb +14 -12
  55. data/lib/vedeu/logging/all.rb +3 -0
  56. data/lib/vedeu/logging/log.rb +4 -2
  57. data/lib/vedeu/menus/menu.rb +2 -4
  58. data/lib/vedeu/menus/repository.rb +1 -1
  59. data/lib/vedeu/models/all.rb +15 -0
  60. data/lib/vedeu/models/cell.rb +1 -1
  61. data/lib/vedeu/models/escape.rb +1 -1
  62. data/lib/vedeu/models/group.rb +4 -3
  63. data/lib/vedeu/models/groups.rb +1 -1
  64. data/lib/vedeu/models/interface.rb +1 -1
  65. data/lib/vedeu/models/interfaces.rb +1 -1
  66. data/lib/vedeu/models/views/char.rb +1 -1
  67. data/lib/vedeu/models/views/collections/chars.rb +1 -1
  68. data/lib/vedeu/models/views/collections/lines.rb +1 -1
  69. data/lib/vedeu/models/views/collections/streams.rb +1 -1
  70. data/lib/vedeu/models/views/collections/view_collection.rb +1 -1
  71. data/lib/vedeu/models/views/composition.rb +1 -1
  72. data/lib/vedeu/models/views/line.rb +8 -6
  73. data/lib/vedeu/models/views/stream.rb +1 -1
  74. data/lib/vedeu/models/views/view.rb +1 -1
  75. data/lib/vedeu/null/all.rb +12 -0
  76. data/lib/vedeu/output/clear/named_group.rb +2 -1
  77. data/lib/vedeu/output/clear/named_interface.rb +5 -4
  78. data/lib/vedeu/output/compressor.rb +1 -0
  79. data/lib/vedeu/output/output.rb +3 -0
  80. data/lib/vedeu/output/presentation/colour.rb +10 -10
  81. data/lib/vedeu/output/presentation/presentation.rb +9 -9
  82. data/lib/vedeu/output/presentation/style.rb +2 -2
  83. data/lib/vedeu/output/refresh/refresh.rb +35 -0
  84. data/lib/vedeu/output/refresh/refresh_group.rb +66 -0
  85. data/lib/vedeu/output/renderers/all.rb +17 -0
  86. data/lib/vedeu/output/renderers/escape_sequence.rb +4 -2
  87. data/lib/vedeu/output/renderers/file.rb +7 -6
  88. data/lib/vedeu/output/renderers/html.rb +9 -7
  89. data/lib/vedeu/output/renderers/null.rb +1 -1
  90. data/lib/vedeu/output/renderers/renderer_options.rb +24 -20
  91. data/lib/vedeu/output/renderers/terminal.rb +1 -1
  92. data/lib/vedeu/output/renderers/text.rb +1 -1
  93. data/lib/vedeu/output/wordwrap.rb +7 -4
  94. data/lib/vedeu/plugins/all.rb +2 -0
  95. data/lib/vedeu/repositories/all.rb +16 -0
  96. data/lib/vedeu/repositories/collection.rb +93 -89
  97. data/lib/vedeu/repositories/model.rb +113 -102
  98. data/lib/vedeu/repositories/registerable.rb +60 -56
  99. data/lib/vedeu/repositories/repository.rb +161 -156
  100. data/lib/vedeu/repositories/store.rb +70 -66
  101. data/lib/vedeu/runtime/all.rb +15 -0
  102. data/lib/vedeu/runtime/launcher.rb +19 -16
  103. data/lib/vedeu/templating/all.rb +6 -0
  104. data/lib/vedeu/terminal/all.rb +14 -0
  105. data/lib/vedeu/terminal/buffer.rb +8 -7
  106. data/lib/vedeu/terminal/mode.rb +11 -10
  107. data/lib/vedeu/terminal/terminal.rb +50 -45
  108. data/lib/vedeu/version.rb +1 -1
  109. data/test/lib/vedeu/cursors/cursor_test.rb +4 -2
  110. data/test/lib/vedeu/editor/cursor_test.rb +0 -3
  111. data/test/lib/vedeu/esc/esc_test.rb +58 -54
  112. data/test/lib/vedeu/events/collection_test.rb +1 -1
  113. data/test/lib/vedeu/input/keys_test.rb +1 -1
  114. data/test/lib/vedeu/input/mapper_test.rb +1 -1
  115. data/test/lib/vedeu/models/views/collections/chars_test.rb +1 -1
  116. data/test/lib/vedeu/models/views/collections/lines_test.rb +1 -1
  117. data/test/lib/vedeu/models/views/collections/streams_test.rb +1 -1
  118. data/test/lib/vedeu/models/views/collections/view_collection_test.rb +1 -1
  119. data/test/lib/vedeu/output/refresh/refresh_group_test.rb +43 -0
  120. data/test/lib/vedeu/output/refresh/refresh_test.rb +50 -0
  121. data/test/lib/vedeu/output/renderers/renderer_options_test.rb +8 -4
  122. data/test/lib/vedeu/output/renderers_test.rb +2 -1
  123. data/test/lib/vedeu/repositories/collection_test.rb +105 -101
  124. data/test/lib/vedeu/repositories/model_test.rb +56 -52
  125. data/test/lib/vedeu/repositories/registerable_test.rb +36 -32
  126. data/test/lib/vedeu/repositories/repository_test.rb +178 -174
  127. data/test/lib/vedeu/repositories/store_test.rb +109 -105
  128. data/test/support/examples/material_colours_app.rb +0 -1
  129. data/test/support/helpers/model_test_class.rb +50 -46
  130. data/test/test_helper.rb +2 -2
  131. metadata +21 -9
  132. data/lib/vedeu/refresh/refresh.rb +0 -31
  133. data/lib/vedeu/refresh/refresh_group.rb +0 -59
  134. data/out_ +0 -50
  135. data/test/lib/vedeu/refresh/refresh_group_test.rb +0 -39
  136. data/test/lib/vedeu/refresh/refresh_test.rb +0 -46
@@ -1,188 +1,193 @@
1
1
  module Vedeu
2
2
 
3
- # Provides common methods for accessing the various repositories
4
- # Vedeu uses.
5
- #
6
- # @example
7
- # { 'models' => [Model, Model, Model] }
8
- #
9
- # { 'models' => [Model] }
10
- #
11
- class Repository
12
-
13
- include Vedeu::Common
14
- include Vedeu::Registerable
15
- include Vedeu::Store
16
-
17
- # @!attribute [r] model
18
- # @return [void]
19
- attr_reader :model
20
-
21
- # @!attribute [r] storage
22
- # @return [void]
23
- attr_reader :storage
24
-
25
- # Returns a new instance of Vedeu::Repository.
26
- #
27
- # @param model [Class]
28
- # @param storage [Class|Hash]
29
- # @return [Vedeu::Repository]
30
- def initialize(model = nil, storage = {})
31
- @model = model
32
- @storage = storage
33
- end
34
-
35
- # Returns the repository class.
36
- #
37
- # @return [Class]
38
- def repository
39
- self.class
40
- end
41
-
42
- # Return all the registered models.
43
- #
44
- # @return [Array<void>] An array containing each stored model.
45
- def all
46
- return storage.values if storage.is_a?(Hash)
47
-
48
- registered
49
- end
3
+ module Repositories
50
4
 
51
- # Return the named model or a null object if not registered.
5
+ # Provides common methods for accessing the various repositories
6
+ # Vedeu uses.
52
7
  #
53
8
  # @example
54
- # # Fetch the cursor belonging to the interface of the same
55
- # # name.
56
- # Vedeu.cursors.by_name('some_name')
9
+ # { 'models' => [Model, Model, Model] }
57
10
  #
58
- # # Fetch the names of the interfaces belonging to this group.
59
- # Vedeu.groups.by_name(name)
11
+ # { 'models' => [Model] }
60
12
  #
61
- # @param name [String] The name of the stored model.
62
- # @return [void]
63
- def by_name(name)
64
- name ||= Vedeu.focus
13
+ class Repository
14
+
15
+ include Vedeu::Common
16
+ include Vedeu::Repositories::Registerable
17
+ include Vedeu::Repositories::Store
18
+
19
+ # @!attribute [r] model
20
+ # @return [void]
21
+ attr_reader :model
22
+
23
+ # @!attribute [r] storage
24
+ # @return [void]
25
+ attr_reader :storage
26
+
27
+ # Returns a new instance of Vedeu::Repositories::Repository.
28
+ #
29
+ # @param model [Class]
30
+ # @param storage [Class|Hash]
31
+ # @return [Vedeu::Repositories::Repository]
32
+ def initialize(model = nil, storage = {})
33
+ @model = model
34
+ @storage = storage
35
+ end
65
36
 
66
- if registered?(name)
67
- find(name)
37
+ # Returns the repository class.
38
+ #
39
+ # @return [Class]
40
+ def repository
41
+ self.class
42
+ end
68
43
 
69
- else
70
- null_model.new(name: name)
44
+ # Return all the registered models.
45
+ #
46
+ # @return [Array<void>] An array containing each stored model.
47
+ def all
48
+ return storage.values if storage.is_a?(Hash)
71
49
 
50
+ registered
72
51
  end
73
- end
74
52
 
75
- # Return the model for the interface currently in focus.
76
- #
77
- # @return [String|NilClass]
78
- def current
79
- find_or_create(Vedeu.focus) if Vedeu.focus
80
- end
53
+ # Return the named model or a null object if not registered.
54
+ #
55
+ # @example
56
+ # # Fetch the cursor belonging to the interface of the same
57
+ # # name.
58
+ # Vedeu.cursors.by_name('some_name')
59
+ #
60
+ # # Fetch the names of the interfaces belonging to this group.
61
+ # Vedeu.groups.by_name(name)
62
+ #
63
+ # @param name [String] The name of the stored model.
64
+ # @return [void]
65
+ def by_name(name)
66
+ name ||= Vedeu.focus
67
+
68
+ if registered?(name)
69
+ find(name)
70
+
71
+ else
72
+ null_model.new(name: name)
73
+
74
+ end
75
+ end
81
76
 
82
- # Find the model by name.
83
- #
84
- # @param name [String]
85
- # @return [Hash<String => Object>|NilClass]
86
- def find(name)
87
- storage[name]
88
- end
89
-
90
- # Find the model attributes by name, raises an exception when the
91
- # model cannot be found.
92
- #
93
- # @param name [String]
94
- # @raise [Vedeu::Error::ModelNotFound] When the model cannot be
95
- # found with this name.
96
- # @return [Hash<String => Object>]
97
- def find!(name)
98
- find(name) || fail(Vedeu::Error::ModelNotFound,
99
- "Cannot find model by name: '#{name}'")
100
- end
101
-
102
- # Find a model by name, registers the model by name when not
103
- # found.
104
- #
105
- # @param name [String]
106
- # @return [void]
107
- def find_or_create(name)
108
- if registered?(name)
109
- find(name)
77
+ # Return the model for the interface currently in focus.
78
+ #
79
+ # @return [String|NilClass]
80
+ def current
81
+ find_or_create(Vedeu.focus) if Vedeu.focus
82
+ end
110
83
 
111
- else
112
- Vedeu.log(type: :store,
113
- message: "Model (#{model}) not found, registering: '#{name}'")
84
+ # Find the model by name.
85
+ #
86
+ # @param name [String]
87
+ # @return [Hash<String => Object>|NilClass]
88
+ def find(name)
89
+ storage[name]
90
+ end
114
91
 
115
- model.new(name).store
92
+ # Find the model attributes by name, raises an exception when
93
+ # the model cannot be found.
94
+ #
95
+ # @param name [String]
96
+ # @raise [Vedeu::Error::ModelNotFound] When the model cannot be
97
+ # found with this name.
98
+ # @return [Hash<String => Object>]
99
+ def find!(name)
100
+ find(name) || fail(Vedeu::Error::ModelNotFound,
101
+ "Cannot find model by name: '#{name}'")
116
102
  end
117
- end
118
103
 
119
- # @return [String]
120
- def inspect
121
- "<#{self.class.name}>"
122
- end
104
+ # Find a model by name, registers the model by name when not
105
+ # found.
106
+ #
107
+ # @param name [String]
108
+ # @return [void]
109
+ def find_or_create(name)
110
+ if registered?(name)
111
+ find(name)
112
+
113
+ else
114
+ Vedeu.log(type: :store,
115
+ message: "Model (#{model}) not found, " \
116
+ "registering: '#{name}'")
117
+
118
+ model.new(name).store
119
+ end
120
+ end
123
121
 
124
- # Returns a boolean indicating whether the named model is
125
- # registered.
126
- #
127
- # @param name [String]
128
- # @return [Boolean]
129
- def registered?(name)
130
- return false if name.nil? || name.empty?
131
- return false if empty?
122
+ # @return [String]
123
+ def inspect
124
+ "<#{self.class.name}>"
125
+ end
132
126
 
133
- storage.include?(name)
134
- end
127
+ # Returns a boolean indicating whether the named model is
128
+ # registered.
129
+ #
130
+ # @param name [String]
131
+ # @return [Boolean]
132
+ def registered?(name)
133
+ return false if name.nil? || name.empty?
134
+ return false if empty?
135
135
 
136
- # Returns the storage with the named model removed, or false when
137
- # the model does not exist.
138
- #
139
- # @param name [String]
140
- # @return [Hash|FalseClass]
141
- def remove(name)
142
- return false if empty?
136
+ storage.include?(name)
137
+ end
143
138
 
144
- if registered?(name)
145
- storage.delete(name)
146
- storage unless storage.is_a?(Set)
139
+ # Returns the storage with the named model removed, or false
140
+ # when the model does not exist.
141
+ #
142
+ # @param name [String]
143
+ # @return [Hash|FalseClass]
144
+ def remove(name)
145
+ return false if empty?
147
146
 
148
- else
149
- false
147
+ if registered?(name)
148
+ storage.delete(name)
149
+ storage unless storage.is_a?(Set)
150
150
 
151
- end
152
- end
153
- alias_method :destroy, :remove
154
- alias_method :delete, :remove
155
- alias_method :deregister, :remove
151
+ else
152
+ false
156
153
 
157
- # Stores the model instance by name in the repository of the
158
- # model.
159
- #
160
- # @param model [void] A model instance.
161
- # @raise [Vedeu::Error::MissingRequired] When the name attribute
162
- # is not defined.
163
- # @return [void] The model instance which was stored.
164
- def store(model)
165
- unless present?(model.name)
166
- fail Vedeu::Error::MissingRequired,
167
- "Cannot store model '#{model.class}' without a name attribute."
154
+ end
168
155
  end
156
+ alias_method :destroy, :remove
157
+ alias_method :delete, :remove
158
+ alias_method :deregister, :remove
159
+
160
+ # Stores the model instance by name in the repository of the
161
+ # model.
162
+ #
163
+ # @param model [void] A model instance.
164
+ # @raise [Vedeu::Error::MissingRequired] When the name attribute
165
+ # is not defined.
166
+ # @return [void] The model instance which was stored.
167
+ def store(model)
168
+ unless present?(model.name)
169
+ fail Vedeu::Error::MissingRequired,
170
+ "Cannot store model '#{model.class}' without a name attribute."
171
+ end
172
+
173
+ log_store(model)
174
+
175
+ storage[model.name] = model
176
+ end
177
+ alias_method :register, :store
178
+ alias_method :add, :store
169
179
 
170
- log_store(model)
171
-
172
- storage[model.name] = model
173
- end
174
- alias_method :register, :store
175
- alias_method :add, :store
180
+ private
176
181
 
177
- private
182
+ # @return [String]
183
+ def log_store(model)
184
+ type = registered?(model.name) ? :update : :create
178
185
 
179
- # @return [String]
180
- def log_store(model)
181
- type = registered?(model.name) ? :update : :create
186
+ Vedeu.log(type: type, message: "#{model.class.name}: '#{model.name}'")
187
+ end
182
188
 
183
- Vedeu.log(type: type, message: "#{model.class.name}: '#{model.name}'")
184
- end
189
+ end # Repository
185
190
 
186
- end # Repository
191
+ end # Repositories
187
192
 
188
193
  end # Vedeu
@@ -1,81 +1,85 @@
1
1
  module Vedeu
2
2
 
3
- # Provides generic repository related behaviour.
4
- #
5
- module Store
3
+ module Repositories
6
4
 
7
- include Enumerable
5
+ # Provides generic repository related behaviour.
6
+ #
7
+ module Store
8
8
 
9
- # @param block [Proc]
10
- # @return [Enumerator]
11
- def each(&block)
12
- storage.each(&block)
13
- end
9
+ include Enumerable
14
10
 
15
- # Return a boolean indicating whether the storage is empty.
16
- #
17
- # @return [Boolean]
18
- def empty?
19
- storage.empty?
20
- end
11
+ # @param block [Proc]
12
+ # @return [Enumerator]
13
+ def each(&block)
14
+ storage.each(&block)
15
+ end
21
16
 
22
- # Returns a boolean indicating whether the named model is
23
- # registered.
24
- #
25
- # @param name [String]
26
- # @return [Boolean]
27
- def exists?(name)
28
- return false if empty? || name.nil? || name.empty?
17
+ # Return a boolean indicating whether the storage is empty.
18
+ #
19
+ # @return [Boolean]
20
+ def empty?
21
+ storage.empty?
22
+ end
29
23
 
30
- storage.include?(name)
31
- end
32
- alias_method :registered?, :exists?
24
+ # Returns a boolean indicating whether the named model is
25
+ # registered.
26
+ #
27
+ # @param name [String]
28
+ # @return [Boolean]
29
+ def exists?(name)
30
+ return false if empty? || name.nil? || name.empty?
33
31
 
34
- # Returns a collection of the names of all the registered
35
- # entities.
36
- #
37
- # @return [Array]
38
- def registered
39
- return [] if empty?
40
- return storage.keys if storage.is_a?(Hash)
41
- return storage.to_a if storage.is_a?(Set)
32
+ storage.include?(name)
33
+ end
34
+ alias_method :registered?, :exists?
42
35
 
43
- storage
44
- end
36
+ # Returns a collection of the names of all the registered
37
+ # entities.
38
+ #
39
+ # @return [Array]
40
+ def registered
41
+ return [] if empty?
42
+ return storage.keys if storage.is_a?(Hash)
43
+ return storage.to_a if storage.is_a?(Set)
45
44
 
46
- # Remove all currently stored data.
47
- #
48
- # @return [Array|Hash|Set]
49
- def reset
50
- Vedeu.log(type: :reset,
51
- message: "(#{self.class.name}) #{registered.inspect}")
45
+ storage
46
+ end
52
47
 
53
- @storage = in_memory
54
- end
55
- alias_method :reset!, :reset
56
- alias_method :clear, :reset
48
+ # Remove all currently stored data.
49
+ #
50
+ # @return [Array|Hash|Set]
51
+ def reset
52
+ Vedeu.log(type: :reset,
53
+ message: "(#{self.class.name}) #{registered.inspect}")
57
54
 
58
- # Return the number of entries stored.
59
- #
60
- # @return [Fixnum]
61
- def size
62
- storage.size
63
- end
55
+ @storage = in_memory
56
+ end
57
+ alias_method :reset!, :reset
58
+ alias_method :clear, :reset
64
59
 
65
- # Return whole repository; provides raw access to the storage for
66
- # this repository.
67
- #
68
- # @return [Array|Hash|Set]
69
- def storage
70
- @storage ||= in_memory
71
- end
72
- alias_method :all, :storage
73
-
74
- # @return [Hash]
75
- def in_memory
76
- {}
77
- end
78
-
79
- end # Store
60
+ # Return the number of entries stored.
61
+ #
62
+ # @return [Fixnum]
63
+ def size
64
+ storage.size
65
+ end
66
+
67
+ # Return whole repository; provides raw access to the storage
68
+ # for this repository.
69
+ #
70
+ # @return [Array|Hash|Set]
71
+ def storage
72
+ @storage ||= in_memory
73
+ end
74
+ alias_method :all, :storage
75
+
76
+ # @return [Hash]
77
+ def in_memory
78
+ {}
79
+ end
80
+
81
+ end # Store
82
+
83
+ end # Repositories
80
84
 
81
85
  end # Vedeu
@@ -0,0 +1,15 @@
1
+ module Vedeu
2
+
3
+ module Runtime
4
+
5
+ end # Runtime
6
+
7
+ end # Vedeu
8
+
9
+ require 'vedeu/runtime/traps'
10
+ require 'vedeu/runtime/launcher'
11
+ require 'vedeu/runtime/bootstrap'
12
+ require 'vedeu/runtime/router'
13
+ require 'vedeu/runtime/main_loop'
14
+ require 'vedeu/runtime/flags'
15
+ require 'vedeu/runtime/application'
@@ -1,15 +1,16 @@
1
1
  module Vedeu
2
2
 
3
- # This class ensures that STDIN, STDOUT and STDERR point to the correct
4
- # places. It also handles the initial configuration of the application,
5
- # the starting of the application, the handling of uncaught exceptions and
6
- # finally the exiting of the application with the correct exit code.
3
+ # This class ensures that STDIN, STDOUT and STDERR point to the
4
+ # correct places. It also handles the initial configuration of the
5
+ # application, the starting of the application, the handling of
6
+ # uncaught exceptions and finally the exiting of the application
7
+ # with the correct exit code.
7
8
  #
8
9
  class Launcher
9
10
 
10
11
  # @!attribute [r] exit_code
11
- # @return [Fixnum] Return value indicating successful execution (0) or an
12
- # error occurred (1).
12
+ # @return [Fixnum] Return value indicating successful execution
13
+ # (0) or an error occurred (1).
13
14
  attr_reader :exit_code
14
15
 
15
16
  # :nocov:
@@ -45,9 +46,9 @@ module Vedeu
45
46
  end
46
47
 
47
48
  # :nocov:
48
- # If debugging is enabled, execute the application within the debugging
49
- # context. At the moment, this simple uses 'ruby-prof' to profile the
50
- # running application.
49
+ # If debugging is enabled, execute the application within the
50
+ # debugging context. At the moment, this simple uses 'ruby-prof'
51
+ # to profile the running application.
51
52
  #
52
53
  # @return [void]
53
54
  def debug_execute!
@@ -63,9 +64,10 @@ module Vedeu
63
64
  end
64
65
  # :nocov:
65
66
 
66
- # Alters the STD[IN|OUT|ERR] to those requested by the client application,
67
- # then starts the application. If an uncaught exception occurs during the
68
- # application runtime, we exit ungracefully with any error message(s).
67
+ # Alters the STD[IN|OUT|ERR] to those requested by the client
68
+ # application, then starts the application. If an uncaught
69
+ # exception occurs during the application runtime, we exit
70
+ # ungracefully with any error message(s).
69
71
  #
70
72
  # @return [void]
71
73
  def execute!
@@ -95,7 +97,8 @@ module Vedeu
95
97
  private
96
98
 
97
99
  # :nocov:
98
- # Terminates the application after resetting $stdin, $stdout and $stderr.
100
+ # Terminates the application after resetting $stdin, $stdout and
101
+ # $stderr.
99
102
  #
100
103
  # @return [void]
101
104
  def terminate!
@@ -109,9 +112,9 @@ module Vedeu
109
112
  end
110
113
  # :nocov:
111
114
 
112
- # Use the arguments passed on the command-line along with those defined by
113
- # the client application and Vedeu's defaults to configure the client
114
- # application.
115
+ # Use the arguments passed on the command-line along with those
116
+ # defined by the client application and Vedeu's defaults to
117
+ # configure the client application.
115
118
  #
116
119
  # @return [Vedeu::Configuration]
117
120
  def configuration
@@ -7,3 +7,9 @@ module Vedeu
7
7
  end # Templating
8
8
 
9
9
  end # Vedeu
10
+
11
+ require 'vedeu/templating/encoder'
12
+ require 'vedeu/templating/decoder'
13
+ require 'vedeu/templating/helpers'
14
+ require 'vedeu/templating/template'
15
+ require 'vedeu/templating/view_template'
@@ -0,0 +1,14 @@
1
+ module Vedeu
2
+
3
+ # This module is the direct interface between Vedeu and your
4
+ # terminal/ console, via Ruby's IO core library.
5
+ #
6
+ module Terminal
7
+
8
+ end # Terminal
9
+
10
+ end # Vedeu
11
+
12
+ require 'vedeu/terminal/mode'
13
+ require 'vedeu/terminal/terminal'
14
+ require 'vedeu/terminal/buffer'
@@ -2,13 +2,14 @@ module Vedeu
2
2
 
3
3
  module Terminal
4
4
 
5
- # All output will be written to this singleton, and #render will be called
6
- # at the end of each run of {Vedeu::MainLoop}; effectively rendering this
7
- # buffer to each registered renderer. This buffer is not cleared after this
8
- # action though, as subsequent actions will modify the contents. This means
9
- # that individual parts of Vedeu can write content here at various points
10
- # and only at the end of each run of {Vedeu::MainLoop} will it be actually
11
- # output 'somewhere'.
5
+ # All output will be written to this singleton, and #render will
6
+ # be called at the end of each run of {Vedeu::MainLoop};
7
+ # effectively rendering this buffer to each registered renderer.
8
+ # This buffer is not cleared after this action though, as
9
+ # subsequent actions will modify the contents. This means that
10
+ # individual parts of Vedeu can write content here at various
11
+ # points and only at the end of each run of {Vedeu::MainLoop} will
12
+ # it be actually output 'somewhere'.
12
13
  #
13
14
  module Buffer
14
15