whirled_peas 0.5.0 → 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (291) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +1 -0
  4. data/CHANGELOG.md +31 -0
  5. data/README.md +748 -137
  6. data/Rakefile +4 -32
  7. data/bin/easing +33 -0
  8. data/bin/reset_cursor +11 -0
  9. data/bin/screen_test +68 -0
  10. data/examples/graph.rb +54 -0
  11. data/examples/intro.rb +52 -0
  12. data/examples/scrolling.rb +54 -0
  13. data/lib/whirled_peas.rb +4 -12
  14. data/lib/whirled_peas/animator.rb +5 -0
  15. data/lib/whirled_peas/animator/debug_consumer.rb +17 -0
  16. data/lib/whirled_peas/animator/easing.rb +72 -0
  17. data/lib/whirled_peas/animator/frame.rb +5 -0
  18. data/lib/whirled_peas/animator/frameset.rb +33 -0
  19. data/lib/whirled_peas/animator/producer.rb +35 -0
  20. data/lib/whirled_peas/animator/renderer_consumer.rb +31 -0
  21. data/lib/whirled_peas/command.rb +5 -0
  22. data/lib/whirled_peas/command/base.rb +86 -0
  23. data/lib/whirled_peas/command/config_command.rb +44 -0
  24. data/lib/whirled_peas/command/debug.rb +21 -0
  25. data/lib/whirled_peas/command/fonts.rb +22 -0
  26. data/lib/whirled_peas/command/frame_command.rb +34 -0
  27. data/lib/whirled_peas/command/frames.rb +24 -0
  28. data/lib/whirled_peas/command/help.rb +38 -0
  29. data/lib/whirled_peas/command/play.rb +108 -0
  30. data/lib/whirled_peas/command/record.rb +57 -0
  31. data/lib/whirled_peas/command/still.rb +29 -0
  32. data/lib/whirled_peas/command_line.rb +22 -220
  33. data/lib/whirled_peas/config.rb +56 -6
  34. data/lib/whirled_peas/device.rb +5 -0
  35. data/lib/whirled_peas/device/null_device.rb +8 -0
  36. data/lib/whirled_peas/device/output_file.rb +19 -0
  37. data/lib/whirled_peas/device/screen.rb +26 -0
  38. data/lib/whirled_peas/graphics.rb +14 -0
  39. data/lib/whirled_peas/graphics/box_painter.rb +48 -47
  40. data/lib/whirled_peas/graphics/canvas.rb +22 -11
  41. data/lib/whirled_peas/graphics/composer.rb +98 -0
  42. data/lib/whirled_peas/graphics/container_coords.rb +24 -13
  43. data/lib/whirled_peas/graphics/container_dimensions.rb +37 -9
  44. data/lib/whirled_peas/graphics/container_painter.rb +283 -36
  45. data/lib/whirled_peas/graphics/content_dimensions.rb +19 -0
  46. data/lib/whirled_peas/graphics/content_painter.rb +20 -0
  47. data/lib/whirled_peas/graphics/debugger.rb +10 -1
  48. data/lib/whirled_peas/graphics/graph_dimensions.rb +12 -0
  49. data/lib/whirled_peas/graphics/graph_painter.rb +95 -0
  50. data/lib/whirled_peas/graphics/grid_painter.rb +25 -15
  51. data/lib/whirled_peas/graphics/mock_screen.rb +1 -1
  52. data/lib/whirled_peas/graphics/painter.rb +15 -6
  53. data/lib/whirled_peas/graphics/renderer.rb +13 -30
  54. data/lib/whirled_peas/graphics/text_painter.rb +11 -13
  55. data/lib/whirled_peas/settings/alignment.rb +24 -0
  56. data/lib/whirled_peas/settings/bg_color.rb +2 -0
  57. data/lib/whirled_peas/settings/border.rb +16 -16
  58. data/lib/whirled_peas/settings/color.rb +13 -14
  59. data/lib/whirled_peas/settings/container_settings.rb +133 -40
  60. data/lib/whirled_peas/settings/debugger.rb +9 -0
  61. data/lib/whirled_peas/settings/display_flow.rb +13 -11
  62. data/lib/whirled_peas/settings/element_settings.rb +8 -3
  63. data/lib/whirled_peas/settings/graph_settings.rb +21 -0
  64. data/lib/whirled_peas/settings/grid_settings.rb +15 -0
  65. data/lib/whirled_peas/settings/scrollbar.rb +15 -0
  66. data/lib/whirled_peas/settings/sizing.rb +19 -0
  67. data/lib/whirled_peas/settings/spacing.rb +34 -0
  68. data/lib/whirled_peas/settings/text_color.rb +2 -0
  69. data/lib/whirled_peas/settings/vert_alignment.rb +24 -0
  70. data/lib/whirled_peas/utils/ansi.rb +13 -0
  71. data/lib/whirled_peas/utils/file_handler.rb +57 -0
  72. data/lib/whirled_peas/utils/title_font.rb +1 -1
  73. data/lib/whirled_peas/version.rb +1 -1
  74. data/screen_test/{rendered/elements → elements}/box.frame +1 -1
  75. data/screen_test/{rendered/elements → elements}/box.rb +0 -0
  76. data/screen_test/elements/graph.frame +1 -0
  77. data/screen_test/elements/graph.rb +12 -0
  78. data/screen_test/elements/grid.frame +1 -0
  79. data/screen_test/{rendered/elements → elements}/grid.rb +0 -0
  80. data/screen_test/elements/screen_overflow_x.frame +1 -0
  81. data/screen_test/{rendered/elements/screen_overflow.rb → elements/screen_overflow_x.rb} +0 -0
  82. data/screen_test/elements/screen_overflow_y.frame +1 -0
  83. data/screen_test/elements/screen_overflow_y.rb +9 -0
  84. data/screen_test/elements/text.frame +1 -0
  85. data/screen_test/{rendered/elements → elements}/text.rb +0 -0
  86. data/screen_test/elements/text_multiline.frame +1 -0
  87. data/screen_test/{rendered/elements → elements}/text_multiline.rb +0 -0
  88. data/screen_test/settings/align/box_around.frame +1 -0
  89. data/screen_test/settings/align/box_around.rb +16 -0
  90. data/screen_test/settings/align/box_between.frame +1 -0
  91. data/screen_test/settings/align/box_between.rb +16 -0
  92. data/screen_test/settings/align/box_center.frame +1 -0
  93. data/screen_test/{rendered/settings/align/box.rb → settings/align/box_center.rb} +5 -4
  94. data/screen_test/settings/align/box_default.frame +1 -0
  95. data/screen_test/{rendered/settings/align/grid.rb → settings/align/box_default.rb} +6 -6
  96. data/screen_test/settings/align/box_evenly.frame +1 -0
  97. data/screen_test/settings/align/box_evenly.rb +16 -0
  98. data/screen_test/settings/align/box_left.frame +1 -0
  99. data/screen_test/settings/align/box_left.rb +21 -0
  100. data/screen_test/settings/align/box_right.frame +1 -0
  101. data/screen_test/settings/align/box_right.rb +21 -0
  102. data/screen_test/settings/align/children_center.frame +1 -0
  103. data/screen_test/settings/align/children_center.rb +15 -0
  104. data/screen_test/settings/align/children_left.frame +1 -0
  105. data/screen_test/settings/align/children_left.rb +15 -0
  106. data/screen_test/settings/align/children_right.frame +1 -0
  107. data/screen_test/settings/align/children_right.rb +15 -0
  108. data/screen_test/settings/align/grid_center.frame +1 -0
  109. data/screen_test/settings/align/grid_center.rb +18 -0
  110. data/screen_test/settings/align/grid_default.frame +1 -0
  111. data/screen_test/settings/align/grid_default.rb +17 -0
  112. data/screen_test/settings/align/grid_left.frame +1 -0
  113. data/screen_test/settings/align/grid_left.rb +18 -0
  114. data/screen_test/settings/align/grid_right.frame +1 -0
  115. data/screen_test/settings/align/grid_right.rb +18 -0
  116. data/screen_test/settings/ansi/bold.frame +1 -0
  117. data/screen_test/{rendered/settings/width/overflow_box_t2b.rb → settings/ansi/bold.rb} +4 -5
  118. data/screen_test/{rendered/settings → settings}/ansi/color.frame +1 -1
  119. data/screen_test/{rendered/settings → settings}/ansi/color.rb +0 -0
  120. data/screen_test/settings/ansi/underline.frame +1 -0
  121. data/screen_test/{rendered/settings → settings}/ansi/underline.rb +4 -5
  122. data/screen_test/{rendered/settings → settings}/border.frame +1 -1
  123. data/screen_test/{rendered/settings → settings}/border.rb +1 -1
  124. data/screen_test/settings/flow/box_b2t.frame +1 -0
  125. data/screen_test/settings/flow/box_b2t.rb +26 -0
  126. data/screen_test/settings/flow/box_l2r.frame +1 -0
  127. data/screen_test/settings/flow/box_l2r.rb +26 -0
  128. data/screen_test/settings/flow/box_r2l.frame +1 -0
  129. data/screen_test/settings/flow/box_r2l.rb +26 -0
  130. data/screen_test/settings/flow/box_t2b.frame +1 -0
  131. data/screen_test/settings/flow/box_t2b.rb +26 -0
  132. data/screen_test/settings/flow/grid_b2t.frame +1 -0
  133. data/screen_test/settings/flow/grid_b2t.rb +14 -0
  134. data/screen_test/settings/flow/grid_l2r.frame +1 -0
  135. data/screen_test/{rendered/settings/margin.rb → settings/flow/grid_l2r.rb} +4 -4
  136. data/screen_test/settings/flow/grid_r2l.frame +1 -0
  137. data/screen_test/settings/flow/grid_r2l.rb +14 -0
  138. data/screen_test/settings/flow/grid_t2b.frame +1 -0
  139. data/screen_test/settings/flow/grid_t2b.rb +14 -0
  140. data/screen_test/settings/height/box.frame +1 -0
  141. data/screen_test/{rendered/settings → settings}/height/box.rb +0 -0
  142. data/screen_test/settings/height/box_border_sizing.frame +1 -0
  143. data/screen_test/settings/height/box_border_sizing.rb +15 -0
  144. data/screen_test/settings/height/grid.frame +1 -0
  145. data/screen_test/{rendered/settings → settings}/height/grid.rb +0 -0
  146. data/screen_test/settings/height/overflow_box.frame +1 -0
  147. data/screen_test/settings/height/overflow_box.rb +13 -0
  148. data/screen_test/settings/height/overflow_box_l2r.frame +1 -0
  149. data/screen_test/settings/height/overflow_box_l2r.rb +17 -0
  150. data/screen_test/settings/height/overflow_box_t2b.frame +1 -0
  151. data/screen_test/settings/height/overflow_box_t2b.rb +16 -0
  152. data/screen_test/settings/height/overflow_grid.frame +1 -0
  153. data/screen_test/{rendered/settings → settings}/height/overflow_grid.rb +0 -0
  154. data/screen_test/settings/margin.frame +1 -0
  155. data/screen_test/settings/margin.rb +16 -0
  156. data/screen_test/settings/padding.frame +1 -0
  157. data/screen_test/settings/padding.rb +13 -0
  158. data/screen_test/settings/position/box_left.frame +1 -0
  159. data/screen_test/{rendered/settings → settings}/position/box_left.rb +2 -2
  160. data/screen_test/settings/position/box_left_negative.frame +1 -0
  161. data/screen_test/{rendered/settings → settings}/position/box_left_negative.rb +2 -2
  162. data/screen_test/settings/position/box_top.frame +1 -0
  163. data/screen_test/{rendered/settings → settings}/position/box_top.rb +1 -1
  164. data/screen_test/settings/position/box_top_negative.frame +1 -0
  165. data/screen_test/{rendered/settings → settings}/position/box_top_negative.rb +2 -2
  166. data/screen_test/settings/position/grid_left.frame +1 -0
  167. data/screen_test/{rendered/settings → settings}/position/grid_left.rb +1 -1
  168. data/screen_test/settings/position/grid_left_negative.frame +1 -0
  169. data/screen_test/{rendered/settings → settings}/position/grid_left_negative.rb +1 -1
  170. data/screen_test/settings/position/grid_top.frame +1 -0
  171. data/screen_test/{rendered/settings → settings}/position/grid_top.rb +1 -1
  172. data/screen_test/settings/position/grid_top_negative.frame +1 -0
  173. data/screen_test/{rendered/settings → settings}/position/grid_top_negative.rb +1 -1
  174. data/screen_test/settings/scroll/horiz_box.frame +1 -0
  175. data/screen_test/settings/scroll/horiz_box.rb +17 -0
  176. data/screen_test/settings/scroll/horiz_box_align_center.rb +18 -0
  177. data/screen_test/settings/scroll/horiz_box_align_right.rb +18 -0
  178. data/screen_test/settings/scroll/vert_box.frame +1 -0
  179. data/screen_test/settings/scroll/vert_box.rb +20 -0
  180. data/screen_test/settings/title_font.frame +1 -0
  181. data/screen_test/{rendered/settings → settings}/title_font.rb +1 -1
  182. data/screen_test/settings/valign/box_around.frame +1 -0
  183. data/screen_test/settings/valign/box_around.rb +17 -0
  184. data/screen_test/settings/valign/box_between.frame +1 -0
  185. data/screen_test/settings/valign/box_between.rb +17 -0
  186. data/screen_test/settings/valign/box_bottom.frame +1 -0
  187. data/screen_test/settings/valign/box_bottom.rb +17 -0
  188. data/screen_test/settings/valign/box_default.frame +1 -0
  189. data/screen_test/settings/valign/box_default.rb +16 -0
  190. data/screen_test/settings/valign/box_evenly.frame +1 -0
  191. data/screen_test/settings/valign/box_evenly.rb +17 -0
  192. data/screen_test/settings/valign/box_middle.frame +1 -0
  193. data/screen_test/settings/valign/box_middle.rb +17 -0
  194. data/screen_test/settings/valign/box_top.frame +1 -0
  195. data/screen_test/settings/valign/box_top.rb +17 -0
  196. data/screen_test/settings/valign/grid_bottom.frame +1 -0
  197. data/screen_test/settings/valign/grid_bottom.rb +15 -0
  198. data/screen_test/settings/valign/grid_default.frame +1 -0
  199. data/screen_test/settings/valign/grid_default.rb +14 -0
  200. data/screen_test/settings/valign/grid_middle.frame +1 -0
  201. data/screen_test/settings/valign/grid_middle.rb +15 -0
  202. data/screen_test/settings/valign/grid_top.frame +1 -0
  203. data/screen_test/settings/valign/grid_top.rb +15 -0
  204. data/screen_test/settings/width/box_border_sizing.frame +1 -0
  205. data/screen_test/settings/width/box_border_sizing.rb +15 -0
  206. data/screen_test/settings/width/box_content.frame +1 -0
  207. data/screen_test/settings/width/box_content.rb +15 -0
  208. data/screen_test/settings/width/box_default.frame +1 -0
  209. data/screen_test/{rendered/settings/width/box.rb → settings/width/box_default.rb} +3 -2
  210. data/screen_test/settings/width/grid.frame +1 -0
  211. data/screen_test/{rendered/settings → settings}/width/grid.rb +2 -2
  212. data/screen_test/settings/width/overflow_align_center.frame +1 -0
  213. data/screen_test/settings/width/overflow_align_center.rb +14 -0
  214. data/screen_test/settings/width/overflow_align_right.frame +1 -0
  215. data/screen_test/settings/width/overflow_align_right.rb +14 -0
  216. data/screen_test/settings/width/overflow_box.frame +1 -0
  217. data/screen_test/settings/width/overflow_box.rb +13 -0
  218. data/screen_test/settings/width/overflow_box_l2r.frame +1 -0
  219. data/screen_test/settings/width/overflow_box_l2r.rb +16 -0
  220. data/screen_test/settings/width/overflow_box_t2b.frame +1 -0
  221. data/screen_test/settings/width/overflow_box_t2b.rb +17 -0
  222. data/screen_test/settings/width/overflow_grid.frame +1 -0
  223. data/screen_test/{rendered/settings → settings}/width/overflow_grid.rb +0 -0
  224. data/tools/whirled_peas/tools/screen_tester.rb +285 -0
  225. metadata +192 -98
  226. data/bin/debug +0 -35
  227. data/lib/whirled_peas/debugger.rb +0 -80
  228. data/lib/whirled_peas/frame.rb +0 -6
  229. data/lib/whirled_peas/frame/consumer.rb +0 -30
  230. data/lib/whirled_peas/frame/debug_consumer.rb +0 -30
  231. data/lib/whirled_peas/frame/event_loop.rb +0 -90
  232. data/lib/whirled_peas/frame/producer.rb +0 -67
  233. data/lib/whirled_peas/graphics/screen.rb +0 -65
  234. data/lib/whirled_peas/graphics/text_dimensions.rb +0 -15
  235. data/lib/whirled_peas/settings/text_align.rb +0 -19
  236. data/lib/whirled_peas/template.rb +0 -5
  237. data/lib/whirled_peas/template/box_element.rb +0 -8
  238. data/lib/whirled_peas/template/composer.rb +0 -68
  239. data/lib/whirled_peas/template/container.rb +0 -28
  240. data/lib/whirled_peas/template/debugger.rb +0 -34
  241. data/lib/whirled_peas/template/element.rb +0 -13
  242. data/lib/whirled_peas/template/grid_element.rb +0 -8
  243. data/lib/whirled_peas/template/text_element.rb +0 -24
  244. data/screen_test/rendered/elements/grid.frame +0 -1
  245. data/screen_test/rendered/elements/text.frame +0 -1
  246. data/screen_test/rendered/elements/text_multiline.frame +0 -1
  247. data/screen_test/rendered/settings/align/box.frame +0 -1
  248. data/screen_test/rendered/settings/align/children_center.frame +0 -1
  249. data/screen_test/rendered/settings/align/children_center.rb +0 -13
  250. data/screen_test/rendered/settings/align/children_left.frame +0 -1
  251. data/screen_test/rendered/settings/align/children_left.rb +0 -13
  252. data/screen_test/rendered/settings/align/children_right.frame +0 -1
  253. data/screen_test/rendered/settings/align/children_right.rb +0 -13
  254. data/screen_test/rendered/settings/align/grid.frame +0 -1
  255. data/screen_test/rendered/settings/ansi/bold.frame +0 -1
  256. data/screen_test/rendered/settings/ansi/bold.rb +0 -15
  257. data/screen_test/rendered/settings/ansi/underline.frame +0 -1
  258. data/screen_test/rendered/settings/flow/l2r.frame +0 -1
  259. data/screen_test/rendered/settings/flow/l2r.rb +0 -24
  260. data/screen_test/rendered/settings/flow/t2b.frame +0 -1
  261. data/screen_test/rendered/settings/flow/t2b.rb +0 -24
  262. data/screen_test/rendered/settings/height/box.frame +0 -1
  263. data/screen_test/rendered/settings/height/grid.frame +0 -1
  264. data/screen_test/rendered/settings/height/overflow_box.frame +0 -1
  265. data/screen_test/rendered/settings/height/overflow_box.rb +0 -13
  266. data/screen_test/rendered/settings/height/overflow_box_l2r.frame +0 -1
  267. data/screen_test/rendered/settings/height/overflow_box_l2r.rb +0 -15
  268. data/screen_test/rendered/settings/height/overflow_box_t2b.frame +0 -1
  269. data/screen_test/rendered/settings/height/overflow_box_t2b.rb +0 -14
  270. data/screen_test/rendered/settings/height/overflow_grid.frame +0 -1
  271. data/screen_test/rendered/settings/margin.frame +0 -1
  272. data/screen_test/rendered/settings/padding.frame +0 -1
  273. data/screen_test/rendered/settings/padding.rb +0 -11
  274. data/screen_test/rendered/settings/position/box_left.frame +0 -1
  275. data/screen_test/rendered/settings/position/box_left_negative.frame +0 -1
  276. data/screen_test/rendered/settings/position/box_top.frame +0 -1
  277. data/screen_test/rendered/settings/position/box_top_negative.frame +0 -1
  278. data/screen_test/rendered/settings/position/grid_left.frame +0 -1
  279. data/screen_test/rendered/settings/position/grid_left_negative.frame +0 -1
  280. data/screen_test/rendered/settings/position/grid_top.frame +0 -1
  281. data/screen_test/rendered/settings/position/grid_top_negative.frame +0 -1
  282. data/screen_test/rendered/settings/title_font.frame +0 -1
  283. data/screen_test/rendered/settings/width/box.frame +0 -1
  284. data/screen_test/rendered/settings/width/grid.frame +0 -1
  285. data/screen_test/rendered/settings/width/overflow_box.frame +0 -1
  286. data/screen_test/rendered/settings/width/overflow_box.rb +0 -11
  287. data/screen_test/rendered/settings/width/overflow_box_l2r.frame +0 -1
  288. data/screen_test/rendered/settings/width/overflow_box_l2r.rb +0 -14
  289. data/screen_test/rendered/settings/width/overflow_box_t2b.frame +0 -1
  290. data/screen_test/rendered/settings/width/overflow_grid.frame +0 -1
  291. data/screen_test/screen_tester.rb +0 -191
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: whirled_peas
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tom Collier
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -70,35 +70,60 @@ files:
70
70
  - README.md
71
71
  - Rakefile
72
72
  - bin/console
73
- - bin/debug
73
+ - bin/easing
74
+ - bin/reset_cursor
75
+ - bin/screen_test
74
76
  - bin/setup
77
+ - examples/graph.rb
78
+ - examples/intro.rb
79
+ - examples/scrolling.rb
75
80
  - exe/whirled_peas
76
81
  - lib/whirled_peas.rb
82
+ - lib/whirled_peas/animator.rb
83
+ - lib/whirled_peas/animator/debug_consumer.rb
84
+ - lib/whirled_peas/animator/easing.rb
85
+ - lib/whirled_peas/animator/frame.rb
86
+ - lib/whirled_peas/animator/frameset.rb
87
+ - lib/whirled_peas/animator/producer.rb
88
+ - lib/whirled_peas/animator/renderer_consumer.rb
89
+ - lib/whirled_peas/command.rb
90
+ - lib/whirled_peas/command/base.rb
91
+ - lib/whirled_peas/command/config_command.rb
92
+ - lib/whirled_peas/command/debug.rb
93
+ - lib/whirled_peas/command/fonts.rb
94
+ - lib/whirled_peas/command/frame_command.rb
95
+ - lib/whirled_peas/command/frames.rb
96
+ - lib/whirled_peas/command/help.rb
97
+ - lib/whirled_peas/command/play.rb
98
+ - lib/whirled_peas/command/record.rb
99
+ - lib/whirled_peas/command/still.rb
77
100
  - lib/whirled_peas/command_line.rb
78
101
  - lib/whirled_peas/config.rb
79
- - lib/whirled_peas/debugger.rb
102
+ - lib/whirled_peas/device.rb
103
+ - lib/whirled_peas/device/null_device.rb
104
+ - lib/whirled_peas/device/output_file.rb
105
+ - lib/whirled_peas/device/screen.rb
80
106
  - lib/whirled_peas/errors.rb
81
- - lib/whirled_peas/frame.rb
82
- - lib/whirled_peas/frame/consumer.rb
83
- - lib/whirled_peas/frame/debug_consumer.rb
84
- - lib/whirled_peas/frame/event_loop.rb
85
- - lib/whirled_peas/frame/producer.rb
86
107
  - lib/whirled_peas/graphics.rb
87
108
  - lib/whirled_peas/graphics/box_painter.rb
88
109
  - lib/whirled_peas/graphics/canvas.rb
110
+ - lib/whirled_peas/graphics/composer.rb
89
111
  - lib/whirled_peas/graphics/container_coords.rb
90
112
  - lib/whirled_peas/graphics/container_dimensions.rb
91
113
  - lib/whirled_peas/graphics/container_painter.rb
114
+ - lib/whirled_peas/graphics/content_dimensions.rb
115
+ - lib/whirled_peas/graphics/content_painter.rb
92
116
  - lib/whirled_peas/graphics/debugger.rb
117
+ - lib/whirled_peas/graphics/graph_dimensions.rb
118
+ - lib/whirled_peas/graphics/graph_painter.rb
93
119
  - lib/whirled_peas/graphics/grid_painter.rb
94
120
  - lib/whirled_peas/graphics/mock_screen.rb
95
121
  - lib/whirled_peas/graphics/painter.rb
96
122
  - lib/whirled_peas/graphics/renderer.rb
97
- - lib/whirled_peas/graphics/screen.rb
98
- - lib/whirled_peas/graphics/text_dimensions.rb
99
123
  - lib/whirled_peas/graphics/text_painter.rb
100
124
  - lib/whirled_peas/null_logger.rb
101
125
  - lib/whirled_peas/settings.rb
126
+ - lib/whirled_peas/settings/alignment.rb
102
127
  - lib/whirled_peas/settings/bg_color.rb
103
128
  - lib/whirled_peas/settings/border.rb
104
129
  - lib/whirled_peas/settings/box_settings.rb
@@ -107,105 +132,174 @@ files:
107
132
  - lib/whirled_peas/settings/debugger.rb
108
133
  - lib/whirled_peas/settings/display_flow.rb
109
134
  - lib/whirled_peas/settings/element_settings.rb
135
+ - lib/whirled_peas/settings/graph_settings.rb
110
136
  - lib/whirled_peas/settings/grid_settings.rb
111
137
  - lib/whirled_peas/settings/margin.rb
112
138
  - lib/whirled_peas/settings/padding.rb
113
139
  - lib/whirled_peas/settings/position.rb
140
+ - lib/whirled_peas/settings/scrollbar.rb
141
+ - lib/whirled_peas/settings/sizing.rb
114
142
  - lib/whirled_peas/settings/spacing.rb
115
- - lib/whirled_peas/settings/text_align.rb
116
143
  - lib/whirled_peas/settings/text_color.rb
117
144
  - lib/whirled_peas/settings/text_settings.rb
118
- - lib/whirled_peas/template.rb
119
- - lib/whirled_peas/template/box_element.rb
120
- - lib/whirled_peas/template/composer.rb
121
- - lib/whirled_peas/template/container.rb
122
- - lib/whirled_peas/template/debugger.rb
123
- - lib/whirled_peas/template/element.rb
124
- - lib/whirled_peas/template/grid_element.rb
125
- - lib/whirled_peas/template/text_element.rb
145
+ - lib/whirled_peas/settings/vert_alignment.rb
126
146
  - lib/whirled_peas/utils.rb
127
147
  - lib/whirled_peas/utils/ansi.rb
148
+ - lib/whirled_peas/utils/file_handler.rb
128
149
  - lib/whirled_peas/utils/formatted_string.rb
129
150
  - lib/whirled_peas/utils/title_font.rb
130
151
  - lib/whirled_peas/version.rb
131
- - screen_test/rendered/elements/box.frame
132
- - screen_test/rendered/elements/box.rb
133
- - screen_test/rendered/elements/grid.frame
134
- - screen_test/rendered/elements/grid.rb
135
- - screen_test/rendered/elements/screen_overflow.rb
136
- - screen_test/rendered/elements/text.frame
137
- - screen_test/rendered/elements/text.rb
138
- - screen_test/rendered/elements/text_multiline.frame
139
- - screen_test/rendered/elements/text_multiline.rb
140
- - screen_test/rendered/settings/align/box.frame
141
- - screen_test/rendered/settings/align/box.rb
142
- - screen_test/rendered/settings/align/children_center.frame
143
- - screen_test/rendered/settings/align/children_center.rb
144
- - screen_test/rendered/settings/align/children_left.frame
145
- - screen_test/rendered/settings/align/children_left.rb
146
- - screen_test/rendered/settings/align/children_right.frame
147
- - screen_test/rendered/settings/align/children_right.rb
148
- - screen_test/rendered/settings/align/grid.frame
149
- - screen_test/rendered/settings/align/grid.rb
150
- - screen_test/rendered/settings/ansi/bold.frame
151
- - screen_test/rendered/settings/ansi/bold.rb
152
- - screen_test/rendered/settings/ansi/color.frame
153
- - screen_test/rendered/settings/ansi/color.rb
154
- - screen_test/rendered/settings/ansi/underline.frame
155
- - screen_test/rendered/settings/ansi/underline.rb
156
- - screen_test/rendered/settings/border.frame
157
- - screen_test/rendered/settings/border.rb
158
- - screen_test/rendered/settings/flow/l2r.frame
159
- - screen_test/rendered/settings/flow/l2r.rb
160
- - screen_test/rendered/settings/flow/t2b.frame
161
- - screen_test/rendered/settings/flow/t2b.rb
162
- - screen_test/rendered/settings/height/box.frame
163
- - screen_test/rendered/settings/height/box.rb
164
- - screen_test/rendered/settings/height/grid.frame
165
- - screen_test/rendered/settings/height/grid.rb
166
- - screen_test/rendered/settings/height/overflow_box.frame
167
- - screen_test/rendered/settings/height/overflow_box.rb
168
- - screen_test/rendered/settings/height/overflow_box_l2r.frame
169
- - screen_test/rendered/settings/height/overflow_box_l2r.rb
170
- - screen_test/rendered/settings/height/overflow_box_t2b.frame
171
- - screen_test/rendered/settings/height/overflow_box_t2b.rb
172
- - screen_test/rendered/settings/height/overflow_grid.frame
173
- - screen_test/rendered/settings/height/overflow_grid.rb
174
- - screen_test/rendered/settings/margin.frame
175
- - screen_test/rendered/settings/margin.rb
176
- - screen_test/rendered/settings/padding.frame
177
- - screen_test/rendered/settings/padding.rb
178
- - screen_test/rendered/settings/position/box_left.frame
179
- - screen_test/rendered/settings/position/box_left.rb
180
- - screen_test/rendered/settings/position/box_left_negative.frame
181
- - screen_test/rendered/settings/position/box_left_negative.rb
182
- - screen_test/rendered/settings/position/box_top.frame
183
- - screen_test/rendered/settings/position/box_top.rb
184
- - screen_test/rendered/settings/position/box_top_negative.frame
185
- - screen_test/rendered/settings/position/box_top_negative.rb
186
- - screen_test/rendered/settings/position/grid_left.frame
187
- - screen_test/rendered/settings/position/grid_left.rb
188
- - screen_test/rendered/settings/position/grid_left_negative.frame
189
- - screen_test/rendered/settings/position/grid_left_negative.rb
190
- - screen_test/rendered/settings/position/grid_top.frame
191
- - screen_test/rendered/settings/position/grid_top.rb
192
- - screen_test/rendered/settings/position/grid_top_negative.frame
193
- - screen_test/rendered/settings/position/grid_top_negative.rb
194
- - screen_test/rendered/settings/title_font.frame
195
- - screen_test/rendered/settings/title_font.rb
196
- - screen_test/rendered/settings/width/box.frame
197
- - screen_test/rendered/settings/width/box.rb
198
- - screen_test/rendered/settings/width/grid.frame
199
- - screen_test/rendered/settings/width/grid.rb
200
- - screen_test/rendered/settings/width/overflow_box.frame
201
- - screen_test/rendered/settings/width/overflow_box.rb
202
- - screen_test/rendered/settings/width/overflow_box_l2r.frame
203
- - screen_test/rendered/settings/width/overflow_box_l2r.rb
204
- - screen_test/rendered/settings/width/overflow_box_t2b.frame
205
- - screen_test/rendered/settings/width/overflow_box_t2b.rb
206
- - screen_test/rendered/settings/width/overflow_grid.frame
207
- - screen_test/rendered/settings/width/overflow_grid.rb
208
- - screen_test/screen_tester.rb
152
+ - screen_test/elements/box.frame
153
+ - screen_test/elements/box.rb
154
+ - screen_test/elements/graph.frame
155
+ - screen_test/elements/graph.rb
156
+ - screen_test/elements/grid.frame
157
+ - screen_test/elements/grid.rb
158
+ - screen_test/elements/screen_overflow_x.frame
159
+ - screen_test/elements/screen_overflow_x.rb
160
+ - screen_test/elements/screen_overflow_y.frame
161
+ - screen_test/elements/screen_overflow_y.rb
162
+ - screen_test/elements/text.frame
163
+ - screen_test/elements/text.rb
164
+ - screen_test/elements/text_multiline.frame
165
+ - screen_test/elements/text_multiline.rb
166
+ - screen_test/settings/align/box_around.frame
167
+ - screen_test/settings/align/box_around.rb
168
+ - screen_test/settings/align/box_between.frame
169
+ - screen_test/settings/align/box_between.rb
170
+ - screen_test/settings/align/box_center.frame
171
+ - screen_test/settings/align/box_center.rb
172
+ - screen_test/settings/align/box_default.frame
173
+ - screen_test/settings/align/box_default.rb
174
+ - screen_test/settings/align/box_evenly.frame
175
+ - screen_test/settings/align/box_evenly.rb
176
+ - screen_test/settings/align/box_left.frame
177
+ - screen_test/settings/align/box_left.rb
178
+ - screen_test/settings/align/box_right.frame
179
+ - screen_test/settings/align/box_right.rb
180
+ - screen_test/settings/align/children_center.frame
181
+ - screen_test/settings/align/children_center.rb
182
+ - screen_test/settings/align/children_left.frame
183
+ - screen_test/settings/align/children_left.rb
184
+ - screen_test/settings/align/children_right.frame
185
+ - screen_test/settings/align/children_right.rb
186
+ - screen_test/settings/align/grid_center.frame
187
+ - screen_test/settings/align/grid_center.rb
188
+ - screen_test/settings/align/grid_default.frame
189
+ - screen_test/settings/align/grid_default.rb
190
+ - screen_test/settings/align/grid_left.frame
191
+ - screen_test/settings/align/grid_left.rb
192
+ - screen_test/settings/align/grid_right.frame
193
+ - screen_test/settings/align/grid_right.rb
194
+ - screen_test/settings/ansi/bold.frame
195
+ - screen_test/settings/ansi/bold.rb
196
+ - screen_test/settings/ansi/color.frame
197
+ - screen_test/settings/ansi/color.rb
198
+ - screen_test/settings/ansi/underline.frame
199
+ - screen_test/settings/ansi/underline.rb
200
+ - screen_test/settings/border.frame
201
+ - screen_test/settings/border.rb
202
+ - screen_test/settings/flow/box_b2t.frame
203
+ - screen_test/settings/flow/box_b2t.rb
204
+ - screen_test/settings/flow/box_l2r.frame
205
+ - screen_test/settings/flow/box_l2r.rb
206
+ - screen_test/settings/flow/box_r2l.frame
207
+ - screen_test/settings/flow/box_r2l.rb
208
+ - screen_test/settings/flow/box_t2b.frame
209
+ - screen_test/settings/flow/box_t2b.rb
210
+ - screen_test/settings/flow/grid_b2t.frame
211
+ - screen_test/settings/flow/grid_b2t.rb
212
+ - screen_test/settings/flow/grid_l2r.frame
213
+ - screen_test/settings/flow/grid_l2r.rb
214
+ - screen_test/settings/flow/grid_r2l.frame
215
+ - screen_test/settings/flow/grid_r2l.rb
216
+ - screen_test/settings/flow/grid_t2b.frame
217
+ - screen_test/settings/flow/grid_t2b.rb
218
+ - screen_test/settings/height/box.frame
219
+ - screen_test/settings/height/box.rb
220
+ - screen_test/settings/height/box_border_sizing.frame
221
+ - screen_test/settings/height/box_border_sizing.rb
222
+ - screen_test/settings/height/grid.frame
223
+ - screen_test/settings/height/grid.rb
224
+ - screen_test/settings/height/overflow_box.frame
225
+ - screen_test/settings/height/overflow_box.rb
226
+ - screen_test/settings/height/overflow_box_l2r.frame
227
+ - screen_test/settings/height/overflow_box_l2r.rb
228
+ - screen_test/settings/height/overflow_box_t2b.frame
229
+ - screen_test/settings/height/overflow_box_t2b.rb
230
+ - screen_test/settings/height/overflow_grid.frame
231
+ - screen_test/settings/height/overflow_grid.rb
232
+ - screen_test/settings/margin.frame
233
+ - screen_test/settings/margin.rb
234
+ - screen_test/settings/padding.frame
235
+ - screen_test/settings/padding.rb
236
+ - screen_test/settings/position/box_left.frame
237
+ - screen_test/settings/position/box_left.rb
238
+ - screen_test/settings/position/box_left_negative.frame
239
+ - screen_test/settings/position/box_left_negative.rb
240
+ - screen_test/settings/position/box_top.frame
241
+ - screen_test/settings/position/box_top.rb
242
+ - screen_test/settings/position/box_top_negative.frame
243
+ - screen_test/settings/position/box_top_negative.rb
244
+ - screen_test/settings/position/grid_left.frame
245
+ - screen_test/settings/position/grid_left.rb
246
+ - screen_test/settings/position/grid_left_negative.frame
247
+ - screen_test/settings/position/grid_left_negative.rb
248
+ - screen_test/settings/position/grid_top.frame
249
+ - screen_test/settings/position/grid_top.rb
250
+ - screen_test/settings/position/grid_top_negative.frame
251
+ - screen_test/settings/position/grid_top_negative.rb
252
+ - screen_test/settings/scroll/horiz_box.frame
253
+ - screen_test/settings/scroll/horiz_box.rb
254
+ - screen_test/settings/scroll/horiz_box_align_center.rb
255
+ - screen_test/settings/scroll/horiz_box_align_right.rb
256
+ - screen_test/settings/scroll/vert_box.frame
257
+ - screen_test/settings/scroll/vert_box.rb
258
+ - screen_test/settings/title_font.frame
259
+ - screen_test/settings/title_font.rb
260
+ - screen_test/settings/valign/box_around.frame
261
+ - screen_test/settings/valign/box_around.rb
262
+ - screen_test/settings/valign/box_between.frame
263
+ - screen_test/settings/valign/box_between.rb
264
+ - screen_test/settings/valign/box_bottom.frame
265
+ - screen_test/settings/valign/box_bottom.rb
266
+ - screen_test/settings/valign/box_default.frame
267
+ - screen_test/settings/valign/box_default.rb
268
+ - screen_test/settings/valign/box_evenly.frame
269
+ - screen_test/settings/valign/box_evenly.rb
270
+ - screen_test/settings/valign/box_middle.frame
271
+ - screen_test/settings/valign/box_middle.rb
272
+ - screen_test/settings/valign/box_top.frame
273
+ - screen_test/settings/valign/box_top.rb
274
+ - screen_test/settings/valign/grid_bottom.frame
275
+ - screen_test/settings/valign/grid_bottom.rb
276
+ - screen_test/settings/valign/grid_default.frame
277
+ - screen_test/settings/valign/grid_default.rb
278
+ - screen_test/settings/valign/grid_middle.frame
279
+ - screen_test/settings/valign/grid_middle.rb
280
+ - screen_test/settings/valign/grid_top.frame
281
+ - screen_test/settings/valign/grid_top.rb
282
+ - screen_test/settings/width/box_border_sizing.frame
283
+ - screen_test/settings/width/box_border_sizing.rb
284
+ - screen_test/settings/width/box_content.frame
285
+ - screen_test/settings/width/box_content.rb
286
+ - screen_test/settings/width/box_default.frame
287
+ - screen_test/settings/width/box_default.rb
288
+ - screen_test/settings/width/grid.frame
289
+ - screen_test/settings/width/grid.rb
290
+ - screen_test/settings/width/overflow_align_center.frame
291
+ - screen_test/settings/width/overflow_align_center.rb
292
+ - screen_test/settings/width/overflow_align_right.frame
293
+ - screen_test/settings/width/overflow_align_right.rb
294
+ - screen_test/settings/width/overflow_box.frame
295
+ - screen_test/settings/width/overflow_box.rb
296
+ - screen_test/settings/width/overflow_box_l2r.frame
297
+ - screen_test/settings/width/overflow_box_l2r.rb
298
+ - screen_test/settings/width/overflow_box_t2b.frame
299
+ - screen_test/settings/width/overflow_box_t2b.rb
300
+ - screen_test/settings/width/overflow_grid.frame
301
+ - screen_test/settings/width/overflow_grid.rb
302
+ - tools/whirled_peas/tools/screen_tester.rb
209
303
  - whirled_peas.gemspec
210
304
  homepage: https://github.com/tcollier/whirled_peas
211
305
  licenses:
data/bin/debug DELETED
@@ -1,35 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- def print_usage
4
- puts "Usage: #{$0} <config file> [options]"
5
- puts
6
- puts 'options include'
7
- puts ' --disable-screen Disable the screen (useful when printing debug statements)'
8
- puts ' --painter Print the painter debug tree and exit'
9
- puts ' --template Print the template debug tree and exit'
10
- end
11
-
12
- if !(1..2).include?(ARGV.length)
13
- print_usage
14
- exit(1)
15
- elsif !File.exist?(ARGV.first)
16
- puts "File not found: #{ARGV.first}"
17
- print_usage
18
- exit(1)
19
- elsif ARGV.length == 2 && !%w[--disable-screen --template --painter].include?(ARGV[1])
20
- puts "Unrecognized option: #{ARGV[1]}"
21
- print_usage
22
- exit(1)
23
- end
24
-
25
- require 'bundler/setup'
26
- require 'whirled_peas'
27
-
28
- if ARGV.length == 1
29
- option = nil
30
- else
31
- option = ARGV[1].sub(/^--/, '').gsub(/-/, '_').to_sym
32
- end
33
-
34
- template_file = ARGV.first[0] == '/' ? ARGV.first : File.join(Dir.pwd, ARGV.first)
35
- WhirledPeas.debug(template_file, option)
@@ -1,80 +0,0 @@
1
- require 'whirled_peas/frame/event_loop'
2
- require 'whirled_peas/frame/producer'
3
- require 'whirled_peas/graphics/debugger'
4
- require 'whirled_peas/graphics/mock_screen'
5
- require 'whirled_peas/graphics/renderer'
6
- require 'whirled_peas/graphics/screen'
7
- require 'whirled_peas/template/debugger'
8
-
9
- module WhirledPeas
10
- class Debugger
11
- module Option
12
- DISABLE_SCREEN = :disable_screen
13
- PAINTER = :painter
14
- TEMPLATE = :template
15
-
16
- VALID = [DISABLE_SCREEN, PAINTER, TEMPLATE]
17
- end
18
- private_constant :Option
19
-
20
- FRAME = 'debug'
21
- private_constant :FRAME
22
-
23
- def initialize(template_file, option=nil)
24
- unless option.nil? || Option::VALID.include?(option)
25
- message =
26
- "Invalid option: #{option}, expecting one of #{Option::VALID.join(', ')}"
27
- raise ArgumentError, message
28
- end
29
- @template_file = template_file
30
- @option = option
31
- end
32
-
33
- def debug
34
- require template_file
35
- template_factory = TemplateFactory.new
36
- if play_frame?
37
- screen = if disable_screen?
38
- Graphics::MockScreen.new(80, 40)
39
- else
40
- Graphics::Screen.new
41
- end
42
- consumer = Frame::EventLoop.new(template_factory, screen: screen)
43
- Frame::Producer.produce(consumer) do |producer|
44
- producer.send_frame(FRAME, args: {})
45
- end
46
- return
47
- end
48
-
49
- template = template_factory.build(FRAME, {})
50
- if print_painter?
51
- painter = Graphics::Renderer.new(template, *Graphics::Screen.current_dimensions).painter
52
- puts Graphics::Debugger.new(painter).debug
53
- elsif print_template?
54
- puts Template::Debugger.new(template).debug
55
- end
56
- end
57
-
58
- private
59
-
60
- attr_reader :template_file, :option
61
-
62
- def play_frame?
63
- option.nil? || option == Option::DISABLE_SCREEN
64
- end
65
-
66
- def disable_screen?
67
- !option.nil? && option == Option::DISABLE_SCREEN
68
- end
69
-
70
- def print_painter?
71
- !option.nil? && option == Option::PAINTER
72
- end
73
-
74
- def print_template?
75
- !option.nil? && option == Option::TEMPLATE
76
- end
77
- end
78
-
79
- private_constant :Debugger
80
- end