vedeu 0.3.4 → 0.3.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (164) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/Rakefile +6 -0
  4. data/bin/vedeu_drb_client +8 -3
  5. data/bin/vedeu_drb_server +113 -0
  6. data/bin/vedeu_test +1 -1
  7. data/docs/events.md +0 -127
  8. data/examples/borders_app.rb +17 -7
  9. data/examples/configuration_app.rb +1 -1
  10. data/examples/cursor_app.rb +4 -2
  11. data/examples/drb_app.rb +113 -0
  12. data/examples/focus_app.rb +1 -1
  13. data/examples/geometry_app.rb +1 -1
  14. data/examples/hello_world.rb +1 -1
  15. data/examples/lines_app.rb +1 -1
  16. data/features/start_stop.feature +1 -1
  17. data/inch.yml +5 -0
  18. data/lib/vedeu/all.rb +2 -0
  19. data/lib/vedeu/api.rb +1 -0
  20. data/lib/vedeu/application.rb +17 -36
  21. data/lib/vedeu/bindings.rb +134 -27
  22. data/lib/vedeu/buffers/display_buffer.rb +1 -4
  23. data/lib/vedeu/configuration/api.rb +15 -14
  24. data/lib/vedeu/configuration/cli.rb +17 -16
  25. data/lib/vedeu/configuration/configuration.rb +3 -1
  26. data/lib/vedeu/cursor/cursor.rb +6 -8
  27. data/lib/vedeu/cursor/move_cursor.rb +1 -0
  28. data/lib/vedeu/cursor/toggle_cursor.rb +1 -0
  29. data/lib/vedeu/debug.rb +23 -0
  30. data/lib/vedeu/distributed/all.rb +1 -1
  31. data/lib/vedeu/distributed/client.rb +55 -13
  32. data/lib/vedeu/distributed/server.rb +207 -0
  33. data/lib/vedeu/distributed/subprocess.rb +22 -21
  34. data/lib/vedeu/distributed/templates/default_application.vedeu +3 -1
  35. data/lib/vedeu/distributed/test_application.rb +2 -1
  36. data/lib/vedeu/distributed/uri.rb +1 -0
  37. data/lib/vedeu/dsl/all.rb +4 -2
  38. data/lib/vedeu/dsl/components/border.rb +11 -10
  39. data/lib/vedeu/dsl/components/geometry.rb +1 -0
  40. data/lib/vedeu/dsl/components/keymap.rb +1 -0
  41. data/lib/vedeu/dsl/components/menu.rb +1 -0
  42. data/lib/vedeu/dsl/interface.rb +1 -0
  43. data/lib/vedeu/dsl/line.rb +3 -1
  44. data/lib/vedeu/dsl/shared/colour.rb +1 -0
  45. data/lib/vedeu/dsl/shared/style.rb +1 -0
  46. data/lib/vedeu/dsl/shared/text.rb +2 -0
  47. data/lib/vedeu/dsl/shared/use.rb +3 -0
  48. data/lib/vedeu/dsl/stream.rb +3 -1
  49. data/lib/vedeu/dsl/view.rb +1 -0
  50. data/lib/vedeu/events/event.rb +9 -6
  51. data/lib/vedeu/events/trigger.rb +18 -7
  52. data/lib/vedeu/exceptions.rb +4 -1
  53. data/lib/vedeu/input/input.rb +1 -0
  54. data/lib/vedeu/input/key.rb +0 -1
  55. data/lib/vedeu/input/keymap.rb +5 -3
  56. data/lib/vedeu/input/keys.rb +1 -0
  57. data/lib/vedeu/input/mapper.rb +1 -0
  58. data/lib/vedeu/launcher.rb +35 -12
  59. data/lib/vedeu/main_loop.rb +53 -0
  60. data/lib/vedeu/models/collection.rb +11 -3
  61. data/lib/vedeu/models/focus.rb +3 -3
  62. data/lib/vedeu/models/geometry.rb +8 -16
  63. data/lib/vedeu/models/group.rb +1 -0
  64. data/lib/vedeu/models/menu.rb +2 -1
  65. data/lib/vedeu/models/model.rb +7 -1
  66. data/lib/vedeu/models/view/char.rb +52 -44
  67. data/lib/vedeu/models/view/chars.rb +1 -0
  68. data/lib/vedeu/models/view/composition.rb +2 -1
  69. data/lib/vedeu/models/view/interface.rb +5 -3
  70. data/lib/vedeu/models/view/interfaces.rb +1 -0
  71. data/lib/vedeu/models/view/line.rb +2 -1
  72. data/lib/vedeu/models/view/stream.rb +2 -1
  73. data/lib/vedeu/models/view/streams.rb +1 -0
  74. data/lib/vedeu/output/all.rb +4 -0
  75. data/lib/vedeu/output/border.rb +75 -206
  76. data/lib/vedeu/output/compositor.rb +1 -0
  77. data/lib/vedeu/output/html_char.rb +119 -0
  78. data/lib/vedeu/output/html_renderer.rb +89 -0
  79. data/lib/vedeu/output/output.rb +48 -44
  80. data/lib/vedeu/output/position_index.rb +12 -1
  81. data/lib/vedeu/output/renderer.rb +28 -0
  82. data/lib/vedeu/output/viewport.rb +14 -14
  83. data/lib/vedeu/output/virtual_buffer.rb +56 -0
  84. data/lib/vedeu/output/virtual_terminal.rb +42 -34
  85. data/lib/vedeu/output/wordwrap.rb +3 -0
  86. data/lib/vedeu/output/writer.rb +13 -1
  87. data/lib/vedeu/presentation/background.rb +1 -0
  88. data/lib/vedeu/presentation/colour.rb +8 -7
  89. data/lib/vedeu/presentation/foreground.rb +1 -0
  90. data/lib/vedeu/presentation/presentation.rb +43 -7
  91. data/lib/vedeu/presentation/translator.rb +12 -0
  92. data/lib/vedeu/repositories/repository.rb +8 -8
  93. data/lib/vedeu/support/bounding_area.rb +2 -0
  94. data/lib/vedeu/support/coercions.rb +2 -1
  95. data/lib/vedeu/support/common.rb +1 -0
  96. data/lib/vedeu/support/console.rb +17 -23
  97. data/lib/vedeu/support/content_geometry.rb +2 -0
  98. data/lib/vedeu/support/coordinate.rb +1 -0
  99. data/lib/vedeu/support/esc.rb +58 -29
  100. data/lib/vedeu/support/grid.rb +1 -0
  101. data/lib/vedeu/support/limit.rb +9 -0
  102. data/lib/vedeu/support/log.rb +31 -9
  103. data/lib/vedeu/support/node.rb +8 -18
  104. data/lib/vedeu/support/position.rb +13 -34
  105. data/lib/vedeu/support/position_validator.rb +3 -0
  106. data/lib/vedeu/support/read.rb +1 -0
  107. data/lib/vedeu/support/refresh.rb +3 -2
  108. data/lib/vedeu/support/terminal.rb +11 -5
  109. data/lib/vedeu/support/trace.rb +16 -1
  110. data/lib/vedeu/support/visible.rb +2 -0
  111. data/lib/vedeu/support/write.rb +1 -0
  112. data/lib/vedeu/traps.rb +1 -0
  113. data/lib/vedeu.rb +2 -0
  114. data/test/integration/distributed_test.rb +10 -8
  115. data/test/lib/vedeu/api_test.rb +3 -7
  116. data/test/lib/vedeu/application_test.rb +2 -5
  117. data/test/lib/vedeu/configuration/api_test.rb +12 -0
  118. data/test/lib/vedeu/cursor/cursor_test.rb +2 -0
  119. data/test/lib/vedeu/distributed/client_test.rb +17 -7
  120. data/test/lib/vedeu/distributed/server_test.rb +56 -0
  121. data/test/lib/vedeu/distributed/test_application_test.rb +7 -3
  122. data/test/lib/vedeu/dsl/components/border_test.rb +10 -2
  123. data/test/lib/vedeu/dsl/interface_test.rb +6 -0
  124. data/test/lib/vedeu/dsl/line_test.rb +19 -0
  125. data/test/lib/vedeu/dsl/shared/colour_test.rb +4 -26
  126. data/test/lib/vedeu/dsl/shared/text_test.rb +8 -1
  127. data/test/lib/vedeu/dsl/stream_test.rb +13 -1
  128. data/test/lib/vedeu/input/input_test.rb +1 -1
  129. data/test/lib/vedeu/input/key_test.rb +3 -16
  130. data/test/lib/vedeu/launcher_test.rb +11 -1
  131. data/test/lib/vedeu/main_loop_test.rb +41 -0
  132. data/test/lib/vedeu/models/geometry_test.rb +15 -34
  133. data/test/lib/vedeu/models/view/char_test.rb +44 -45
  134. data/test/lib/vedeu/models/view/interface_test.rb +6 -0
  135. data/test/lib/vedeu/models/view/line_test.rb +1 -1
  136. data/test/lib/vedeu/models/view/stream_test.rb +1 -1
  137. data/test/lib/vedeu/output/border_test.rb +6 -5
  138. data/test/lib/vedeu/output/compositor_test.rb +2 -20
  139. data/test/lib/vedeu/output/html_char_test.rb +85 -0
  140. data/test/lib/vedeu/output/html_renderer_test.rb +37 -0
  141. data/test/lib/vedeu/output/position_index_test.rb +2 -10
  142. data/test/lib/vedeu/output/renderer_test.rb +24 -0
  143. data/test/lib/vedeu/output/virtual_buffer_test.rb +53 -0
  144. data/test/lib/vedeu/output/virtual_terminal_test.rb +32 -2
  145. data/test/lib/vedeu/presentation/background_test.rb +41 -1
  146. data/test/lib/vedeu/presentation/colour_test.rb +10 -6
  147. data/test/lib/vedeu/presentation/foreground_test.rb +46 -6
  148. data/test/lib/vedeu/presentation/presentation_test.rb +44 -1
  149. data/test/lib/vedeu/presentation/translator_test.rb +34 -0
  150. data/test/lib/vedeu/repositories/repository_test.rb +1 -1
  151. data/test/lib/vedeu/support/bounding_area_test.rb +4 -12
  152. data/test/lib/vedeu/support/console_test.rb +9 -50
  153. data/test/lib/vedeu/support/esc_test.rb +7 -7
  154. data/test/lib/vedeu/support/position_test.rb +42 -0
  155. data/test/lib/vedeu/support/terminal_test.rb +5 -20
  156. data/test/lib/vedeu/support/write_test.rb +42 -18
  157. data/test/support/helpers/all.rb +0 -1
  158. data/test/support/helpers/repository_test_module.rb +1 -0
  159. data/test/test_helper.rb +5 -2
  160. data/vedeu.gemspec +7 -5
  161. metadata +60 -14
  162. data/lib/vedeu/distributed/application.rb +0 -91
  163. data/test/lib/vedeu/distributed/application_test.rb +0 -24
  164. data/test/support/helpers/presentation.rb +0 -16
@@ -48,21 +48,37 @@ module Vedeu
48
48
  let(:data) {
49
49
  [
50
50
  [
51
- Vedeu::Char.new('Z'),Vedeu::Char.new('i'),Vedeu::Char.new('n'),
52
- Vedeu::Char.new('c'),Vedeu::Char.new('.'),Vedeu::Char.new('.'),
53
- Vedeu::Char.new('.')
51
+ Vedeu::Char.new({ value: 'Z' }),
52
+ Vedeu::Char.new({ value: 'i' }),
53
+ Vedeu::Char.new({ value: 'n' }),
54
+ Vedeu::Char.new({ value: 'c' }),
55
+ Vedeu::Char.new({ value: '.' }),
56
+ Vedeu::Char.new({ value: '.' }),
57
+ Vedeu::Char.new({ value: '.' })
54
58
  ],[
55
- Vedeu::Char.new('-'),Vedeu::Char.new('.'),Vedeu::Char.new('Z'),
56
- Vedeu::Char.new('n'),Vedeu::Char.new('.'),Vedeu::Char.new('1'),
57
- Vedeu::Char.new('2')
59
+ Vedeu::Char.new({ value: '-' }),
60
+ Vedeu::Char.new({ value: '.' }),
61
+ Vedeu::Char.new({ value: 'Z' }),
62
+ Vedeu::Char.new({ value: 'n' }),
63
+ Vedeu::Char.new({ value: '.' }),
64
+ Vedeu::Char.new({ value: '1' }),
65
+ Vedeu::Char.new({ value: '2' })
58
66
  ],[
59
- Vedeu::Char.new('S'),Vedeu::Char.new('p'),Vedeu::Char.new('e'),
60
- Vedeu::Char.new('l'),Vedeu::Char.new('t'),Vedeu::Char.new('e'),
61
- Vedeu::Char.new('r')
67
+ Vedeu::Char.new({ value: 'S' }),
68
+ Vedeu::Char.new({ value: 'p' }),
69
+ Vedeu::Char.new({ value: 'e' }),
70
+ Vedeu::Char.new({ value: 'l' }),
71
+ Vedeu::Char.new({ value: 't' }),
72
+ Vedeu::Char.new({ value: 'e' }),
73
+ Vedeu::Char.new({ value: 'r' })
62
74
  ],[
63
- Vedeu::Char.new('.'),Vedeu::Char.new('.'),Vedeu::Char.new('M'),
64
- Vedeu::Char.new('e'),Vedeu::Char.new('t'),Vedeu::Char.new('a'),
65
- Vedeu::Char.new('l')
75
+ Vedeu::Char.new({ value: '.' }),
76
+ Vedeu::Char.new({ value: '.' }),
77
+ Vedeu::Char.new({ value: 'M' }),
78
+ Vedeu::Char.new({ value: 'e' }),
79
+ Vedeu::Char.new({ value: 't' }),
80
+ Vedeu::Char.new({ value: 'a' }),
81
+ Vedeu::Char.new({ value: 'l' })
66
82
  ],
67
83
  ]
68
84
  }
@@ -97,13 +113,21 @@ module Vedeu
97
113
  let(:data) {
98
114
  [
99
115
  [
100
- Vedeu::Char.new('G'),Vedeu::Char.new('a'),Vedeu::Char.new('l'),
101
- Vedeu::Char.new('l'),Vedeu::Char.new('i'),Vedeu::Char.new('u'),
102
- Vedeu::Char.new('m')
116
+ Vedeu::Char.new({ value: 'G' }),
117
+ Vedeu::Char.new({ value: 'a' }),
118
+ Vedeu::Char.new({ value: 'l' }),
119
+ Vedeu::Char.new({ value: 'l' }),
120
+ Vedeu::Char.new({ value: 'i' }),
121
+ Vedeu::Char.new({ value: 'u' }),
122
+ Vedeu::Char.new({ value: 'm' })
103
123
  ], [
104
- Vedeu::Char.new('-'),Vedeu::Char.new('.'),Vedeu::Char.new('G'),
105
- Vedeu::Char.new('a'),Vedeu::Char.new('.'),Vedeu::Char.new('3'),
106
- Vedeu::Char.new('1')
124
+ Vedeu::Char.new({ value: '-' }),
125
+ Vedeu::Char.new({ value: '.' }),
126
+ Vedeu::Char.new({ value: 'G' }),
127
+ Vedeu::Char.new({ value: 'a' }),
128
+ Vedeu::Char.new({ value: '.' }),
129
+ Vedeu::Char.new({ value: '3' }),
130
+ Vedeu::Char.new({ value: '1' })
107
131
  ]
108
132
  ]
109
133
  }
@@ -1,6 +1,5 @@
1
1
  require 'support/helpers/dsl_model_test_class'
2
2
  require 'support/helpers/helpers'
3
3
  require 'support/helpers/model_test_class'
4
- require 'support/helpers/presentation'
5
4
  require 'support/helpers/repositories'
6
5
  require 'support/helpers/repository_test_module'
@@ -11,6 +11,7 @@ module Vedeu
11
11
 
12
12
  private
13
13
 
14
+ # A storage solution that uses memory to persist models.
14
15
  def in_memory
15
16
  {}
16
17
  end
data/test/test_helper.rb CHANGED
@@ -4,6 +4,8 @@ require 'minitest/autorun'
4
4
  require 'minitest/pride' unless ENV['NO_COLOR']
5
5
  require 'minitest/hell'
6
6
 
7
+ # GC.disable # uncomment to remove ~20ms from test run speed
8
+
7
9
  SimpleCov.start do
8
10
  command_name 'MiniTest::Spec'
9
11
  add_filter '/test/'
@@ -44,8 +46,9 @@ def test_configuration
44
46
  # adds ~40ms to test run speed
45
47
  # debug!
46
48
 
47
- # if debug! above is commented out, then only Vedeu.log('...', true) will
48
- # be logged, otherwise every Vedeu.log('...') will be logged.
49
+ # if debug! above is commented out, then only
50
+ # `Vedeu.log(type: <any type>, message: '...', force: true)`
51
+ # will be logged, otherwise every `Vedeu.log` will be logged.
49
52
  log '/tmp/vedeu_test_helper.log'
50
53
  end
51
54
  end
data/vedeu.gemspec CHANGED
@@ -4,11 +4,11 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
4
 
5
5
  Gem::Specification.new do |spec|
6
6
  spec.name = 'vedeu'
7
- spec.version = '0.3.4'
7
+ spec.version = '0.3.5'
8
8
  spec.authors = ['Gavin Laking']
9
9
  spec.email = ['gavinlaking@gmail.com']
10
10
  spec.summary = %q{A terminal case of wonderland.}
11
- spec.description = %q{A GUI framework for terminal/console applications.}
11
+ spec.description = %q{A GUI framework written in Ruby for building terminal/console applications.}
12
12
  spec.homepage = 'https://github.com/gavinlaking/vedeu'
13
13
  spec.license = 'MIT'
14
14
 
@@ -20,16 +20,18 @@ Gem::Specification.new do |spec|
20
20
  spec.add_development_dependency 'aruba', '0.6.2'
21
21
  spec.add_development_dependency 'bundler', '~> 1.7'
22
22
  spec.add_development_dependency 'cucumber', '1.3.19'
23
- spec.add_development_dependency 'guard', '2.12.1'
23
+ spec.add_development_dependency 'guard', '2.12.3'
24
24
  spec.add_development_dependency 'guard-bundler', '2.1.0'
25
25
  spec.add_development_dependency 'guard-cucumber', '1.5.3'
26
- spec.add_development_dependency 'guard-minitest', '2.4.3'
26
+ spec.add_development_dependency 'guard-minitest', '2.4.4'
27
+ spec.add_development_dependency 'inch', '0.5.10'
27
28
  spec.add_development_dependency 'minitest', '5.5.1'
28
29
  spec.add_development_dependency 'minitest-reporters', '1.0.10'
29
30
  spec.add_development_dependency 'mocha', '1.1.0'
30
31
  spec.add_development_dependency 'pry', '0.10.1'
31
32
  spec.add_development_dependency 'pry-byebug', '3.0.1'
32
33
  spec.add_development_dependency 'rake', '10.4.2'
33
- spec.add_development_dependency 'simplecov', '0.9.1'
34
+ spec.add_development_dependency 'ruby-prof', '0.15.4'
35
+ spec.add_development_dependency 'simplecov', '0.9.2'
34
36
  spec.add_development_dependency 'yard', '0.8.7.6'
35
37
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vedeu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.4
4
+ version: 0.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gavin Laking
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-02-20 00:00:00.000000000 Z
11
+ date: 2015-02-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aruba
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 2.12.1
61
+ version: 2.12.3
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 2.12.1
68
+ version: 2.12.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: guard-bundler
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -100,14 +100,28 @@ dependencies:
100
100
  requirements:
101
101
  - - '='
102
102
  - !ruby/object:Gem::Version
103
- version: 2.4.3
103
+ version: 2.4.4
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
108
  - - '='
109
109
  - !ruby/object:Gem::Version
110
- version: 2.4.3
110
+ version: 2.4.4
111
+ - !ruby/object:Gem::Dependency
112
+ name: inch
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - '='
116
+ - !ruby/object:Gem::Version
117
+ version: 0.5.10
118
+ type: :development
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - '='
123
+ - !ruby/object:Gem::Version
124
+ version: 0.5.10
111
125
  - !ruby/object:Gem::Dependency
112
126
  name: minitest
113
127
  requirement: !ruby/object:Gem::Requirement
@@ -192,20 +206,34 @@ dependencies:
192
206
  - - '='
193
207
  - !ruby/object:Gem::Version
194
208
  version: 10.4.2
209
+ - !ruby/object:Gem::Dependency
210
+ name: ruby-prof
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - '='
214
+ - !ruby/object:Gem::Version
215
+ version: 0.15.4
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - '='
221
+ - !ruby/object:Gem::Version
222
+ version: 0.15.4
195
223
  - !ruby/object:Gem::Dependency
196
224
  name: simplecov
197
225
  requirement: !ruby/object:Gem::Requirement
198
226
  requirements:
199
227
  - - '='
200
228
  - !ruby/object:Gem::Version
201
- version: 0.9.1
229
+ version: 0.9.2
202
230
  type: :development
203
231
  prerelease: false
204
232
  version_requirements: !ruby/object:Gem::Requirement
205
233
  requirements:
206
234
  - - '='
207
235
  - !ruby/object:Gem::Version
208
- version: 0.9.1
236
+ version: 0.9.2
209
237
  - !ruby/object:Gem::Dependency
210
238
  name: yard
211
239
  requirement: !ruby/object:Gem::Requirement
@@ -220,12 +248,13 @@ dependencies:
220
248
  - - '='
221
249
  - !ruby/object:Gem::Version
222
250
  version: 0.8.7.6
223
- description: A GUI framework for terminal/console applications.
251
+ description: A GUI framework written in Ruby for building terminal/console applications.
224
252
  email:
225
253
  - gavinlaking@gmail.com
226
254
  executables:
227
255
  - vedeu
228
256
  - vedeu_drb_client
257
+ - vedeu_drb_server
229
258
  - vedeu_test
230
259
  extensions: []
231
260
  extra_rdoc_files: []
@@ -242,6 +271,7 @@ files:
242
271
  - Rakefile
243
272
  - bin/vedeu
244
273
  - bin/vedeu_drb_client
274
+ - bin/vedeu_drb_server
245
275
  - bin/vedeu_test
246
276
  - config/cucumber.yml
247
277
  - docs/api.md
@@ -253,12 +283,14 @@ files:
253
283
  - examples/colours_app.rb
254
284
  - examples/configuration_app.rb
255
285
  - examples/cursor_app.rb
286
+ - examples/drb_app.rb
256
287
  - examples/focus_app.rb
257
288
  - examples/geometry_app.rb
258
289
  - examples/hello_world.rb
259
290
  - examples/lines_app.rb
260
291
  - features/start_stop.feature
261
292
  - features/support/env.rb
293
+ - inch.yml
262
294
  - lib/vedeu.rb
263
295
  - lib/vedeu/all.rb
264
296
  - lib/vedeu/api.rb
@@ -275,9 +307,10 @@ files:
275
307
  - lib/vedeu/cursor/cursor.rb
276
308
  - lib/vedeu/cursor/move_cursor.rb
277
309
  - lib/vedeu/cursor/toggle_cursor.rb
310
+ - lib/vedeu/debug.rb
278
311
  - lib/vedeu/distributed/all.rb
279
- - lib/vedeu/distributed/application.rb
280
312
  - lib/vedeu/distributed/client.rb
313
+ - lib/vedeu/distributed/server.rb
281
314
  - lib/vedeu/distributed/subprocess.rb
282
315
  - lib/vedeu/distributed/templates/default_application.vedeu
283
316
  - lib/vedeu/distributed/templates/default_borders.vedeu
@@ -317,6 +350,7 @@ files:
317
350
  - lib/vedeu/input/keys.rb
318
351
  - lib/vedeu/input/mapper.rb
319
352
  - lib/vedeu/launcher.rb
353
+ - lib/vedeu/main_loop.rb
320
354
  - lib/vedeu/models/all.rb
321
355
  - lib/vedeu/models/collection.rb
322
356
  - lib/vedeu/models/focus.rb
@@ -337,9 +371,13 @@ files:
337
371
  - lib/vedeu/output/all.rb
338
372
  - lib/vedeu/output/border.rb
339
373
  - lib/vedeu/output/compositor.rb
374
+ - lib/vedeu/output/html_char.rb
375
+ - lib/vedeu/output/html_renderer.rb
340
376
  - lib/vedeu/output/output.rb
341
377
  - lib/vedeu/output/position_index.rb
378
+ - lib/vedeu/output/renderer.rb
342
379
  - lib/vedeu/output/viewport.rb
380
+ - lib/vedeu/output/virtual_buffer.rb
343
381
  - lib/vedeu/output/virtual_terminal.rb
344
382
  - lib/vedeu/output/wordwrap.rb
345
383
  - lib/vedeu/output/writer.rb
@@ -395,8 +433,8 @@ files:
395
433
  - test/lib/vedeu/cursor/cursor_test.rb
396
434
  - test/lib/vedeu/cursor/move_cursor_test.rb
397
435
  - test/lib/vedeu/cursor/toggle_cursor_test.rb
398
- - test/lib/vedeu/distributed/application_test.rb
399
436
  - test/lib/vedeu/distributed/client_test.rb
437
+ - test/lib/vedeu/distributed/server_test.rb
400
438
  - test/lib/vedeu/distributed/subprocess_test.rb
401
439
  - test/lib/vedeu/distributed/test_application_test.rb
402
440
  - test/lib/vedeu/distributed/uri_test.rb
@@ -420,6 +458,7 @@ files:
420
458
  - test/lib/vedeu/input/keymap_test.rb
421
459
  - test/lib/vedeu/input/mapper_test.rb
422
460
  - test/lib/vedeu/launcher_test.rb
461
+ - test/lib/vedeu/main_loop_test.rb
423
462
  - test/lib/vedeu/models/collection_test.rb
424
463
  - test/lib/vedeu/models/focus_test.rb
425
464
  - test/lib/vedeu/models/geometry_test.rb
@@ -437,9 +476,13 @@ files:
437
476
  - test/lib/vedeu/models/view/streams_test.rb
438
477
  - test/lib/vedeu/output/border_test.rb
439
478
  - test/lib/vedeu/output/compositor_test.rb
479
+ - test/lib/vedeu/output/html_char_test.rb
480
+ - test/lib/vedeu/output/html_renderer_test.rb
440
481
  - test/lib/vedeu/output/output_test.rb
441
482
  - test/lib/vedeu/output/position_index_test.rb
483
+ - test/lib/vedeu/output/renderer_test.rb
442
484
  - test/lib/vedeu/output/viewport_test.rb
485
+ - test/lib/vedeu/output/virtual_buffer_test.rb
443
486
  - test/lib/vedeu/output/virtual_terminal_test.rb
444
487
  - test/lib/vedeu/output/wordwrap_test.rb
445
488
  - test/lib/vedeu/output/writer_test.rb
@@ -478,7 +521,6 @@ files:
478
521
  - test/support/helpers/dsl_model_test_class.rb
479
522
  - test/support/helpers/helpers.rb
480
523
  - test/support/helpers/model_test_class.rb
481
- - test/support/helpers/presentation.rb
482
524
  - test/support/helpers/repositories.rb
483
525
  - test/support/helpers/repository_test_module.rb
484
526
  - test/support/stats.sh
@@ -530,8 +572,8 @@ test_files:
530
572
  - test/lib/vedeu/cursor/cursor_test.rb
531
573
  - test/lib/vedeu/cursor/move_cursor_test.rb
532
574
  - test/lib/vedeu/cursor/toggle_cursor_test.rb
533
- - test/lib/vedeu/distributed/application_test.rb
534
575
  - test/lib/vedeu/distributed/client_test.rb
576
+ - test/lib/vedeu/distributed/server_test.rb
535
577
  - test/lib/vedeu/distributed/subprocess_test.rb
536
578
  - test/lib/vedeu/distributed/test_application_test.rb
537
579
  - test/lib/vedeu/distributed/uri_test.rb
@@ -555,6 +597,7 @@ test_files:
555
597
  - test/lib/vedeu/input/keymap_test.rb
556
598
  - test/lib/vedeu/input/mapper_test.rb
557
599
  - test/lib/vedeu/launcher_test.rb
600
+ - test/lib/vedeu/main_loop_test.rb
558
601
  - test/lib/vedeu/models/collection_test.rb
559
602
  - test/lib/vedeu/models/focus_test.rb
560
603
  - test/lib/vedeu/models/geometry_test.rb
@@ -572,9 +615,13 @@ test_files:
572
615
  - test/lib/vedeu/models/view/streams_test.rb
573
616
  - test/lib/vedeu/output/border_test.rb
574
617
  - test/lib/vedeu/output/compositor_test.rb
618
+ - test/lib/vedeu/output/html_char_test.rb
619
+ - test/lib/vedeu/output/html_renderer_test.rb
575
620
  - test/lib/vedeu/output/output_test.rb
576
621
  - test/lib/vedeu/output/position_index_test.rb
622
+ - test/lib/vedeu/output/renderer_test.rb
577
623
  - test/lib/vedeu/output/viewport_test.rb
624
+ - test/lib/vedeu/output/virtual_buffer_test.rb
578
625
  - test/lib/vedeu/output/virtual_terminal_test.rb
579
626
  - test/lib/vedeu/output/wordwrap_test.rb
580
627
  - test/lib/vedeu/output/writer_test.rb
@@ -613,7 +660,6 @@ test_files:
613
660
  - test/support/helpers/dsl_model_test_class.rb
614
661
  - test/support/helpers/helpers.rb
615
662
  - test/support/helpers/model_test_class.rb
616
- - test/support/helpers/presentation.rb
617
663
  - test/support/helpers/repositories.rb
618
664
  - test/support/helpers/repository_test_module.rb
619
665
  - test/support/stats.sh
@@ -1,91 +0,0 @@
1
- require 'drb'
2
-
3
- module Vedeu
4
-
5
- module Distributed
6
-
7
- # Orchestrates the running of the main application loop via the DRb server.
8
- #
9
- # @example
10
- # app = Vedeu::Distributed::Application.start(configuration)
11
- # app.input('a')
12
- # app.output # => some output
13
- # app.stop
14
- #
15
- # @api private
16
- class Application
17
-
18
- class << self
19
-
20
- # @param configuration [Vedeu::Configuration]
21
- # @return []
22
- def start(configuration)
23
- new(configuration).start
24
- end
25
-
26
- end
27
-
28
- # @param configuration [Vedeu::Configuration]
29
- # @return []
30
- def initialize(configuration)
31
- @configuration = configuration
32
-
33
- # $SAFE = 1 # stop eval and friends
34
- end
35
-
36
- # @return []
37
- def start
38
- Vedeu.bind(:_output_) { |data| self.output(data) }
39
-
40
- Vedeu.log("Started distributed server: '#{uri}'")
41
-
42
- DRb.start_service(uri, self)
43
-
44
- self
45
- end
46
-
47
- # @param data []
48
- # @return []
49
- def input(data)
50
- Vedeu.log("<<< DRb Input")
51
-
52
- Vedeu.trigger(:_keypress_, data)
53
- end
54
- alias_method :read, :input
55
-
56
- # @param data []
57
- # @return []
58
- def output(data = nil)
59
- Vedeu.log(">>> DRb Output")
60
-
61
- data
62
- end
63
- alias_method :write, :output
64
-
65
- # @return []
66
- def stop
67
- Vedeu.log("Stopping distributed server: '#{uri}'")
68
-
69
- DRb.stop_service
70
-
71
- DRb.thread.join
72
- rescue NoMethodError # raised when #join is called on NilClass.
73
- # ...
74
-
75
- end
76
-
77
- private
78
-
79
- attr_reader :configuration
80
-
81
- # @return [String]
82
- def uri
83
- Vedeu::Distributed::Uri.new(configuration.drb_host,
84
- configuration.drb_port).to_s
85
- end
86
-
87
- end # Application
88
-
89
- end # Distributed
90
-
91
- end # Vedeu
@@ -1,24 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Vedeu
4
-
5
- module Distributed
6
-
7
- describe Application do
8
-
9
- let(:described) { Vedeu::Distributed::Application }
10
- let(:instance) { described.new(configuration) }
11
- let(:configuration) {}
12
-
13
- describe '#initialize' do
14
- subject { instance }
15
-
16
- it { subject.must_be_instance_of(Vedeu::Distributed::Application) }
17
- it { subject.instance_variable_get('@configuration').must_equal(configuration) }
18
- end
19
-
20
- end # Application
21
-
22
- end # Distributed
23
-
24
- end # Vedeu
@@ -1,16 +0,0 @@
1
- module Vedeu
2
-
3
- class PresentationTestClass
4
-
5
- include Presentation
6
-
7
- def attributes
8
- {
9
- colour: { background: '#000033', foreground: '#aadd00' },
10
- style: ['bold']
11
- }
12
- end
13
-
14
- end # PresentationTestClass
15
-
16
- end # Vedeu