vedeu 0.4.40 → 0.4.41

Sign up to get free protection for your applications and to get access to all the features.
Files changed (136) hide show
  1. checksums.yaml +4 -4
  2. data/Dockerfile +23 -28
  3. data/Guardfile +0 -8
  4. data/Rakefile +0 -6
  5. data/docs/applications.md +0 -1
  6. data/docs/dsl.md +7 -12
  7. data/examples/borders_app.rb +5 -0
  8. data/examples/configuration_app.rb +5 -0
  9. data/examples/drb_app.rb +5 -0
  10. data/examples/geometry_app.rb +5 -0
  11. data/examples/material_colours_app.rb +5 -0
  12. data/examples/panel_app.rb +5 -0
  13. data/examples/typed_commands/typed_commands_app.rb +5 -0
  14. data/examples/view_templates_app/view_templates_app.rb +5 -0
  15. data/lib/vedeu/api.rb +8 -8
  16. data/lib/vedeu/application/all.rb +3 -0
  17. data/lib/vedeu/application/application_controller.rb +4 -0
  18. data/lib/vedeu/application/application_helper.rb +4 -0
  19. data/lib/vedeu/application/application_view.rb +6 -0
  20. data/lib/vedeu/application/controller.rb +23 -0
  21. data/lib/vedeu/application/helper.rb +23 -0
  22. data/lib/vedeu/application/view.rb +23 -0
  23. data/lib/vedeu/application.rb +1 -3
  24. data/lib/vedeu/bindings.rb +64 -65
  25. data/lib/vedeu/bootstrap.rb +2 -0
  26. data/lib/vedeu/buffers/buffer.rb +44 -0
  27. data/lib/vedeu/configuration/api.rb +44 -119
  28. data/lib/vedeu/configuration/cli.rb +2 -0
  29. data/lib/vedeu/configuration/configuration.rb +4 -20
  30. data/lib/vedeu/cursor/cursor.rb +7 -7
  31. data/lib/vedeu/cursor/reposition.rb +2 -0
  32. data/lib/vedeu/dsl/border.rb +58 -2
  33. data/lib/vedeu/dsl/composition.rb +5 -3
  34. data/lib/vedeu/dsl/geometry.rb +14 -5
  35. data/lib/vedeu/dsl/group.rb +2 -0
  36. data/lib/vedeu/dsl/interface.rb +23 -3
  37. data/lib/vedeu/dsl/keymap.rb +11 -6
  38. data/lib/vedeu/dsl/line.rb +8 -0
  39. data/lib/vedeu/dsl/menu.rb +3 -1
  40. data/lib/vedeu/dsl/presentation.rb +12 -3
  41. data/lib/vedeu/dsl/text.rb +2 -0
  42. data/lib/vedeu/dsl/view.rb +6 -1
  43. data/lib/vedeu/events/event.rb +3 -1
  44. data/lib/vedeu/generator/application.rb +2 -7
  45. data/lib/vedeu/generator/templates/application/app/models/keymaps/_global_.rb +5 -0
  46. data/lib/vedeu/generator/templates/application/app/views/interfaces/name.erb +10 -0
  47. data/lib/vedeu/generator/view.rb +2 -0
  48. data/lib/vedeu/geometry/geometry.rb +14 -0
  49. data/lib/vedeu/geometry/index_position.rb +1 -0
  50. data/lib/vedeu/geometry/position.rb +5 -0
  51. data/lib/vedeu/input/all.rb +0 -8
  52. data/lib/vedeu/input/input.rb +24 -8
  53. data/lib/vedeu/input/mapper.rb +5 -12
  54. data/lib/vedeu/models/composition.rb +3 -3
  55. data/lib/vedeu/models/escape_char.rb +2 -0
  56. data/lib/vedeu/models/focus.rb +8 -0
  57. data/lib/vedeu/models/interface.rb +1 -1
  58. data/lib/vedeu/models/line.rb +1 -5
  59. data/lib/vedeu/models/menu.rb +4 -2
  60. data/lib/vedeu/models/panel.rb +2 -0
  61. data/lib/vedeu/null/buffer.rb +2 -0
  62. data/lib/vedeu/null/interface.rb +2 -0
  63. data/lib/vedeu/output/background.rb +1 -1
  64. data/lib/vedeu/output/border.rb +5 -157
  65. data/lib/vedeu/output/compressor.rb +2 -0
  66. data/lib/vedeu/output/foreground.rb +1 -1
  67. data/lib/vedeu/output/refresh.rb +5 -9
  68. data/lib/vedeu/output/render_border.rb +230 -0
  69. data/lib/vedeu/output/renderers/escape_sequence.rb +2 -3
  70. data/lib/vedeu/output/renderers/file.rb +10 -9
  71. data/lib/vedeu/repositories/collections/all.rb +4 -4
  72. data/lib/vedeu/repositories/repositories/all.rb +4 -4
  73. data/lib/vedeu/repositories/repositories/{background_colours.rb → backgrounds.rb} +3 -3
  74. data/lib/vedeu/repositories/repositories/cursors.rb +3 -0
  75. data/lib/vedeu/repositories/repositories/{events_repository.rb → events.rb} +5 -5
  76. data/lib/vedeu/repositories/repositories/{foreground_colours.rb → foregrounds.rb} +3 -3
  77. data/lib/vedeu/repositories/repositories/{interfaces_repository.rb → interfaces.rb} +4 -4
  78. data/lib/vedeu/storage/associative_store.rb +2 -0
  79. data/lib/vedeu/storage/conveyor_store.rb +2 -0
  80. data/lib/vedeu/storage/fifo_store.rb +2 -0
  81. data/lib/vedeu/storage/store.rb +7 -7
  82. data/lib/vedeu/support/options.rb +2 -0
  83. data/lib/vedeu/support/terminal.rb +3 -3
  84. data/lib/vedeu/support/timer.rb +2 -0
  85. data/lib/vedeu/support/visibility.rb +2 -0
  86. data/lib/vedeu/templating/directive.rb +2 -0
  87. data/lib/vedeu/templating/preprocessor.rb +2 -0
  88. data/lib/vedeu/version.rb +1 -1
  89. data/lib/vedeu.rb +3 -1
  90. data/test/lib/vedeu/bindings_test.rb +15 -0
  91. data/test/lib/vedeu/buffers/buffer_test.rb +12 -0
  92. data/test/lib/vedeu/configuration/api_test.rb +0 -39
  93. data/test/lib/vedeu/configuration/configuration_test.rb +0 -9
  94. data/test/lib/vedeu/cursor/cursor_test.rb +6 -0
  95. data/test/lib/vedeu/dsl/border_test.rb +12 -0
  96. data/test/lib/vedeu/dsl/composition_test.rb +2 -2
  97. data/test/lib/vedeu/geometry/index_position_test.rb +2 -0
  98. data/test/lib/vedeu/geometry/position_test.rb +6 -0
  99. data/test/lib/vedeu/models/cell_test.rb +16 -8
  100. data/test/lib/vedeu/models/char_test.rb +8 -0
  101. data/test/lib/vedeu/models/composition_test.rb +2 -2
  102. data/test/lib/vedeu/models/interface_test.rb +10 -0
  103. data/test/lib/vedeu/models/line_test.rb +12 -0
  104. data/test/lib/vedeu/models/stream_test.rb +1 -13
  105. data/test/lib/vedeu/output/border_test.rb +1 -0
  106. data/test/lib/vedeu/output/presentation_test.rb +2 -0
  107. data/test/lib/vedeu/output/render_border_test.rb +16 -0
  108. data/test/lib/vedeu/output/renderers/file_test.rb +32 -16
  109. data/test/lib/vedeu/repositories/collection_test.rb +7 -0
  110. data/test/lib/vedeu/repositories/collections/all_test.rb +18 -6
  111. data/test/lib/vedeu/repositories/model_test.rb +33 -7
  112. data/test/lib/vedeu/repositories/repositories/{background_colours_test.rb → backgrounds_test.rb} +3 -3
  113. data/test/lib/vedeu/repositories/repositories/borders_test.rb +7 -17
  114. data/test/lib/vedeu/repositories/repositories/buffers_test.rb +7 -22
  115. data/test/lib/vedeu/repositories/repositories/cursors_test.rb +32 -0
  116. data/test/lib/vedeu/repositories/repositories/events_test.rb +22 -0
  117. data/test/lib/vedeu/repositories/repositories/{foreground_colours_test.rb → foregrounds_test.rb} +3 -3
  118. data/test/lib/vedeu/repositories/repositories/geometries_test.rb +7 -21
  119. data/test/lib/vedeu/repositories/repositories/groups_test.rb +11 -0
  120. data/test/lib/vedeu/repositories/repositories/{interfaces_repositories_test.rb → interfaces_test.rb} +14 -3
  121. data/test/lib/vedeu/repositories/repositories/keymaps_test.rb +10 -1
  122. data/test/lib/vedeu/repositories/repositories/menus_test.rb +10 -1
  123. data/test/lib/vedeu/repositories/repository_test.rb +15 -9
  124. data/test/lib/vedeu/storage/conveyor_store_test.rb +2 -4
  125. data/test/lib/vedeu/support/terminal_test.rb +2 -2
  126. data/test/lib/vedeu/templating/helpers_test.rb +4 -0
  127. data/vedeu.gemspec +0 -2
  128. metadata +20 -54
  129. data/config/cucumber.yml +0 -8
  130. data/features/cli_vedeu.feature +0 -5
  131. data/features/start_stop.feature +0 -27
  132. data/features/step_definitions/vedeu_steps.rb +0 -0
  133. data/features/support/env.rb +0 -15
  134. data/lib/vedeu/generator/templates/application/app/models/keymaps/_system_.rb +0 -7
  135. data/test/lib/vedeu/repositories/repositories/events_repository_test.rb +0 -13
  136. data/test/lib/vedeu/repositories/repositories/interfaces_repository_test.rb +0 -11
@@ -12,17 +12,20 @@ module Vedeu
12
12
  # # Borders can be defined when defining your interface...
13
13
  # Vedeu.interface 'my_interface' do
14
14
  # border do
15
- # # ...
15
+ # # ...
16
+ # end
16
17
  #
17
18
  # # ...or as part of a view definition...
18
19
  # Vedeu.renders do
19
20
  # view 'border_demo' do
20
21
  # border do
21
- # # ...
22
+ # # ...
23
+ # end
22
24
  #
23
25
  # # ...or standalone; referencing the target interface or view.
24
26
  # Vedeu.border 'some_interface' do
25
27
  # # ...
28
+ # end
26
29
  #
27
30
  # @api public
28
31
  class Border
@@ -36,6 +39,7 @@ module Vedeu
36
39
  # @example
37
40
  # Vedeu.border 'some_interface' do
38
41
  # # ...
42
+ # end
39
43
  #
40
44
  # @param name [String] The name of the interface or view to which this
41
45
  # border belongs.
@@ -67,6 +71,9 @@ module Vedeu
67
71
  # border do
68
72
  # bottom_left '+'
69
73
  # # ...
74
+ # end
75
+ # end
76
+ # end
70
77
  #
71
78
  # @param char [String] Character to be used as the bottom left border
72
79
  # character.
@@ -84,6 +91,9 @@ module Vedeu
84
91
  # border do
85
92
  # bottom_right '+'
86
93
  # # ...
94
+ # end
95
+ # end
96
+ # end
87
97
  #
88
98
  # @param char [String] Character to be used as the bottom right border
89
99
  # character.
@@ -92,6 +102,31 @@ module Vedeu
92
102
  model.bottom_right = char
93
103
  end
94
104
 
105
+ # Disable this border.
106
+ #
107
+ # @return [Boolean]
108
+ def disable!
109
+ model.enabled = false
110
+
111
+ hide_bottom!
112
+ hide_left!
113
+ hide_right!
114
+ hide_top!
115
+ end
116
+
117
+ # Enable this border.
118
+ # (Borders are enabled by default if defined for an interface).
119
+ #
120
+ # @return [Boolean]
121
+ def enable!
122
+ model.enabled = true
123
+
124
+ show_bottom!
125
+ show_left!
126
+ show_right!
127
+ show_top!
128
+ end
129
+
95
130
  # Set the character to be used to draw a horizontal part of the border.
96
131
  #
97
132
  # @example
@@ -100,6 +135,9 @@ module Vedeu
100
135
  # border do
101
136
  # horizontal '-'
102
137
  # # ...
138
+ # end
139
+ # end
140
+ # end
103
141
  #
104
142
  # @param char [String] Character to be used as the horizontal border
105
143
  # character.
@@ -119,6 +157,9 @@ module Vedeu
119
157
  # hide_bottom!
120
158
  # # ... or
121
159
  # show_bottom!
160
+ # end
161
+ # end
162
+ # end
122
163
  #
123
164
  # @param value [Boolean] All values evaluate as true except nil and
124
165
  # false.
@@ -155,6 +196,9 @@ module Vedeu
155
196
  # hide_left!
156
197
  # # ... or
157
198
  # show_left!
199
+ # end
200
+ # end
201
+ # end
158
202
  #
159
203
  # @param value [Boolean] All values evaluate as true except nil and
160
204
  # false.
@@ -191,6 +235,9 @@ module Vedeu
191
235
  # hide_right!
192
236
  # # ... or
193
237
  # show_right!
238
+ # end
239
+ # end
240
+ # end
194
241
  #
195
242
  # @param value [Boolean] All values evaluate as true except nil and
196
243
  # false.
@@ -225,6 +272,9 @@ module Vedeu
225
272
  # border do
226
273
  # title 'My Cool Title'
227
274
  # # ...
275
+ # end
276
+ # end
277
+ # end
228
278
  #
229
279
  # +- My Cool Title --------------------------------+
230
280
  #
@@ -245,6 +295,9 @@ module Vedeu
245
295
  # hide_top!
246
296
  # # ... or
247
297
  # show_top!
298
+ # end
299
+ # end
300
+ # end
248
301
  #
249
302
  # @param value [Boolean] All values evaluate as true except nil and
250
303
  # false.
@@ -278,6 +331,9 @@ module Vedeu
278
331
  # border do
279
332
  # top_left '+'
280
333
  # # ...
334
+ # end
335
+ # end
336
+ # end
281
337
  #
282
338
  # @param char [String] Character to be used as the top left border
283
339
  # character.
@@ -66,10 +66,11 @@ module Vedeu
66
66
  #
67
67
  # @example
68
68
  # view 'my_interface' do
69
- # ...
69
+ # # ...
70
+ # end
70
71
  #
71
72
  # @raise [InvalidSyntax] The required block was not given.
72
- # @return [Vedeu::Interfaces<Vedeu::Interface>]
73
+ # @return [Vedeu::InterfaceCollection<Vedeu::Interface>]
73
74
  def view(name = '', &block)
74
75
  fail InvalidSyntax, 'block not given' unless block_given?
75
76
 
@@ -85,6 +86,7 @@ module Vedeu
85
86
  # template_for('my_interface',
86
87
  # '/path/to/template.erb',
87
88
  # @some_object, options)
89
+ # end
88
90
  #
89
91
  # @todo More documentation required.
90
92
  #
@@ -96,7 +98,7 @@ module Vedeu
96
98
  # @param object [Object] The object for which the values of template's
97
99
  # variables can be obtained.
98
100
  # @param options [Hash] See {Vedeu::Wordwrap}
99
- # @return [Vedeu::Interfaces<Vedeu::Interface>]
101
+ # @return [Vedeu::InterfaceCollection<Vedeu::Interface>]
100
102
  def template_for(name, filename, object = nil, options = {})
101
103
  fail MissingRequired, 'Cannot render template without the name of ' \
102
104
  'the view.' unless name
@@ -11,7 +11,7 @@ module Vedeu
11
11
  #
12
12
  # Vedeu.geometry 'some_interface' do
13
13
  # # ...
14
- #
14
+ # end
15
15
  #
16
16
  # This crude ASCII diagram represents a Geometry within Vedeu, each of the
17
17
  # labels is a value you can access or define.
@@ -37,6 +37,7 @@ module Vedeu
37
37
  # @example
38
38
  # Vedeu.geometry 'some_interface' do
39
39
  # # ...
40
+ # end
40
41
  #
41
42
  # @param name [String] The name of the interface or view to which this
42
43
  # geometry belongs.
@@ -69,10 +70,12 @@ module Vedeu
69
70
  # geometry 'some_interface' do
70
71
  # centred!
71
72
  # # ...
73
+ # end
72
74
  #
73
75
  # geometry 'some_interface' do
74
76
  # centred false
75
77
  # # ...
78
+ # end
76
79
  #
77
80
  # @return [Boolean]
78
81
  def centred(value = true)
@@ -93,6 +96,7 @@ module Vedeu
93
96
  # geometry 'some_interface' do
94
97
  # height 8
95
98
  # # ...
99
+ # end
96
100
  #
97
101
  # @note
98
102
  # This value will be ignored if by `y` and `yn` are set.
@@ -116,6 +120,7 @@ module Vedeu
116
120
  # geometry 'some_interface' do
117
121
  # width 25
118
122
  # # ...
123
+ # end
119
124
  #
120
125
  # @note
121
126
  # This value will be ignored if by `x` and `xn` are set.
@@ -131,11 +136,12 @@ module Vedeu
131
136
  # geometry 'some_interface' do
132
137
  # x 7 # start on column 7.
133
138
  # # ...
139
+ # end
134
140
  #
135
141
  # geometry 'some_interface' do
136
142
  # x { use('other_interface').east } # start on column 8, if
137
143
  # # ... # `other_interface` changes
138
- # # position, `some_interface` will
144
+ # end # position, `some_interface` will
139
145
  # # too.
140
146
  #
141
147
  # @param value [Fixnum]
@@ -153,11 +159,12 @@ module Vedeu
153
159
  # geometry 'some_interface' do
154
160
  # xn 37 # end at column 37.
155
161
  # # ...
162
+ # end
156
163
  #
157
164
  # geometry 'some_interface' do
158
165
  # xn { use('other_interface').right } # if `other_interface` changes
159
166
  # # ... # position, `some_interface`
160
- # # will too.
167
+ # end # will too.
161
168
  #
162
169
  # @note
163
170
  # This value will override `width`.
@@ -177,11 +184,12 @@ module Vedeu
177
184
  # geometry 'some_interface' do
178
185
  # y 4
179
186
  # # ...
187
+ # end
180
188
  #
181
189
  # geometry 'some_interface' do
182
190
  # y { use('other_interface').north } # start on row/line 3, if
183
191
  # # ... # `other_interface` changes
184
- # # position, `some_interface`
192
+ # end # position, `some_interface`
185
193
  # # will too.
186
194
  #
187
195
  # @param value [Fixnum]
@@ -199,11 +207,12 @@ module Vedeu
199
207
  # geometry 'some_interface' do
200
208
  # yn 24 # end at row 24.
201
209
  # # ...
210
+ # end
202
211
  #
203
212
  # geometry 'some_interface' do
204
213
  # yn { use('other_interface').bottom } # if `other_interface` changes
205
214
  # # ... # position, `some_interface`
206
- # # will too.
215
+ # end # will too.
207
216
  #
208
217
  # @note
209
218
  # This value will override `height`.
@@ -18,12 +18,14 @@ module Vedeu
18
18
  # Vedeu.group 'title_screen' do
19
19
  # add 'welcome_interface'
20
20
  # # ...
21
+ # end
21
22
  #
22
23
  # Vedeu.group 'main_screen' do
23
24
  # add 'editor_interface'
24
25
  # add 'status_interface'
25
26
  # add 'command_interface'
26
27
  # # ...
28
+ # end
27
29
  #
28
30
  # @note
29
31
  # Creating a group with the same name as an existing group overwrites
@@ -70,14 +70,18 @@ module Vedeu
70
70
  # cursor :show # => both of these are equivalent to line above
71
71
  # cursor! #
72
72
  # # ...
73
+ # end
73
74
  #
75
+ # interface 'my_interface' do
74
76
  # cursor false # => hide the cursor for this interface
75
77
  # cursor nil # => as above
76
78
  # # ...
79
+ # end
77
80
  #
78
81
  # view 'my_interface' do
79
- # cursor true
80
- # # ...
82
+ # cursor true # => Specify the visibility of the cursor when the view
83
+ # # ... # is rendered.
84
+ # end
81
85
  #
82
86
  # @return [Cursor]
83
87
  def cursor(value = true)
@@ -103,6 +107,7 @@ module Vedeu
103
107
  # interface 'my_interface' do
104
108
  # delay 0.5 # interface will not update more often than every 500ms.
105
109
  # # ...
110
+ # end
106
111
  #
107
112
  # @return [Fixnum|Float]
108
113
  def delay(value)
@@ -112,7 +117,15 @@ module Vedeu
112
117
  # Specify this interface as being in focus when the application starts.
113
118
  #
114
119
  # @note If multiple interfaces are defined, and this is included in each,
115
- # then the last defined will be the interface in focus.
120
+ # then the last defined will be the interface in focus. However, this
121
+ # behaviour can be overridden:
122
+ #
123
+ # ```ruby
124
+ # Vedeu.focus_by_name 'some_interface'
125
+ # ```
126
+ #
127
+ # When the above is specified (outside of a `Vedeu.interface`
128
+ # declaration), the named interface will be focussed instead.
116
129
  #
117
130
  # @return [String] The name of the interface in focus.
118
131
  def focus!
@@ -151,6 +164,7 @@ module Vedeu
151
164
  # interface 'my_interface' do
152
165
  # group 'main_screen'
153
166
  # # ...
167
+ # end
154
168
  #
155
169
  # @param name [String] The name of the group to which this interface
156
170
  # should belong.
@@ -204,6 +218,7 @@ module Vedeu
204
218
  # interface do
205
219
  # name 'my_interface'
206
220
  # # ...
221
+ # end
207
222
  #
208
223
  # @return [String]
209
224
  def name(value)
@@ -250,14 +265,18 @@ module Vedeu
250
265
  # visible true # => show the interface
251
266
  # show! # => as above
252
267
  # # ...
268
+ # end
253
269
  #
270
+ # interface 'my_interface' do
254
271
  # visible false # => hide the interface
255
272
  # hide! # => as above
256
273
  # # ...
274
+ # end
257
275
  #
258
276
  # view 'my_interface' do
259
277
  # visible false
260
278
  # # ...
279
+ # end
261
280
  #
262
281
  # @return [void]
263
282
  def visible(value = true)
@@ -279,6 +298,7 @@ module Vedeu
279
298
  # interface 'my_interface' do
280
299
  # zindex 3
281
300
  # # ...
301
+ # end
282
302
  #
283
303
  # @param value [Fixnum]
284
304
  # @return [void]
@@ -21,6 +21,8 @@ module Vedeu
21
21
  # Vedeu.interface 'my_interface' do
22
22
  # keymap do
23
23
  # # ...
24
+ # end
25
+ # end
24
26
  #
25
27
  # @param name [String] The name of the interface which this keymap relates
26
28
  # to.
@@ -29,17 +31,23 @@ module Vedeu
29
31
  # @example
30
32
  # Vedeu.keymap 'my_interface' do
31
33
  # # ...
34
+ # end
32
35
  #
33
36
  # Vedeu.keys 'my_interface' do
34
37
  # # ...
38
+ # end
35
39
  #
36
40
  # Vedeu.interface 'my_interface' do
37
41
  # keymap do
38
42
  # # ...
43
+ # end
44
+ # end
39
45
  #
40
46
  # Vedeu.interface 'my_interface' do
41
47
  # keys do
42
48
  # # ...
49
+ # end
50
+ # end
43
51
  #
44
52
  # @raise [InvalidSyntax] The required block was not given.
45
53
  # @return [Keymap]
@@ -76,9 +84,10 @@ module Vedeu
76
84
  # key('h', :left) { Vedeu.trigger(:left) }
77
85
  # key('j', :down) { Vedeu.trigger(:down) }
78
86
  # key('p') do
79
- # ...
87
+ # # ...
80
88
  # end
81
- # ...
89
+ # # ...
90
+ # end
82
91
  #
83
92
  # @raise [InvalidSyntax] When the required block is not given, the
84
93
  # value_or_values parameter is undefined, or when processing the
@@ -109,10 +118,6 @@ module Vedeu
109
118
  # available to all interfaces. Once a key has been defined in the
110
119
  # '_global_' keymap, it cannot be used for a specific interface.
111
120
  #
112
- # @note Using the name of a keymap that already exists will overwrite that
113
- # keymap. Do not use the name '_system_' as unexpected behaviour may
114
- # occur.
115
- #
116
121
  # @param value [String]
117
122
  # @return [String]
118
123
  def name(value)
@@ -58,6 +58,9 @@ module Vedeu
58
58
  #
59
59
  # line do
60
60
  # # ...
61
+ # end
62
+ # end
63
+ # end
61
64
  #
62
65
  # @raise [InvalidSyntax] When no block or value is provided.
63
66
  # @return [Vedeu::Lines]
@@ -90,9 +93,14 @@ module Vedeu
90
93
  # line do
91
94
  # streams do
92
95
  # # ...
96
+ # end
93
97
  #
94
98
  # stream do
95
99
  # # ...
100
+ # end
101
+ # end
102
+ # end
103
+ # end
96
104
  #
97
105
  # @raise [InvalidSyntax] The required block was not given.
98
106
  # @return [Vedeu::Streams<Vedeu::Stream>]
@@ -28,6 +28,7 @@ module Vedeu
28
28
  # menu 'my_menu' do
29
29
  # item SomeClass.new
30
30
  # item SomeClass.new
31
+ # end
31
32
  #
32
33
  # @return [Array]
33
34
  def item(element)
@@ -65,7 +66,8 @@ module Vedeu
65
66
  # @example
66
67
  # menu do
67
68
  # name 'my_menu'
68
- # ...
69
+ # # ...
70
+ # end
69
71
  #
70
72
  # @return [String]
71
73
  def name(value)
@@ -32,6 +32,9 @@ module Vedeu
32
32
  # stream do
33
33
  # background '#22ff00'
34
34
  # # ...
35
+ # end
36
+ # end
37
+ # end
35
38
  #
36
39
  # @return [String]
37
40
  def background(value = '')
@@ -68,6 +71,9 @@ module Vedeu
68
71
  # stream do
69
72
  # colour background: '#000000', foreground: '#ffffff'
70
73
  # # ...
74
+ # end
75
+ # end
76
+ # end
71
77
  #
72
78
  # @return [Vedeu::Colour]
73
79
  def colour(attributes = {})
@@ -81,15 +87,18 @@ module Vedeu
81
87
  # @example
82
88
  # interface 'my_interface' do
83
89
  # style 'normal'
84
- # ...
90
+ # # ...
91
+ # end
85
92
  #
86
93
  # lines do
87
94
  # style ['bold', 'underline']
88
- # ...
95
+ # # ...
96
+ # end
89
97
  #
90
98
  # stream do
91
99
  # style 'blink'
92
- # ...
100
+ # # ...
101
+ # end
93
102
  #
94
103
  # @return [Vedeu::Style]
95
104
  def style(value)
@@ -16,9 +16,11 @@ module Vedeu
16
16
  # @example
17
17
  # lines do
18
18
  # centre '...'
19
+ # end
19
20
  #
20
21
  # line do
21
22
  # right '...'
23
+ # end
22
24
  #
23
25
  # left 'This will be left aligned.', width: 35
24
26
  # # => 'This will be left aligned. '
@@ -23,10 +23,12 @@ module Vedeu
23
23
  # @example
24
24
  # Vedeu.interface 'my_interface' do
25
25
  # # ...
26
+ # end
26
27
  #
27
28
  # Vedeu.interface do
28
29
  # name 'interfaces_must_have_a_name'
29
30
  # # ...
31
+ # end
30
32
  #
31
33
  # @raise [InvalidSyntax] The required block was not given.
32
34
  # @return [Interface]
@@ -51,6 +53,8 @@ module Vedeu
51
53
  # Vedeu.renders do
52
54
  # view 'my_interface' do
53
55
  # # ...
56
+ # end
57
+ # end
54
58
  #
55
59
  # @raise [InvalidSyntax] The required block was not given.
56
60
  # @return [Array<Interface>]
@@ -81,7 +85,8 @@ module Vedeu
81
85
  # view 'my_other_interface' do
82
86
  # # ... some other attributes ...
83
87
  # end
84
- # ...
88
+ # # ...
89
+ # end
85
90
  #
86
91
  # @raise [InvalidSyntax] The required block was not given.
87
92
  # @return [Array<Interface>]
@@ -90,6 +90,8 @@ module Vedeu
90
90
 
91
91
  # Unbind events from a named handler.
92
92
  #
93
+ # Removes all events associated with the given name.
94
+ #
93
95
  # @example
94
96
  # Vedeu.unbind('some_event')
95
97
  #
@@ -131,7 +133,7 @@ module Vedeu
131
133
  new_collection = repository.find(name).add(self)
132
134
 
133
135
  else
134
- new_collection = Vedeu::Events.new([self], nil, name)
136
+ new_collection = Vedeu::EventCollection.new([self], nil, name)
135
137
 
136
138
  end
137
139
 
@@ -20,6 +20,8 @@ module Vedeu
20
20
  new(name).generate
21
21
  end
22
22
 
23
+ # Returns a new instance of Vedeu::Generator::Application.
24
+ #
23
25
  # @param name [String] The name of the application.
24
26
  # @return [Vedeu::Generator::Application]
25
27
  def initialize(name)
@@ -35,7 +37,6 @@ module Vedeu
35
37
  copy_application_controller
36
38
  copy_application_helper
37
39
  copy_global_keymap
38
- copy_system_keymap
39
40
  copy_application_executable
40
41
  make_application_executable
41
42
  copy_configuration
@@ -99,12 +100,6 @@ module Vedeu
99
100
  "#{name}/app/models/keymaps/_global_.rb")
100
101
  end
101
102
 
102
- # @return [void]
103
- def copy_system_keymap
104
- copy_file(source + '/app/models/keymaps/_system_.rb',
105
- "#{name}/app/models/keymaps/_system_.rb")
106
- end
107
-
108
103
  # @return [Array<String>]
109
104
  def directories
110
105
  [
@@ -1,3 +1,8 @@
1
1
  Vedeu.keymap('_global_') do
2
2
  # see http://www.rubydoc.info/gems/vedeu/Vedeu/DSL/Keymap
3
+
4
+ key('q') { Vedeu.trigger(:_exit_) }
5
+ key(:esc) { Vedeu.trigger(:_mode_switch_) }
6
+ key(:shift_tab) { Vedeu.trigger(:_focus_previous_) }
7
+ key(:tab) { Vedeu.trigger(:_focus_next_) }
3
8
  end
@@ -5,6 +5,12 @@ Vedeu.interface '<%= object.name %>' do
5
5
  # style 'normal'
6
6
 
7
7
  # Define visibility of border
8
+ #
9
+ # Uncomment one of these:
10
+ # enable!
11
+ # disable!
12
+ #
13
+ # Individually control each border:
8
14
  # show_bottom!
9
15
  # show_left!
10
16
  # show_right!
@@ -24,8 +30,12 @@ Vedeu.interface '<%= object.name %>' do
24
30
 
25
31
  # background
26
32
 
33
+ # colour
34
+
27
35
  # cursor!
28
36
 
37
+ # focus!
38
+
29
39
  # foreground
30
40
 
31
41
  # geometry do
@@ -22,6 +22,8 @@ module Vedeu
22
22
  new(name).generate
23
23
  end
24
24
 
25
+ # Returns a new instance of Vedeu::Generator::View.
26
+ #
25
27
  # @param name [String] The name of the view.
26
28
  # @return [Vedeu::Generator::View]
27
29
  def initialize(name)
@@ -103,6 +103,12 @@ module Vedeu
103
103
  "maximise:#{maximised}>"
104
104
  end
105
105
 
106
+ # Will maximise the named interface geometry. This means it will occupy all
107
+ # of the available space on the terminal window.
108
+ #
109
+ # @example
110
+ # Vedeu.trigger(:_maximise_, name)
111
+ #
106
112
  # @return [Vedeu::Geometry|NilClass]
107
113
  def maximise
108
114
  return self if maximised?
@@ -116,6 +122,14 @@ module Vedeu
116
122
  work
117
123
  end
118
124
 
125
+ # Will unmaximise the named interface geometry. Previously, if a geometry
126
+ # was maximised, then triggering the unmaximise event will return it to its
127
+ # usual defined size (terminal size permitting: if the terminal has been
128
+ # resized, then the new geometry size should adapt).
129
+ #
130
+ # @example
131
+ # Vedeu.trigger(:_unmaximise_, name)
132
+ #
119
133
  # @return [Vedeu::Geometry|NilClass]
120
134
  def unmaximise
121
135
  return self unless maximised?