vedeu 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (588) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/.yardopts +0 -1
  4. data/README.md +1 -4
  5. data/docs/api.md +0 -8
  6. data/docs/borders.md +4 -0
  7. data/docs/dsl/borders.md +37 -0
  8. data/docs/dsl/by_method/add_command.md +0 -0
  9. data/docs/dsl/by_method/add_keypress.md +0 -0
  10. data/docs/dsl/by_method/all_commands.md +0 -0
  11. data/docs/dsl/by_method/all_keypresses.md +0 -0
  12. data/docs/dsl/by_method/background_colours.md +3 -0
  13. data/docs/dsl/by_method/bind.md +0 -0
  14. data/docs/dsl/by_method/bind_alias.md +0 -0
  15. data/docs/dsl/by_method/border.md +7 -0
  16. data/docs/dsl/by_method/borders.md +0 -0
  17. data/docs/dsl/by_method/bottom.md +10 -0
  18. data/docs/dsl/by_method/bottom_horizontal.md +8 -0
  19. data/docs/dsl/by_method/bottom_left.md +8 -0
  20. data/docs/dsl/by_method/bottom_right.md +8 -0
  21. data/docs/dsl/by_method/bound.md +0 -0
  22. data/docs/dsl/by_method/buffer_update.md +0 -0
  23. data/docs/dsl/by_method/buffer_write.md +0 -0
  24. data/docs/dsl/by_method/buffers.md +0 -0
  25. data/docs/dsl/by_method/caption.md +11 -0
  26. data/docs/dsl/by_method/clear.md +7 -0
  27. data/docs/dsl/by_method/clear_by_group.md +0 -0
  28. data/docs/dsl/by_method/clear_by_name.md +0 -0
  29. data/docs/dsl/by_method/clear_content_by_name.md +0 -0
  30. data/docs/dsl/by_method/clock_time.md +0 -0
  31. data/docs/dsl/by_method/configuration.md +5 -0
  32. data/docs/dsl/by_method/configure.md +6 -0
  33. data/docs/dsl/by_method/cursor.md +0 -0
  34. data/docs/dsl/by_method/cursors.md +0 -0
  35. data/docs/dsl/by_method/debug.md +4 -0
  36. data/docs/dsl/by_method/direct_write.md +0 -0
  37. data/docs/dsl/by_method/disable.md +14 -0
  38. data/docs/dsl/by_method/documents.md +0 -0
  39. data/docs/dsl/by_method/drb_restart.md +0 -0
  40. data/docs/dsl/by_method/drb_start.md +0 -0
  41. data/docs/dsl/by_method/drb_status.md +0 -0
  42. data/docs/dsl/by_method/drb_stop.md +0 -0
  43. data/docs/dsl/by_method/enable.md +14 -0
  44. data/docs/dsl/by_method/events.md +0 -0
  45. data/docs/dsl/by_method/exit.md +0 -0
  46. data/docs/dsl/by_method/focus.md +0 -0
  47. data/docs/dsl/by_method/focus_by_name.md +0 -0
  48. data/docs/dsl/by_method/focus_next.md +0 -0
  49. data/docs/dsl/by_method/focus_previous.md +0 -0
  50. data/docs/dsl/by_method/focussed.md +0 -0
  51. data/docs/dsl/by_method/foreground_colours.md +3 -0
  52. data/docs/dsl/by_method/geometries.md +0 -0
  53. data/docs/dsl/by_method/geometry.md +0 -0
  54. data/docs/dsl/by_method/goto.md +6 -0
  55. data/docs/dsl/by_method/group.md +0 -0
  56. data/docs/dsl/by_method/groups.md +0 -0
  57. data/docs/dsl/by_method/height.md +7 -0
  58. data/docs/dsl/by_method/hide_cursor.md +0 -0
  59. data/docs/dsl/by_method/hide_group.md +0 -0
  60. data/docs/dsl/by_method/hide_interface.md +0 -0
  61. data/docs/dsl/by_method/horizontal.md +6 -0
  62. data/docs/dsl/by_method/interface.md +0 -0
  63. data/docs/dsl/by_method/interfaces.md +0 -0
  64. data/docs/dsl/by_method/keymap.md +0 -0
  65. data/docs/dsl/by_method/keymaps.md +0 -0
  66. data/docs/dsl/by_method/keypress.md +0 -0
  67. data/docs/dsl/by_method/last_command.md +0 -0
  68. data/docs/dsl/by_method/last_keypress.md +0 -0
  69. data/docs/dsl/by_method/left.md +10 -0
  70. data/docs/dsl/by_method/left_vertical.md +8 -0
  71. data/docs/dsl/by_method/log.md +0 -0
  72. data/docs/dsl/by_method/log_stderr.md +0 -0
  73. data/docs/dsl/by_method/log_stdout.md +0 -0
  74. data/docs/dsl/by_method/log_timestamp.md +0 -0
  75. data/docs/dsl/by_method/menu.md +0 -0
  76. data/docs/dsl/by_method/menus.md +0 -0
  77. data/docs/dsl/by_method/profile.md +6 -0
  78. data/docs/dsl/by_method/read.md +0 -0
  79. data/docs/dsl/by_method/ready.md +0 -0
  80. data/docs/dsl/by_method/refresh.md +3 -0
  81. data/docs/dsl/by_method/render.md +0 -0
  82. data/docs/dsl/by_method/render_output.md +0 -0
  83. data/docs/dsl/by_method/renderer.md +0 -0
  84. data/docs/dsl/by_method/renderers.md +0 -0
  85. data/docs/dsl/by_method/renders.md +0 -0
  86. data/docs/dsl/by_method/resize.md +5 -0
  87. data/docs/dsl/by_method/right.md +10 -0
  88. data/docs/dsl/by_method/right_vertical.md +8 -0
  89. data/docs/dsl/by_method/show_cursor.md +0 -0
  90. data/docs/dsl/by_method/show_group.md +0 -0
  91. data/docs/dsl/by_method/show_interface.md +0 -0
  92. data/docs/dsl/by_method/timer.md +12 -0
  93. data/docs/dsl/by_method/title.md +12 -0
  94. data/docs/dsl/by_method/toggle_cursor.md +0 -0
  95. data/docs/dsl/by_method/toggle_group.md +0 -0
  96. data/docs/dsl/by_method/toggle_interface.md +0 -0
  97. data/docs/dsl/by_method/top.md +10 -0
  98. data/docs/dsl/by_method/top_horizontal.md +8 -0
  99. data/docs/dsl/by_method/top_left.md +8 -0
  100. data/docs/dsl/by_method/top_right.md +8 -0
  101. data/docs/dsl/by_method/trigger.md +0 -0
  102. data/docs/dsl/by_method/unbind.md +0 -0
  103. data/docs/dsl/by_method/unbind_alias.md +0 -0
  104. data/docs/dsl/by_method/vertical.md +7 -0
  105. data/docs/dsl/by_method/views.md +0 -0
  106. data/docs/dsl/by_method/width.md +7 -0
  107. data/docs/dsl/by_method/write.md +0 -0
  108. data/examples/284_slow_rendering.rb +6 -3
  109. data/examples/dsl_alignment.rb +16 -14
  110. data/examples/dsl_colours.rb +17 -14
  111. data/examples/dsl_demo_groups.rb +3 -0
  112. data/examples/dsl_editor.rb +13 -10
  113. data/examples/dsl_hello_worlds.rb +2 -0
  114. data/examples/dsl_horizontal_alignment.rb +14 -27
  115. data/examples/dsl_menus.rb +2 -0
  116. data/examples/dsl_vertical_alignment.rb +35 -27
  117. data/examples/views/empty_template.rb +3 -1
  118. data/examples/views/full_screen.rb +100 -0
  119. data/examples/views/line.rb +5 -2
  120. data/examples/views/lines.rb +5 -2
  121. data/examples/views/lines_alignment.rb +5 -2
  122. data/examples/views/lines_line_stream.rb +14 -18
  123. data/examples/views/lines_line_streams.rb +5 -3
  124. data/examples/views/lines_line_streams_stream.rb +16 -21
  125. data/examples/views/lines_line_streams_stream_stream.rb +5 -8
  126. data/examples/views/lines_streams.rb +5 -7
  127. data/examples/views/lines_streams_stream.rb +5 -8
  128. data/lib/vedeu.rb +16 -0
  129. data/lib/vedeu/all.rb +11 -8
  130. data/lib/vedeu/application/application_controller.rb +2 -0
  131. data/lib/vedeu/application/application_helper.rb +2 -0
  132. data/lib/vedeu/application/application_view.rb +4 -2
  133. data/lib/vedeu/application/controller.rb +2 -0
  134. data/lib/vedeu/application/helper.rb +2 -0
  135. data/lib/vedeu/application/view.rb +2 -0
  136. data/lib/vedeu/boolean.rb +2 -0
  137. data/lib/vedeu/borders/all.rb +2 -1
  138. data/lib/vedeu/borders/border.rb +5 -3
  139. data/lib/vedeu/borders/caption.rb +2 -0
  140. data/lib/vedeu/borders/dsl.rb +37 -160
  141. data/lib/vedeu/borders/refresh.rb +3 -1
  142. data/lib/vedeu/borders/repository.rb +8 -2
  143. data/lib/vedeu/borders/title.rb +3 -1
  144. data/lib/vedeu/buffers/all.rb +2 -0
  145. data/lib/vedeu/buffers/buffer.rb +4 -2
  146. data/lib/vedeu/buffers/empty.rb +2 -0
  147. data/lib/vedeu/buffers/null.rb +2 -0
  148. data/lib/vedeu/buffers/refresh.rb +2 -0
  149. data/lib/vedeu/buffers/repository.rb +2 -0
  150. data/lib/vedeu/buffers/terminal.rb +6 -14
  151. data/lib/vedeu/buffers/view.rb +2 -0
  152. data/lib/vedeu/cells/all.rb +2 -0
  153. data/lib/vedeu/cells/border.rb +2 -0
  154. data/lib/vedeu/cells/borders/all.rb +2 -0
  155. data/lib/vedeu/cells/borders/bottom_horizontal.rb +2 -0
  156. data/lib/vedeu/cells/borders/bottom_left.rb +2 -0
  157. data/lib/vedeu/cells/borders/bottom_right.rb +2 -0
  158. data/lib/vedeu/cells/borders/corner.rb +2 -0
  159. data/lib/vedeu/cells/borders/horizontal.rb +2 -0
  160. data/lib/vedeu/cells/borders/left_vertical.rb +2 -0
  161. data/lib/vedeu/cells/borders/right_vertical.rb +2 -0
  162. data/lib/vedeu/cells/borders/top_horizontal.rb +2 -0
  163. data/lib/vedeu/cells/borders/top_left.rb +2 -0
  164. data/lib/vedeu/cells/borders/top_right.rb +2 -0
  165. data/lib/vedeu/cells/borders/vertical.rb +2 -0
  166. data/lib/vedeu/cells/char.rb +2 -0
  167. data/lib/vedeu/cells/clear.rb +3 -1
  168. data/lib/vedeu/cells/empty.rb +6 -4
  169. data/lib/vedeu/cells/escape.rb +4 -2
  170. data/lib/vedeu/cells/html.rb +2 -0
  171. data/lib/vedeu/cells/json.rb +2 -0
  172. data/lib/vedeu/coercers/alignment.rb +2 -0
  173. data/lib/vedeu/coercers/all.rb +2 -0
  174. data/lib/vedeu/coercers/colour.rb +3 -1
  175. data/lib/vedeu/coercers/colour_attributes.rb +2 -0
  176. data/lib/vedeu/coercers/horizontal_alignment.rb +2 -0
  177. data/lib/vedeu/coercers/vertical_alignment.rb +2 -0
  178. data/lib/vedeu/colours/all.rb +2 -0
  179. data/lib/vedeu/colours/background.rb +3 -1
  180. data/lib/vedeu/colours/backgrounds.rb +3 -5
  181. data/lib/vedeu/colours/colour.rb +2 -0
  182. data/lib/vedeu/colours/foreground.rb +3 -1
  183. data/lib/vedeu/colours/foregrounds.rb +3 -5
  184. data/lib/vedeu/colours/repository.rb +2 -0
  185. data/lib/vedeu/colours/translator.rb +5 -3
  186. data/lib/vedeu/colours/validator.rb +3 -1
  187. data/lib/vedeu/common.rb +17 -8
  188. data/lib/vedeu/configuration/all.rb +4 -2
  189. data/lib/vedeu/configuration/api.rb +5 -15
  190. data/lib/vedeu/configuration/configuration.rb +14 -27
  191. data/lib/vedeu/cursors/all.rb +2 -0
  192. data/lib/vedeu/cursors/coordinate.rb +4 -2
  193. data/lib/vedeu/cursors/cursor.rb +7 -5
  194. data/lib/vedeu/cursors/dsl.rb +2 -0
  195. data/lib/vedeu/cursors/move.rb +2 -0
  196. data/lib/vedeu/cursors/refresh.rb +3 -1
  197. data/lib/vedeu/cursors/reposition.rb +2 -0
  198. data/lib/vedeu/cursors/repository.rb +2 -0
  199. data/lib/vedeu/distributed/all.rb +2 -0
  200. data/lib/vedeu/distributed/client.rb +5 -3
  201. data/lib/vedeu/distributed/server.rb +17 -15
  202. data/lib/vedeu/distributed/subprocess.rb +4 -2
  203. data/lib/vedeu/distributed/test_application.rb +2 -0
  204. data/lib/vedeu/distributed/uri.rb +3 -1
  205. data/lib/vedeu/dsl/all.rb +2 -0
  206. data/lib/vedeu/dsl/attributes.rb +7 -5
  207. data/lib/vedeu/dsl/border.rb +2 -0
  208. data/lib/vedeu/dsl/cursors.rb +2 -0
  209. data/lib/vedeu/dsl/dsl.rb +3 -1
  210. data/lib/vedeu/dsl/elements.rb +14 -8
  211. data/lib/vedeu/dsl/geometry.rb +2 -0
  212. data/lib/vedeu/dsl/presentation.rb +2 -0
  213. data/lib/vedeu/dsl/string/align.rb +2 -0
  214. data/lib/vedeu/dsl/string/all.rb +2 -0
  215. data/lib/vedeu/dsl/string/text.rb +2 -0
  216. data/lib/vedeu/dsl/string/truncate.rb +2 -0
  217. data/lib/vedeu/dsl/string/wordwrap.rb +3 -1
  218. data/lib/vedeu/dsl/use.rb +2 -0
  219. data/lib/vedeu/dsl/view.rb +5 -3
  220. data/lib/vedeu/dsl/views.rb +4 -2
  221. data/lib/vedeu/editor/all.rb +2 -0
  222. data/lib/vedeu/editor/collection.rb +2 -0
  223. data/lib/vedeu/editor/cropper.rb +3 -1
  224. data/lib/vedeu/editor/cursor.rb +4 -2
  225. data/lib/vedeu/editor/delete.rb +2 -0
  226. data/lib/vedeu/editor/document.rb +3 -1
  227. data/lib/vedeu/editor/editor.rb +2 -0
  228. data/lib/vedeu/editor/insert.rb +16 -6
  229. data/lib/vedeu/editor/item.rb +2 -0
  230. data/lib/vedeu/editor/line.rb +2 -0
  231. data/lib/vedeu/editor/lines.rb +2 -0
  232. data/lib/vedeu/editor/repository.rb +2 -0
  233. data/lib/vedeu/error.rb +9 -4
  234. data/lib/vedeu/esc/actions.rb +17 -15
  235. data/lib/vedeu/esc/all.rb +2 -0
  236. data/lib/vedeu/esc/background.rb +36 -34
  237. data/lib/vedeu/esc/borders.rb +14 -12
  238. data/lib/vedeu/esc/colours.rb +12 -8
  239. data/lib/vedeu/esc/esc.rb +16 -14
  240. data/lib/vedeu/esc/foreground.rb +36 -34
  241. data/lib/vedeu/esc/mouse.rb +6 -4
  242. data/lib/vedeu/events/aliases.rb +3 -1
  243. data/lib/vedeu/events/all.rb +2 -0
  244. data/lib/vedeu/events/collection.rb +2 -0
  245. data/lib/vedeu/events/event.rb +21 -9
  246. data/lib/vedeu/events/repository.rb +2 -0
  247. data/lib/vedeu/events/trigger.rb +3 -1
  248. data/lib/vedeu/geometries/all.rb +2 -0
  249. data/lib/vedeu/geometries/area/all.rb +2 -0
  250. data/lib/vedeu/geometries/area/area.rb +46 -18
  251. data/lib/vedeu/geometries/area/dimension.rb +7 -0
  252. data/lib/vedeu/geometries/area/x_dimension.rb +2 -0
  253. data/lib/vedeu/geometries/area/y_dimension.rb +2 -0
  254. data/lib/vedeu/geometries/dsl/all.rb +2 -0
  255. data/lib/vedeu/geometries/dsl/dsl.rb +2 -0
  256. data/lib/vedeu/geometries/dsl/grid.rb +2 -0
  257. data/lib/vedeu/geometries/dsl/validator.rb +6 -4
  258. data/lib/vedeu/geometries/geometry.rb +4 -2
  259. data/lib/vedeu/geometries/move.rb +3 -1
  260. data/lib/vedeu/geometries/position.rb +4 -2
  261. data/lib/vedeu/geometries/positionable.rb +2 -0
  262. data/lib/vedeu/geometries/repository.rb +2 -0
  263. data/lib/vedeu/groups/all.rb +2 -0
  264. data/lib/vedeu/groups/clear.rb +2 -0
  265. data/lib/vedeu/groups/dsl.rb +3 -1
  266. data/lib/vedeu/groups/group.rb +3 -1
  267. data/lib/vedeu/groups/refresh.rb +4 -2
  268. data/lib/vedeu/groups/repository.rb +2 -0
  269. data/lib/vedeu/input/all.rb +2 -0
  270. data/lib/vedeu/input/capture.rb +4 -2
  271. data/lib/vedeu/input/dsl.rb +8 -6
  272. data/lib/vedeu/input/key.rb +3 -1
  273. data/lib/vedeu/input/keymap.rb +5 -3
  274. data/lib/vedeu/input/keys.rb +2 -0
  275. data/lib/vedeu/input/mapper.rb +7 -5
  276. data/lib/vedeu/input/mouse.rb +4 -2
  277. data/lib/vedeu/input/raw.rb +2 -0
  278. data/lib/vedeu/input/read.rb +3 -1
  279. data/lib/vedeu/input/repository.rb +2 -0
  280. data/lib/vedeu/input/store.rb +2 -0
  281. data/lib/vedeu/input/translator.rb +3 -1
  282. data/lib/vedeu/interfaces/all.rb +2 -0
  283. data/lib/vedeu/interfaces/clear.rb +7 -5
  284. data/lib/vedeu/interfaces/dsl.rb +4 -2
  285. data/lib/vedeu/interfaces/interface.rb +4 -2
  286. data/lib/vedeu/interfaces/null.rb +2 -0
  287. data/lib/vedeu/interfaces/repository.rb +2 -0
  288. data/lib/vedeu/logging/all.rb +2 -1
  289. data/lib/vedeu/logging/clock_time.rb +2 -0
  290. data/lib/vedeu/logging/debug.rb +32 -44
  291. data/lib/vedeu/logging/lockless_log_device.rb +3 -1
  292. data/lib/vedeu/logging/log.rb +13 -39
  293. data/lib/vedeu/logging/mono_logger.rb +3 -1
  294. data/lib/vedeu/logging/timer.rb +7 -19
  295. data/lib/vedeu/menus/all.rb +2 -0
  296. data/lib/vedeu/menus/dsl.rb +2 -0
  297. data/lib/vedeu/menus/menu.rb +3 -1
  298. data/lib/vedeu/menus/repository.rb +2 -0
  299. data/lib/vedeu/models/all.rb +2 -0
  300. data/lib/vedeu/models/focus.rb +7 -5
  301. data/lib/vedeu/models/page.rb +3 -1
  302. data/lib/vedeu/models/row.rb +2 -0
  303. data/lib/vedeu/models/toggleable.rb +2 -0
  304. data/lib/vedeu/null/all.rb +2 -0
  305. data/lib/vedeu/null/generic.rb +2 -0
  306. data/lib/vedeu/output/all.rb +2 -0
  307. data/lib/vedeu/output/compressor.rb +9 -7
  308. data/lib/vedeu/output/compressor_cache.rb +3 -1
  309. data/lib/vedeu/output/output.rb +2 -0
  310. data/lib/vedeu/output/refresh.rb +3 -1
  311. data/lib/vedeu/output/viewport.rb +4 -2
  312. data/lib/vedeu/output/write.rb +2 -0
  313. data/lib/vedeu/plugins/plugin.rb +5 -3
  314. data/lib/vedeu/plugins/plugins.rb +5 -3
  315. data/lib/vedeu/presentation/all.rb +2 -0
  316. data/lib/vedeu/presentation/background.rb +2 -0
  317. data/lib/vedeu/presentation/colour.rb +2 -0
  318. data/lib/vedeu/presentation/foreground.rb +2 -0
  319. data/lib/vedeu/presentation/presentation.rb +4 -2
  320. data/lib/vedeu/presentation/style.rb +2 -0
  321. data/lib/vedeu/presentation/styles.rb +2 -0
  322. data/lib/vedeu/renderers/all.rb +10 -22
  323. data/lib/vedeu/renderers/file.rb +4 -2
  324. data/lib/vedeu/renderers/html.rb +19 -19
  325. data/lib/vedeu/renderers/json.rb +2 -0
  326. data/lib/vedeu/renderers/options.rb +2 -0
  327. data/lib/vedeu/renderers/terminal.rb +2 -0
  328. data/lib/vedeu/renderers/text.rb +2 -0
  329. data/lib/vedeu/repositories/all.rb +2 -0
  330. data/lib/vedeu/repositories/assemblage.rb +2 -0
  331. data/lib/vedeu/repositories/collection.rb +2 -0
  332. data/lib/vedeu/repositories/defaults.rb +2 -0
  333. data/lib/vedeu/repositories/model.rb +3 -1
  334. data/lib/vedeu/repositories/parent.rb +2 -0
  335. data/lib/vedeu/repositories/registerable.rb +2 -0
  336. data/lib/vedeu/repositories/repositories.rb +3 -1
  337. data/lib/vedeu/repositories/repository.rb +8 -6
  338. data/lib/vedeu/repositories/store.rb +3 -1
  339. data/lib/vedeu/runtime/all.rb +2 -0
  340. data/lib/vedeu/runtime/application.rb +2 -0
  341. data/lib/vedeu/runtime/bootstrap.rb +10 -8
  342. data/lib/vedeu/runtime/flags.rb +2 -0
  343. data/lib/vedeu/runtime/launcher.rb +5 -3
  344. data/lib/vedeu/runtime/main_loop.rb +3 -1
  345. data/lib/vedeu/runtime/router.rb +11 -14
  346. data/lib/vedeu/runtime/traps.rb +2 -0
  347. data/lib/vedeu/templating/all.rb +2 -0
  348. data/lib/vedeu/templating/decoder.rb +2 -0
  349. data/lib/vedeu/templating/encoder.rb +3 -1
  350. data/lib/vedeu/templating/helpers.rb +5 -3
  351. data/lib/vedeu/templating/template.rb +4 -2
  352. data/lib/vedeu/templating/view_template.rb +2 -0
  353. data/lib/vedeu/terminal/all.rb +2 -0
  354. data/lib/vedeu/terminal/mode.rb +2 -0
  355. data/lib/vedeu/terminal/terminal.rb +9 -34
  356. data/lib/vedeu/version.rb +3 -1
  357. data/lib/vedeu/views/all.rb +2 -0
  358. data/lib/vedeu/views/char.rb +5 -7
  359. data/lib/vedeu/views/chars.rb +3 -1
  360. data/lib/vedeu/views/composition.rb +2 -0
  361. data/lib/vedeu/views/default_attributes.rb +4 -2
  362. data/lib/vedeu/views/html_char.rb +18 -15
  363. data/lib/vedeu/views/line.rb +2 -0
  364. data/lib/vedeu/views/lines.rb +3 -1
  365. data/lib/vedeu/views/stream.rb +2 -0
  366. data/lib/vedeu/views/streams.rb +3 -1
  367. data/lib/vedeu/views/value.rb +2 -0
  368. data/lib/vedeu/views/view.rb +4 -3
  369. data/lib/vedeu/views/views.rb +2 -0
  370. data/test/lib/vedeu/application/application_controller_test.rb +2 -0
  371. data/test/lib/vedeu/application/application_helper_test.rb +2 -0
  372. data/test/lib/vedeu/application/application_view_test.rb +2 -0
  373. data/test/lib/vedeu/application/controller_test.rb +2 -0
  374. data/test/lib/vedeu/application/helper_test.rb +2 -0
  375. data/test/lib/vedeu/application/view_test.rb +2 -0
  376. data/test/lib/vedeu/boolean_test.rb +2 -0
  377. data/test/lib/vedeu/borders/border_test.rb +2 -0
  378. data/test/lib/vedeu/borders/caption_test.rb +2 -0
  379. data/test/lib/vedeu/borders/dsl_test.rb +6 -0
  380. data/test/lib/vedeu/borders/refresh_test.rb +2 -0
  381. data/test/lib/vedeu/borders/repository_test.rb +2 -0
  382. data/test/lib/vedeu/borders/title_test.rb +2 -0
  383. data/test/lib/vedeu/buffers/buffer_test.rb +2 -0
  384. data/test/lib/vedeu/buffers/empty_test.rb +2 -0
  385. data/test/lib/vedeu/buffers/null_test.rb +2 -0
  386. data/test/lib/vedeu/buffers/refresh_test.rb +2 -0
  387. data/test/lib/vedeu/buffers/repository_test.rb +2 -0
  388. data/test/lib/vedeu/buffers/terminal_test.rb +2 -0
  389. data/test/lib/vedeu/buffers/view_test.rb +2 -0
  390. data/test/lib/vedeu/cells/border_test.rb +2 -0
  391. data/test/lib/vedeu/cells/borders/bottom_horizontal_test.rb +2 -0
  392. data/test/lib/vedeu/cells/borders/bottom_left_test.rb +2 -0
  393. data/test/lib/vedeu/cells/borders/bottom_right_test.rb +2 -0
  394. data/test/lib/vedeu/cells/borders/corner_test.rb +2 -0
  395. data/test/lib/vedeu/cells/borders/horizontal_test.rb +2 -0
  396. data/test/lib/vedeu/cells/borders/left_vertical_test.rb +2 -0
  397. data/test/lib/vedeu/cells/borders/right_vertical_test.rb +2 -0
  398. data/test/lib/vedeu/cells/borders/top_horizontal_test.rb +2 -0
  399. data/test/lib/vedeu/cells/borders/top_left_test.rb +2 -0
  400. data/test/lib/vedeu/cells/borders/top_right_test.rb +2 -0
  401. data/test/lib/vedeu/cells/borders/vertical_test.rb +2 -0
  402. data/test/lib/vedeu/cells/char_test.rb +2 -0
  403. data/test/lib/vedeu/cells/clear_test.rb +2 -0
  404. data/test/lib/vedeu/cells/empty_test.rb +2 -0
  405. data/test/lib/vedeu/cells/escape_test.rb +2 -0
  406. data/test/lib/vedeu/cells/html_test.rb +2 -0
  407. data/test/lib/vedeu/cells/json_test.rb +2 -0
  408. data/test/lib/vedeu/coercers/alignment_test.rb +2 -0
  409. data/test/lib/vedeu/coercers/colour_attributes_test.rb +2 -0
  410. data/test/lib/vedeu/coercers/colour_test.rb +2 -0
  411. data/test/lib/vedeu/coercers/horizontal_alignment_test.rb +2 -0
  412. data/test/lib/vedeu/coercers/vertical_alignment_test.rb +2 -0
  413. data/test/lib/vedeu/colours/background_test.rb +2 -0
  414. data/test/lib/vedeu/colours/backgrounds_test.rb +2 -0
  415. data/test/lib/vedeu/colours/colour_test.rb +2 -0
  416. data/test/lib/vedeu/colours/foreground_test.rb +2 -0
  417. data/test/lib/vedeu/colours/foregrounds_test.rb +2 -0
  418. data/test/lib/vedeu/colours/repository_test.rb +2 -0
  419. data/test/lib/vedeu/colours/translator_test.rb +2 -0
  420. data/test/lib/vedeu/colours/validator_test.rb +2 -0
  421. data/test/lib/vedeu/common_test.rb +39 -6
  422. data/test/lib/vedeu/configuration/api_test.rb +37 -18
  423. data/test/lib/vedeu/configuration/configuration_test.rb +4 -2
  424. data/test/lib/vedeu/cursors/coordinate_test.rb +2 -0
  425. data/test/lib/vedeu/cursors/cursor_test.rb +2 -0
  426. data/test/lib/vedeu/cursors/dsl_test.rb +2 -0
  427. data/test/lib/vedeu/cursors/move_test.rb +2 -0
  428. data/test/lib/vedeu/cursors/refresh_test.rb +2 -0
  429. data/test/lib/vedeu/cursors/reposition_test.rb +2 -0
  430. data/test/lib/vedeu/cursors/repository_test.rb +2 -0
  431. data/test/lib/vedeu/distributed/client_test.rb +2 -0
  432. data/test/lib/vedeu/distributed/server_test.rb +2 -0
  433. data/test/lib/vedeu/distributed/subprocess_test.rb +2 -0
  434. data/test/lib/vedeu/distributed/test_application_test.rb +2 -0
  435. data/test/lib/vedeu/distributed/uri_test.rb +2 -0
  436. data/test/lib/vedeu/dsl/attributes_test.rb +2 -0
  437. data/test/lib/vedeu/dsl/border_test.rb +2 -0
  438. data/test/lib/vedeu/dsl/cursors_test.rb +2 -0
  439. data/test/lib/vedeu/dsl/dsl_test.rb +2 -0
  440. data/test/lib/vedeu/dsl/elements_test.rb +2 -0
  441. data/test/lib/vedeu/dsl/geometry_test.rb +2 -0
  442. data/test/lib/vedeu/dsl/presentation_test.rb +2 -0
  443. data/test/lib/vedeu/dsl/string/align_test.rb +2 -0
  444. data/test/lib/vedeu/dsl/string/text_test.rb +2 -0
  445. data/test/lib/vedeu/dsl/string/truncate_test.rb +2 -0
  446. data/test/lib/vedeu/dsl/string/wordwrap_test.rb +2 -0
  447. data/test/lib/vedeu/dsl/use_test.rb +2 -0
  448. data/test/lib/vedeu/dsl/view_test.rb +2 -0
  449. data/test/lib/vedeu/dsl/views_test.rb +2 -0
  450. data/test/lib/vedeu/editor/collection_test.rb +2 -0
  451. data/test/lib/vedeu/editor/cropper_test.rb +2 -0
  452. data/test/lib/vedeu/editor/cursor_test.rb +2 -0
  453. data/test/lib/vedeu/editor/delete_test.rb +2 -0
  454. data/test/lib/vedeu/editor/document_test.rb +2 -0
  455. data/test/lib/vedeu/editor/editor_test.rb +2 -0
  456. data/test/lib/vedeu/editor/insert_test.rb +2 -0
  457. data/test/lib/vedeu/editor/item_test.rb +2 -0
  458. data/test/lib/vedeu/editor/line_test.rb +2 -0
  459. data/test/lib/vedeu/editor/lines_test.rb +2 -0
  460. data/test/lib/vedeu/editor/repository_test.rb +2 -0
  461. data/test/lib/vedeu/error_test.rb +2 -0
  462. data/test/lib/vedeu/esc/actions_test.rb +2 -0
  463. data/test/lib/vedeu/esc/background_test.rb +2 -0
  464. data/test/lib/vedeu/esc/borders_test.rb +2 -0
  465. data/test/lib/vedeu/esc/colours_test.rb +2 -0
  466. data/test/lib/vedeu/esc/esc_test.rb +2 -0
  467. data/test/lib/vedeu/esc/foreground_test.rb +2 -0
  468. data/test/lib/vedeu/esc/mouse_test.rb +2 -0
  469. data/test/lib/vedeu/events/aliases_test.rb +2 -0
  470. data/test/lib/vedeu/events/collection_test.rb +2 -0
  471. data/test/lib/vedeu/events/event_test.rb +2 -0
  472. data/test/lib/vedeu/events/repository_test.rb +2 -0
  473. data/test/lib/vedeu/events/trigger_test.rb +2 -0
  474. data/test/lib/vedeu/geometries/area/area_test.rb +54 -26
  475. data/test/lib/vedeu/geometries/area/dimension_test.rb +2 -0
  476. data/test/lib/vedeu/geometries/area/x_dimension_test.rb +2 -0
  477. data/test/lib/vedeu/geometries/area/y_dimension_test.rb +2 -0
  478. data/test/lib/vedeu/geometries/dsl/dsl_test.rb +2 -0
  479. data/test/lib/vedeu/geometries/dsl/grid_test.rb +2 -0
  480. data/test/lib/vedeu/geometries/dsl/validator_test.rb +2 -0
  481. data/test/lib/vedeu/geometries/geometry_test.rb +2 -0
  482. data/test/lib/vedeu/geometries/move_test.rb +2 -0
  483. data/test/lib/vedeu/geometries/position_test.rb +2 -0
  484. data/test/lib/vedeu/geometries/positionable_test.rb +2 -0
  485. data/test/lib/vedeu/geometries/repository_test.rb +2 -0
  486. data/test/lib/vedeu/groups/clear_test.rb +2 -0
  487. data/test/lib/vedeu/groups/dsl_test.rb +2 -0
  488. data/test/lib/vedeu/groups/group_test.rb +2 -0
  489. data/test/lib/vedeu/groups/refresh_test.rb +2 -0
  490. data/test/lib/vedeu/groups/repository_test.rb +2 -0
  491. data/test/lib/vedeu/input/capture_test.rb +2 -0
  492. data/test/lib/vedeu/input/dsl_test.rb +2 -0
  493. data/test/lib/vedeu/input/key_test.rb +2 -0
  494. data/test/lib/vedeu/input/keymap_test.rb +2 -0
  495. data/test/lib/vedeu/input/keys_test.rb +2 -0
  496. data/test/lib/vedeu/input/mapper_test.rb +2 -0
  497. data/test/lib/vedeu/input/mouse_test.rb +2 -0
  498. data/test/lib/vedeu/input/raw_test.rb +2 -0
  499. data/test/lib/vedeu/input/read_test.rb +2 -0
  500. data/test/lib/vedeu/input/repository_test.rb +2 -0
  501. data/test/lib/vedeu/input/store_test.rb +2 -0
  502. data/test/lib/vedeu/input/translator_test.rb +2 -0
  503. data/test/lib/vedeu/interfaces/clear_test.rb +2 -0
  504. data/test/lib/vedeu/interfaces/dsl_test.rb +2 -0
  505. data/test/lib/vedeu/interfaces/interface_test.rb +2 -0
  506. data/test/lib/vedeu/interfaces/null_test.rb +2 -0
  507. data/test/lib/vedeu/interfaces/repository_test.rb +2 -0
  508. data/test/lib/vedeu/logging/clock_time_test.rb +2 -0
  509. data/test/lib/vedeu/logging/debug_test.rb +37 -9
  510. data/test/lib/vedeu/logging/lockless_log_device_test.rb +2 -0
  511. data/test/lib/vedeu/logging/log_test.rb +2 -0
  512. data/test/lib/vedeu/logging/mono_logger_test.rb +2 -0
  513. data/test/lib/vedeu/logging/timer_test.rb +2 -0
  514. data/test/lib/vedeu/menus/dsl_test.rb +2 -0
  515. data/test/lib/vedeu/menus/menu_test.rb +2 -0
  516. data/test/lib/vedeu/menus/repository_test.rb +2 -0
  517. data/test/lib/vedeu/models/focus_test.rb +2 -0
  518. data/test/lib/vedeu/models/page_test.rb +2 -0
  519. data/test/lib/vedeu/models/row_test.rb +2 -0
  520. data/test/lib/vedeu/models/toggleable_test.rb +2 -0
  521. data/test/lib/vedeu/null/generic_test.rb +2 -0
  522. data/test/lib/vedeu/output/compressor_cache_test.rb +2 -0
  523. data/test/lib/vedeu/output/compressor_test.rb +2 -0
  524. data/test/lib/vedeu/output/output_test.rb +2 -0
  525. data/test/lib/vedeu/output/refresh_test.rb +2 -0
  526. data/test/lib/vedeu/output/viewport_test.rb +2 -0
  527. data/test/lib/vedeu/output/write_test.rb +2 -0
  528. data/test/lib/vedeu/plugins/plugin_test.rb +2 -0
  529. data/test/lib/vedeu/plugins/plugins_test.rb +2 -0
  530. data/test/lib/vedeu/presentation/background_test.rb +2 -0
  531. data/test/lib/vedeu/presentation/colour_test.rb +2 -0
  532. data/test/lib/vedeu/presentation/foreground_test.rb +2 -0
  533. data/test/lib/vedeu/presentation/presentation_test.rb +2 -0
  534. data/test/lib/vedeu/presentation/style_test.rb +2 -0
  535. data/test/lib/vedeu/presentation/styles_test.rb +2 -0
  536. data/test/lib/vedeu/renderers/all_test.rb +4 -95
  537. data/test/lib/vedeu/renderers/file_test.rb +2 -0
  538. data/test/lib/vedeu/renderers/html_test.rb +28 -1
  539. data/test/lib/vedeu/renderers/json_test.rb +2 -0
  540. data/test/lib/vedeu/renderers/options_test.rb +2 -0
  541. data/test/lib/vedeu/renderers/terminal_test.rb +2 -0
  542. data/test/lib/vedeu/renderers/text_test.rb +2 -0
  543. data/test/lib/vedeu/repositories/assemblage_test.rb +2 -0
  544. data/test/lib/vedeu/repositories/collection_test.rb +2 -0
  545. data/test/lib/vedeu/repositories/defaults_test.rb +2 -0
  546. data/test/lib/vedeu/repositories/model_test.rb +2 -0
  547. data/test/lib/vedeu/repositories/registerable_test.rb +2 -0
  548. data/test/lib/vedeu/repositories/repositories_test.rb +2 -0
  549. data/test/lib/vedeu/repositories/repository_test.rb +2 -0
  550. data/test/lib/vedeu/repositories/store_test.rb +2 -0
  551. data/test/lib/vedeu/runtime/application_test.rb +2 -0
  552. data/test/lib/vedeu/runtime/bootstrap_test.rb +2 -0
  553. data/test/lib/vedeu/runtime/flags_test.rb +2 -0
  554. data/test/lib/vedeu/runtime/launcher_test.rb +2 -0
  555. data/test/lib/vedeu/runtime/main_loop_test.rb +2 -0
  556. data/test/lib/vedeu/runtime/router_test.rb +2 -0
  557. data/test/lib/vedeu/runtime/traps_test.rb +2 -0
  558. data/test/lib/vedeu/templating/decoder_test.rb +2 -0
  559. data/test/lib/vedeu/templating/encoder_test.rb +2 -0
  560. data/test/lib/vedeu/templating/helpers_test.rb +2 -0
  561. data/test/lib/vedeu/templating/template_test.rb +2 -0
  562. data/test/lib/vedeu/templating/view_template_test.rb +2 -0
  563. data/test/lib/vedeu/terminal/mode_test.rb +2 -0
  564. data/test/lib/vedeu/terminal/terminal_test.rb +2 -0
  565. data/test/lib/vedeu/views/char_test.rb +2 -0
  566. data/test/lib/vedeu/views/chars_test.rb +2 -0
  567. data/test/lib/vedeu/views/composition_test.rb +2 -0
  568. data/test/lib/vedeu/views/default_attributes_test.rb +2 -0
  569. data/test/lib/vedeu/views/html_char_test.rb +2 -0
  570. data/test/lib/vedeu/views/line_test.rb +2 -0
  571. data/test/lib/vedeu/views/lines_test.rb +2 -0
  572. data/test/lib/vedeu/views/stream_test.rb +2 -0
  573. data/test/lib/vedeu/views/streams_test.rb +2 -0
  574. data/test/lib/vedeu/views/value_test.rb +2 -0
  575. data/test/lib/vedeu/views/view_test.rb +2 -0
  576. data/test/lib/vedeu/views/views_test.rb +2 -0
  577. data/test/lib/vedeu_test.rb +21 -3
  578. data/test/support/examples/material_colours_app.rb +17 -1
  579. data/test/support/helpers/model_test_class.rb +2 -0
  580. data/test/support/helpers/presentation_colour_test_class.rb +2 -0
  581. data/test/test_helper.rb +3 -22
  582. data/vedeu.gemspec +0 -3
  583. metadata +105 -52
  584. data/docs/debugging.md +0 -18
  585. data/lib/vedeu/borders/set_attribute.rb +0 -73
  586. data/lib/vedeu/logging/ips.rb +0 -66
  587. data/test/lib/vedeu/borders/set_attribute_test.rb +0 -62
  588. data/test/lib/vedeu/logging/ips_test.rb +0 -52
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module EscapeSequences
@@ -32,22 +34,22 @@ module Vedeu
32
34
 
33
35
  # @return [String]
34
36
  def mouse_x10_on
35
- "\e[?9h".freeze
37
+ "\e[?9h"
36
38
  end
37
39
 
38
40
  # @return [String]
39
41
  def mouse_x10_off
40
- "\e[?9l".freeze
42
+ "\e[?9l"
41
43
  end
42
44
 
43
45
  # @return [String]
44
46
  def mouse_on
45
- "\e[?1000h".freeze
47
+ "\e[?1000h"
46
48
  end
47
49
 
48
50
  # @return [String]
49
51
  def mouse_off
50
- "\e[?1000l".freeze
52
+ "\e[?1000l"
51
53
  end
52
54
 
53
55
  end # Mouse
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Events
@@ -90,7 +92,7 @@ module Vedeu
90
92
  find(alias_name).map do |event_name|
91
93
  Vedeu.log(type: :event,
92
94
  message: "Triggering: '#{event_name}' from alias " \
93
- "'#{alias_name}'".freeze)
95
+ "'#{alias_name}'")
94
96
  Vedeu::Events::Trigger.trigger(event_name, *args)
95
97
  end
96
98
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  # Provides event driven control to Vedeu.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Events
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Events
@@ -84,7 +86,7 @@ module Vedeu
84
86
  #
85
87
  # @return [Boolean]
86
88
  def bind(name, options = {}, &block)
87
- Vedeu.log(type: :event, message: "Binding: '#{name.inspect}'".freeze)
89
+ Vedeu.log(type: :event, message: "Binding: '#{name.inspect}'")
88
90
 
89
91
  new(name, block, options).bind
90
92
  end
@@ -117,7 +119,7 @@ module Vedeu
117
119
  return false unless Vedeu.bound?(name)
118
120
 
119
121
  Vedeu.log(type: :event,
120
- message: "Unbinding: '#{name.inspect}'".freeze)
122
+ message: "Unbinding: '#{name.inspect}'")
121
123
 
122
124
  Vedeu.events.remove(name)
123
125
 
@@ -194,15 +196,18 @@ module Vedeu
194
196
  @executed_at = @now # set execution time to now
195
197
  @now = 0 # reset now
196
198
 
197
- message = "Triggering: '#{name.inspect}'"
198
-
199
199
  if args.size > 1
200
- message << " with #{args.inspect}"
200
+ message = "Triggering: '#{name.inspect}' with #{args.inspect}"
201
+
201
202
  elsif args.one?
202
- message << " for #{args.first.inspect}"
203
+ message = "Triggering: '#{name.inspect}' for #{args.first.inspect}"
204
+
205
+ else
206
+ message = "Triggering: '#{name.inspect}'"
207
+
203
208
  end
204
209
 
205
- Vedeu.log(type: :event, message: message.freeze)
210
+ Vedeu.log(type: :event, message: message)
206
211
 
207
212
  closure.call(*args)
208
213
  end
@@ -224,7 +229,7 @@ module Vedeu
224
229
  def throttle_expired?
225
230
  return true if (@now - @executed_at) > delay
226
231
 
227
- Vedeu.log(type: :event, message: "Throttling: '#{name.inspect}'".freeze)
232
+ Vedeu.log(type: :event, message: "Throttling: '#{name.inspect}'")
228
233
 
229
234
  false
230
235
  end
@@ -251,7 +256,7 @@ module Vedeu
251
256
  def debounce_expired?
252
257
  return true if (@executed_at = @now) > @deadline
253
258
 
254
- Vedeu.log(type: :event, message: "Debouncing: '#{name.inspect}'".freeze)
259
+ Vedeu.log(type: :event, message: "Debouncing: '#{name.inspect}'")
255
260
 
256
261
  false
257
262
  end
@@ -311,4 +316,11 @@ module Vedeu
311
316
  :bound?,
312
317
  :unbind
313
318
 
319
+ # :nocov:
320
+
321
+ # See {file:docs/events/system.md#\_log_}
322
+ Vedeu.bind(:_log_) { |msg| Vedeu.log(type: :debug, message: msg) }
323
+
324
+ # :nocov:
325
+
314
326
  end # Vedeu
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Events
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Events
@@ -40,7 +42,7 @@ module Vedeu
40
42
  def trigger
41
43
  if results.empty?
42
44
  Vedeu.log(type: :event,
43
- message: "No action for: '#{name.inspect}'".freeze)
45
+ message: "No action for: '#{name.inspect}'")
44
46
  end
45
47
 
46
48
  return results[0] if results.one?
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  # The Geometry group of classes all handle the size of interfaces in
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -46,38 +48,36 @@ module Vedeu
46
48
  # @option attributes maximised [Boolean]
47
49
  # @option attributes name [String|Symbol]
48
50
  # @option attributes vertical_alignment [Symbol]
49
- # @option attributes x [Fixnum]
50
- # @option attributes xn [Fixnum]
51
- # @option attributes x_xn [Fixnum]
52
- # @option attributes x_default [Fixnum]
53
- # @option attributes y [Fixnum]
54
- # @option attributes yn [Fixnum]
55
- # @option attributes y_yn [Fixnum]
56
- # @option attributes y_default [Fixnum]
51
+ # @option attributes x [Fixnum] The starting x coordinate.
52
+ # @option attributes xn [Fixnum] The ending x coordinate.
53
+ # @option attributes width [Fixnum]
54
+ # @option attributes y [Fixnum] The starting y coordinate.
55
+ # @option attributes yn [Fixnum] The ending y coordinate.
56
+ # @option attributes height [Fixnum]
57
57
  # @return [Vedeu::Geometries::Area]
58
58
  def self.from_attributes(attributes = {})
59
59
  y_attributes = {
60
60
  alignment: attributes[:vertical_alignment],
61
61
  d: attributes[:y],
62
62
  dn: attributes[:yn],
63
- d_dn: attributes[:y_yn],
63
+ d_dn: attributes[:height],
64
64
  maximised: attributes[:maximised],
65
65
  }
66
66
  x_attributes = {
67
67
  alignment: attributes[:horizontal_alignment],
68
68
  d: attributes[:x],
69
69
  dn: attributes[:xn],
70
- d_dn: attributes[:x_xn],
70
+ d_dn: attributes[:width],
71
71
  maximised: attributes[:maximised],
72
72
  }
73
- y_yn = Vedeu::Geometries::YDimension.pair(y_attributes)
74
- x_xn = Vedeu::Geometries::XDimension.pair(x_attributes)
73
+ height = Vedeu::Geometries::YDimension.pair(y_attributes)
74
+ width = Vedeu::Geometries::XDimension.pair(x_attributes)
75
75
 
76
76
  new(name: attributes[:name],
77
- y: y_yn[0],
78
- yn: y_yn[-1],
79
- x: x_xn[0],
80
- xn: x_xn[-1])
77
+ y: height[0],
78
+ yn: height[-1],
79
+ x: width[0],
80
+ xn: width[-1])
81
81
  end
82
82
 
83
83
  # Returns a new instance of Vedeu::Area.
@@ -111,7 +111,18 @@ module Vedeu
111
111
  #
112
112
  # @return [Fixnum]
113
113
  def bordered_width
114
- (bxn - bx) + 1
114
+ return width unless border && enabled?
115
+
116
+ if left? && right?
117
+ width - 2
118
+
119
+ elsif left? || right?
120
+ width - 1
121
+
122
+ else
123
+ width
124
+
125
+ end
115
126
  end
116
127
 
117
128
  # Returns the height of the interface determined by whether a
@@ -119,7 +130,18 @@ module Vedeu
119
130
  #
120
131
  # @return [Fixnum]
121
132
  def bordered_height
122
- (byn - by) + 1
133
+ return height unless border && enabled?
134
+
135
+ if top? && bottom?
136
+ height - 2
137
+
138
+ elsif top? || bottom?
139
+ height - 1
140
+
141
+ else
142
+ height
143
+
144
+ end
123
145
  end
124
146
 
125
147
  # Return the column position for 1 character right of the left
@@ -183,6 +205,9 @@ module Vedeu
183
205
  # @return [Fixnum]
184
206
  def height
185
207
  (yn - y) + 1
208
+
209
+ # (yn - y) + 2
210
+ # (y..yn).size# + 1
186
211
  end
187
212
 
188
213
  # Returns the width of the interface.
@@ -190,6 +215,9 @@ module Vedeu
190
215
  # @return [Fixnum]
191
216
  def width
192
217
  (xn - x) + 1
218
+
219
+ # (xn - x) + 2
220
+ # (x..xn).size# + 1
193
221
  end
194
222
 
195
223
  # Returns the row above the top by default.
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -225,18 +227,23 @@ module Vedeu
225
227
  # @return [Fixnum]
226
228
  def _dn
227
229
  if dn
230
+ # fail "_dn 1 v:#{d} #{dn}"
228
231
  dn
229
232
 
230
233
  elsif d.nil? && d_dn
234
+ # fail "_dn 2 v:#{d_dn}"
231
235
  d_dn
232
236
 
233
237
  elsif d && d_dn
238
+ # fail "_dn 3 v:#{d} #{d_dn}"
234
239
  (d + d_dn) - 1
235
240
 
236
241
  elsif default
242
+ # fail "_dn 4 v:#{default}"
237
243
  default
238
244
 
239
245
  else
246
+ # fail "_dn 5 v:1"
240
247
  1
241
248
 
242
249
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -15,7 +17,7 @@ module Vedeu
15
17
  # @return [Boolean]
16
18
  def validate_height!(value)
17
19
  fail Vedeu::Error::InvalidSyntax,
18
- 'No height given.'.freeze if absent?(value)
20
+ 'No height given.' if absent?(value)
19
21
 
20
22
  true
21
23
  end
@@ -27,7 +29,7 @@ module Vedeu
27
29
  def validate_horizontal_alignment!(value)
28
30
  fail Vedeu::Error::InvalidSyntax,
29
31
  'No horizontal alignment given. Valid values are :center, ' \
30
- ':centre, :left, :none, :right.'.freeze unless present?(value)
32
+ ':centre, :left, :none, :right.' unless present?(value)
31
33
 
32
34
  true
33
35
  end
@@ -38,7 +40,7 @@ module Vedeu
38
40
  def validate_vertical_alignment!(value)
39
41
  fail Vedeu::Error::InvalidSyntax,
40
42
  'No vertical alignment given. Valid values are :bottom, ' \
41
- ':middle, :none, :top.'.freeze unless present?(value)
43
+ ':middle, :none, :top.' unless present?(value)
42
44
 
43
45
  true
44
46
  end
@@ -48,7 +50,7 @@ module Vedeu
48
50
  # @return [Boolean]
49
51
  def validate_width!(value)
50
52
  fail Vedeu::Error::InvalidSyntax,
51
- 'No width given.'.freeze if absent?(value)
53
+ 'No width given.' if absent?(value)
52
54
 
53
55
  true
54
56
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -201,10 +203,10 @@ module Vedeu
201
203
  vertical_alignment: vertical_alignment,
202
204
  x: @x.is_a?(Proc) ? @x.call : @x,
203
205
  xn: @xn.is_a?(Proc) ? @xn.call : @xn,
204
- x_xn: @width.is_a?(Proc) ? @width.call : @width,
206
+ width: @width.is_a?(Proc) ? @width.call : @width,
205
207
  y: @y.is_a?(Proc) ? @y.call : @y,
206
208
  yn: @yn.is_a?(Proc) ? @yn.call : @yn,
207
- y_yn: @height.is_a?(Proc) ? @height.call : @height,
209
+ height: @height.is_a?(Proc) ? @height.call : @height,
208
210
  }
209
211
  end
210
212
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -64,7 +66,7 @@ module Vedeu
64
66
  def defaults
65
67
  {
66
68
  direction: :none,
67
- name: ''.freeze,
69
+ name: '',
68
70
  offset: 1,
69
71
  }
70
72
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Vedeu
2
4
 
3
5
  module Geometries
@@ -116,7 +118,7 @@ module Vedeu
116
118
  # @yieldreturn [String] Returns the block wrapped in position
117
119
  # escape sequences.
118
120
  def to_s(&block)
119
- return "#{sequence}#{yield}".freeze if block_given?
121
+ return "#{sequence}#{yield}" if block_given?
120
122
 
121
123
  sequence
122
124
  end
@@ -157,7 +159,7 @@ module Vedeu
157
159
  #
158
160
  # @return [String]
159
161
  def sequence
160
- "\e[#{y};#{x}H".freeze
162
+ "\e[#{y};#{x}H"
161
163
  end
162
164
 
163
165
  end # Position