whirled_peas 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (242) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +9 -1
  3. data/README.md +315 -43
  4. data/Rakefile +8 -18
  5. data/lib/whirled_peas/graphics.rb +14 -0
  6. data/lib/whirled_peas/graphics/box_painter.rb +39 -46
  7. data/lib/whirled_peas/graphics/canvas.rb +22 -11
  8. data/lib/whirled_peas/graphics/container_coords.rb +6 -5
  9. data/lib/whirled_peas/graphics/container_dimensions.rb +26 -8
  10. data/lib/whirled_peas/graphics/container_painter.rb +42 -4
  11. data/lib/whirled_peas/graphics/grid_painter.rb +11 -10
  12. data/lib/whirled_peas/graphics/painter.rb +5 -1
  13. data/lib/whirled_peas/graphics/renderer.rb +6 -1
  14. data/lib/whirled_peas/graphics/text_painter.rb +2 -2
  15. data/lib/whirled_peas/settings/alignment.rb +24 -0
  16. data/lib/whirled_peas/settings/bg_color.rb +2 -0
  17. data/lib/whirled_peas/settings/border.rb +16 -16
  18. data/lib/whirled_peas/settings/color.rb +13 -14
  19. data/lib/whirled_peas/settings/container_settings.rb +126 -42
  20. data/lib/whirled_peas/settings/display_flow.rb +13 -11
  21. data/lib/whirled_peas/settings/element_settings.rb +3 -3
  22. data/lib/whirled_peas/settings/grid_settings.rb +5 -1
  23. data/lib/whirled_peas/settings/sizing.rb +19 -0
  24. data/lib/whirled_peas/settings/spacing.rb +34 -0
  25. data/lib/whirled_peas/settings/text_color.rb +2 -0
  26. data/lib/whirled_peas/settings/vert_alignment.rb +24 -0
  27. data/lib/whirled_peas/utils/title_font.rb +1 -1
  28. data/lib/whirled_peas/version.rb +1 -1
  29. data/screen_test/{rendered/elements → elements}/box.frame +1 -1
  30. data/screen_test/{rendered/elements → elements}/box.rb +0 -0
  31. data/screen_test/elements/grid.frame +1 -0
  32. data/screen_test/{rendered/elements → elements}/grid.rb +0 -0
  33. data/screen_test/elements/screen_overflow_x.frame +1 -0
  34. data/screen_test/{rendered/elements/screen_overflow.rb → elements/screen_overflow_x.rb} +0 -0
  35. data/screen_test/elements/screen_overflow_y.frame +1 -0
  36. data/screen_test/elements/screen_overflow_y.rb +9 -0
  37. data/screen_test/elements/text.frame +1 -0
  38. data/screen_test/{rendered/elements → elements}/text.rb +0 -0
  39. data/screen_test/elements/text_multiline.frame +1 -0
  40. data/screen_test/{rendered/elements → elements}/text_multiline.rb +0 -0
  41. data/screen_test/settings/align/box_around.frame +1 -0
  42. data/screen_test/settings/align/box_around.rb +16 -0
  43. data/screen_test/settings/align/box_between.frame +1 -0
  44. data/screen_test/settings/align/box_between.rb +16 -0
  45. data/screen_test/settings/align/box_center.frame +1 -0
  46. data/screen_test/{rendered/settings/align/grid.rb → settings/align/box_center.rb} +7 -6
  47. data/screen_test/settings/align/box_default.frame +1 -0
  48. data/screen_test/settings/align/box_default.rb +20 -0
  49. data/screen_test/settings/align/box_evenly.frame +1 -0
  50. data/screen_test/settings/align/box_evenly.rb +16 -0
  51. data/screen_test/settings/align/box_left.frame +1 -0
  52. data/screen_test/settings/align/box_left.rb +21 -0
  53. data/screen_test/settings/align/box_right.frame +1 -0
  54. data/screen_test/settings/align/box_right.rb +21 -0
  55. data/screen_test/settings/align/children_center.frame +1 -0
  56. data/screen_test/settings/align/children_center.rb +15 -0
  57. data/screen_test/settings/align/children_left.frame +1 -0
  58. data/screen_test/settings/align/children_left.rb +15 -0
  59. data/screen_test/settings/align/children_right.frame +1 -0
  60. data/screen_test/settings/align/children_right.rb +15 -0
  61. data/screen_test/settings/align/grid_center.frame +1 -0
  62. data/screen_test/settings/align/grid_center.rb +18 -0
  63. data/screen_test/settings/align/grid_default.frame +1 -0
  64. data/screen_test/settings/align/grid_default.rb +17 -0
  65. data/screen_test/settings/align/grid_left.frame +1 -0
  66. data/screen_test/settings/align/grid_left.rb +18 -0
  67. data/screen_test/settings/align/grid_right.frame +1 -0
  68. data/screen_test/settings/align/grid_right.rb +18 -0
  69. data/screen_test/settings/ansi/bold.frame +1 -0
  70. data/screen_test/{rendered/settings/height/overflow_box_t2b.rb → settings/ansi/bold.rb} +4 -4
  71. data/screen_test/{rendered/settings → settings}/ansi/color.frame +1 -1
  72. data/screen_test/{rendered/settings → settings}/ansi/color.rb +0 -0
  73. data/screen_test/settings/ansi/underline.frame +1 -0
  74. data/screen_test/{rendered/settings → settings}/ansi/underline.rb +4 -5
  75. data/screen_test/{rendered/settings → settings}/border.frame +1 -1
  76. data/screen_test/{rendered/settings → settings}/border.rb +1 -1
  77. data/screen_test/settings/flow/box_b2t.frame +1 -0
  78. data/screen_test/settings/flow/box_b2t.rb +26 -0
  79. data/screen_test/settings/flow/box_l2r.frame +1 -0
  80. data/screen_test/settings/flow/box_l2r.rb +26 -0
  81. data/screen_test/settings/flow/box_r2l.frame +1 -0
  82. data/screen_test/settings/flow/box_r2l.rb +26 -0
  83. data/screen_test/settings/flow/box_t2b.frame +1 -0
  84. data/screen_test/settings/flow/box_t2b.rb +26 -0
  85. data/screen_test/settings/flow/grid_b2t.frame +1 -0
  86. data/screen_test/{rendered/settings → settings}/flow/grid_b2t.rb +0 -0
  87. data/screen_test/settings/flow/grid_l2r.frame +1 -0
  88. data/screen_test/{rendered/settings → settings}/flow/grid_l2r.rb +0 -0
  89. data/screen_test/settings/flow/grid_r2l.frame +1 -0
  90. data/screen_test/{rendered/settings → settings}/flow/grid_r2l.rb +0 -0
  91. data/screen_test/settings/flow/grid_t2b.frame +1 -0
  92. data/screen_test/{rendered/settings → settings}/flow/grid_t2b.rb +0 -0
  93. data/screen_test/settings/height/box.frame +1 -0
  94. data/screen_test/{rendered/settings → settings}/height/box.rb +0 -0
  95. data/screen_test/settings/height/box_border_sizing.frame +1 -0
  96. data/screen_test/settings/height/box_border_sizing.rb +15 -0
  97. data/screen_test/settings/height/grid.frame +1 -0
  98. data/screen_test/{rendered/settings → settings}/height/grid.rb +0 -0
  99. data/screen_test/settings/height/overflow_box.frame +1 -0
  100. data/screen_test/settings/height/overflow_box.rb +13 -0
  101. data/screen_test/settings/height/overflow_box_l2r.frame +1 -0
  102. data/screen_test/settings/height/overflow_box_l2r.rb +17 -0
  103. data/screen_test/settings/height/overflow_box_t2b.frame +1 -0
  104. data/screen_test/settings/height/overflow_box_t2b.rb +16 -0
  105. data/screen_test/settings/height/overflow_grid.frame +1 -0
  106. data/screen_test/{rendered/settings → settings}/height/overflow_grid.rb +0 -0
  107. data/screen_test/settings/margin.frame +1 -0
  108. data/screen_test/settings/margin.rb +16 -0
  109. data/screen_test/settings/padding.frame +1 -0
  110. data/screen_test/settings/padding.rb +13 -0
  111. data/screen_test/settings/position/box_left.frame +1 -0
  112. data/screen_test/{rendered/settings → settings}/position/box_left.rb +2 -2
  113. data/screen_test/settings/position/box_left_negative.frame +1 -0
  114. data/screen_test/{rendered/settings → settings}/position/box_left_negative.rb +2 -2
  115. data/screen_test/settings/position/box_top.frame +1 -0
  116. data/screen_test/{rendered/settings → settings}/position/box_top.rb +1 -1
  117. data/screen_test/settings/position/box_top_negative.frame +1 -0
  118. data/screen_test/{rendered/settings → settings}/position/box_top_negative.rb +2 -2
  119. data/screen_test/settings/position/grid_left.frame +1 -0
  120. data/screen_test/{rendered/settings → settings}/position/grid_left.rb +1 -1
  121. data/screen_test/settings/position/grid_left_negative.frame +1 -0
  122. data/screen_test/{rendered/settings → settings}/position/grid_left_negative.rb +1 -1
  123. data/screen_test/settings/position/grid_top.frame +1 -0
  124. data/screen_test/{rendered/settings → settings}/position/grid_top.rb +1 -1
  125. data/screen_test/settings/position/grid_top_negative.frame +1 -0
  126. data/screen_test/{rendered/settings → settings}/position/grid_top_negative.rb +1 -1
  127. data/screen_test/settings/scroll/horiz_box.frame +1 -0
  128. data/screen_test/settings/scroll/horiz_box.rb +17 -0
  129. data/screen_test/settings/scroll/horiz_box_align_center.rb +18 -0
  130. data/screen_test/settings/scroll/horiz_box_align_right.rb +18 -0
  131. data/screen_test/settings/scroll/vert_box.frame +1 -0
  132. data/screen_test/settings/scroll/vert_box.rb +20 -0
  133. data/screen_test/settings/title_font.frame +1 -0
  134. data/screen_test/{rendered/settings → settings}/title_font.rb +1 -1
  135. data/screen_test/settings/valign/box_around.frame +1 -0
  136. data/screen_test/settings/valign/box_around.rb +17 -0
  137. data/screen_test/settings/valign/box_between.frame +1 -0
  138. data/screen_test/settings/valign/box_between.rb +17 -0
  139. data/screen_test/settings/valign/box_bottom.frame +1 -0
  140. data/screen_test/settings/valign/box_bottom.rb +17 -0
  141. data/screen_test/settings/valign/box_default.frame +1 -0
  142. data/screen_test/settings/valign/box_default.rb +16 -0
  143. data/screen_test/settings/valign/box_evenly.frame +1 -0
  144. data/screen_test/settings/valign/box_evenly.rb +17 -0
  145. data/screen_test/settings/valign/box_middle.frame +1 -0
  146. data/screen_test/settings/valign/box_middle.rb +17 -0
  147. data/screen_test/settings/valign/box_top.frame +1 -0
  148. data/screen_test/settings/valign/box_top.rb +17 -0
  149. data/screen_test/settings/valign/grid_bottom.frame +1 -0
  150. data/screen_test/settings/valign/grid_bottom.rb +15 -0
  151. data/screen_test/settings/valign/grid_default.frame +1 -0
  152. data/screen_test/settings/valign/grid_default.rb +14 -0
  153. data/screen_test/settings/valign/grid_middle.frame +1 -0
  154. data/screen_test/settings/valign/grid_middle.rb +15 -0
  155. data/screen_test/settings/valign/grid_top.frame +1 -0
  156. data/screen_test/settings/valign/grid_top.rb +15 -0
  157. data/screen_test/settings/width/box_border_sizing.frame +1 -0
  158. data/screen_test/settings/width/box_border_sizing.rb +15 -0
  159. data/screen_test/settings/width/box_content.frame +1 -0
  160. data/screen_test/settings/width/box_content.rb +15 -0
  161. data/screen_test/settings/width/box_default.frame +1 -0
  162. data/screen_test/{rendered/settings/width/box.rb → settings/width/box_default.rb} +3 -2
  163. data/screen_test/settings/width/grid.frame +1 -0
  164. data/screen_test/{rendered/settings → settings}/width/grid.rb +2 -2
  165. data/screen_test/settings/width/overflow_align_center.frame +1 -0
  166. data/screen_test/settings/width/overflow_align_center.rb +14 -0
  167. data/screen_test/settings/width/overflow_align_right.frame +1 -0
  168. data/screen_test/settings/width/overflow_align_right.rb +14 -0
  169. data/screen_test/settings/width/overflow_box.frame +1 -0
  170. data/screen_test/settings/width/overflow_box.rb +13 -0
  171. data/screen_test/settings/width/overflow_box_l2r.frame +1 -0
  172. data/screen_test/settings/width/overflow_box_l2r.rb +16 -0
  173. data/screen_test/settings/width/overflow_box_t2b.frame +1 -0
  174. data/screen_test/settings/width/overflow_box_t2b.rb +17 -0
  175. data/screen_test/settings/width/overflow_grid.frame +1 -0
  176. data/screen_test/{rendered/settings → settings}/width/overflow_grid.rb +0 -0
  177. data/tools/whirled_peas/tools/screen_tester.rb +233 -0
  178. metadata +154 -98
  179. data/lib/whirled_peas/settings/text_align.rb +0 -19
  180. data/screen_test/rendered/elements/grid.frame +0 -1
  181. data/screen_test/rendered/elements/screen_overflow.frame +0 -1
  182. data/screen_test/rendered/elements/text.frame +0 -1
  183. data/screen_test/rendered/elements/text_multiline.frame +0 -1
  184. data/screen_test/rendered/settings/align/box.frame +0 -1
  185. data/screen_test/rendered/settings/align/box.rb +0 -24
  186. data/screen_test/rendered/settings/align/children_center.frame +0 -1
  187. data/screen_test/rendered/settings/align/children_center.rb +0 -13
  188. data/screen_test/rendered/settings/align/children_left.frame +0 -1
  189. data/screen_test/rendered/settings/align/children_left.rb +0 -13
  190. data/screen_test/rendered/settings/align/children_right.frame +0 -1
  191. data/screen_test/rendered/settings/align/children_right.rb +0 -13
  192. data/screen_test/rendered/settings/align/grid.frame +0 -1
  193. data/screen_test/rendered/settings/ansi/bold.frame +0 -1
  194. data/screen_test/rendered/settings/ansi/bold.rb +0 -15
  195. data/screen_test/rendered/settings/ansi/underline.frame +0 -1
  196. data/screen_test/rendered/settings/flow/box_b2t.frame +0 -1
  197. data/screen_test/rendered/settings/flow/box_b2t.rb +0 -24
  198. data/screen_test/rendered/settings/flow/box_l2r.frame +0 -1
  199. data/screen_test/rendered/settings/flow/box_l2r.rb +0 -24
  200. data/screen_test/rendered/settings/flow/box_r2l.frame +0 -1
  201. data/screen_test/rendered/settings/flow/box_r2l.rb +0 -24
  202. data/screen_test/rendered/settings/flow/box_t2b.frame +0 -1
  203. data/screen_test/rendered/settings/flow/box_t2b.rb +0 -24
  204. data/screen_test/rendered/settings/flow/grid_b2t.frame +0 -1
  205. data/screen_test/rendered/settings/flow/grid_l2r.frame +0 -1
  206. data/screen_test/rendered/settings/flow/grid_r2l.frame +0 -1
  207. data/screen_test/rendered/settings/flow/grid_t2b.frame +0 -1
  208. data/screen_test/rendered/settings/height/box.frame +0 -1
  209. data/screen_test/rendered/settings/height/grid.frame +0 -1
  210. data/screen_test/rendered/settings/height/overflow_box.frame +0 -1
  211. data/screen_test/rendered/settings/height/overflow_box.rb +0 -13
  212. data/screen_test/rendered/settings/height/overflow_box_l2r.frame +0 -1
  213. data/screen_test/rendered/settings/height/overflow_box_l2r.rb +0 -15
  214. data/screen_test/rendered/settings/height/overflow_box_t2b.frame +0 -1
  215. data/screen_test/rendered/settings/height/overflow_grid.frame +0 -1
  216. data/screen_test/rendered/settings/margin.frame +0 -1
  217. data/screen_test/rendered/settings/margin.rb +0 -14
  218. data/screen_test/rendered/settings/padding.frame +0 -1
  219. data/screen_test/rendered/settings/padding.rb +0 -11
  220. data/screen_test/rendered/settings/position/box_left.frame +0 -1
  221. data/screen_test/rendered/settings/position/box_left_negative.frame +0 -1
  222. data/screen_test/rendered/settings/position/box_top.frame +0 -1
  223. data/screen_test/rendered/settings/position/box_top_negative.frame +0 -1
  224. data/screen_test/rendered/settings/position/grid_left.frame +0 -1
  225. data/screen_test/rendered/settings/position/grid_left_negative.frame +0 -1
  226. data/screen_test/rendered/settings/position/grid_top.frame +0 -1
  227. data/screen_test/rendered/settings/position/grid_top_negative.frame +0 -1
  228. data/screen_test/rendered/settings/scroll/horiz_box.frame +0 -1
  229. data/screen_test/rendered/settings/scroll/horiz_box.rb +0 -15
  230. data/screen_test/rendered/settings/scroll/vert_box.frame +0 -1
  231. data/screen_test/rendered/settings/scroll/vert_box.rb +0 -18
  232. data/screen_test/rendered/settings/title_font.frame +0 -1
  233. data/screen_test/rendered/settings/width/box.frame +0 -1
  234. data/screen_test/rendered/settings/width/grid.frame +0 -1
  235. data/screen_test/rendered/settings/width/overflow_box.frame +0 -1
  236. data/screen_test/rendered/settings/width/overflow_box.rb +0 -11
  237. data/screen_test/rendered/settings/width/overflow_box_l2r.frame +0 -1
  238. data/screen_test/rendered/settings/width/overflow_box_l2r.rb +0 -14
  239. data/screen_test/rendered/settings/width/overflow_box_t2b.frame +0 -1
  240. data/screen_test/rendered/settings/width/overflow_box_t2b.rb +0 -15
  241. data/screen_test/rendered/settings/width/overflow_grid.frame +0 -1
  242. data/screen_test/screen_tester.rb +0 -201
@@ -3,7 +3,7 @@ require 'whirled_peas'
3
3
  class TemplateFactory
4
4
  def build(*)
5
5
  WhirledPeas.template do |composer, settings|
6
- settings.set_padding(left: 10, top: 10)
6
+ settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
9
9
  composer.add_box do |_, settings|
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┃ ┃┃ ┃┃ ┃┗━━━━━┛333334432254321[?25h
@@ -3,11 +3,11 @@ require 'whirled_peas'
3
3
  class TemplateFactory
4
4
  def build(*)
5
5
  WhirledPeas.template do |composer, settings|
6
- settings.set_padding(left: 10, top: 10)
6
+ settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
9
9
  composer.add_box do |_, settings|
10
- settings.set_position(top: -3)
10
+ settings.position.top = -3
11
11
  settings.full_border(color: :red)
12
12
  %w[12345 22344 33333 44322 54321].join("\n")
13
13
  end
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━┃ ┣━━━┃ ┣━━━┃ ┣━━━┃ ┣━━━┃ ┗━━━123223333443543[?25h
@@ -3,7 +3,7 @@ require 'whirled_peas'
3
3
  class TemplateFactory
4
4
  def build(*)
5
5
  WhirledPeas.template do |composer, settings|
6
- settings.set_padding(left: 10, top: 10)
6
+ settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
9
9
  composer.add_grid do |_, settings|
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛━━━┓ ┃━━━┫ ┃━━━┫ ┃━━━┫ ┃━━━┫ ┃━━━┛345344333322321[?25h
@@ -3,7 +3,7 @@ require 'whirled_peas'
3
3
  class TemplateFactory
4
4
  def build(*)
5
5
  WhirledPeas.template do |composer, settings|
6
- settings.set_padding(left: 10, top: 10)
6
+ settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
9
9
  composer.add_grid('Subject') do |_, settings|
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━━━┓┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃12345223443333344322[?25h
@@ -3,7 +3,7 @@ require 'whirled_peas'
3
3
  class TemplateFactory
4
4
  def build(*)
5
5
  WhirledPeas.template do |composer, settings|
6
- settings.set_padding(left: 10, top: 10)
6
+ settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
9
9
  composer.add_grid do |_, settings|
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┗━━━━━┛22344333334432254321[?25h
@@ -3,7 +3,7 @@ require 'whirled_peas'
3
3
  class TemplateFactory
4
4
  def build(*)
5
5
  WhirledPeas.template do |composer, settings|
6
- settings.set_padding(left: 10, top: 10)
6
+ settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
9
9
  composer.add_grid do |_, settings|
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━┓┃ ┃┃▗▖ ┃┗━━━━━┛EFGHI[?25h
@@ -0,0 +1,17 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box('Outer') do |composer, settings|
7
+ settings.full_border
8
+ settings.scrollbar.horiz = true
9
+ settings.width = 5
10
+ composer.add_box('Inner') do |composer, settings|
11
+ settings.set_position(left: -4)
12
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
13
+ end
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,18 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box('Outer') do |composer, settings|
7
+ settings.full_border
8
+ settings.align = :center
9
+ settings.scrollbar.horiz = true
10
+ settings.width = 5
11
+ composer.add_box('Inner') do |composer, settings|
12
+ settings.set_position(left: -4)
13
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box('Outer') do |composer, settings|
7
+ settings.full_border
8
+ settings.align = :right
9
+ settings.scrollbar.horiz = true
10
+ settings.width = 5
11
+ composer.add_box('Inner') do |composer, settings|
12
+ settings.set_position(left: -4)
13
+ 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
14
+ end
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━━┓┃ ▗┃┃ ▝┃┃ ┃┃ ┃┃ ┃┗━━┛EFGHI[?25h
@@ -0,0 +1,20 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box('Outer') do |composer, settings|
7
+ settings.full_border
8
+ settings.scrollbar.vert = true
9
+ settings.height = 5
10
+ composer.add_box('Inner') do |composer, settings|
11
+ settings.flow = :t2b
12
+ settings.set_position(top: -4)
13
+ 26.times do |i|
14
+ composer.add_text { ('A'.ord + i).chr }
15
+ end
16
+ end
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1 @@
1
+ [?25l██╗ ██╗██╗██╗██║ ██║██║██║███████║██║██║██╔══██║██║╚═╝██║ ██║██║██╗╚═╝ ╚═╝╚═╝╚═╝[?25h
@@ -5,7 +5,7 @@ class TemplateFactory
5
5
  WhirledPeas.template do |composer|
6
6
  composer.add_text('Title') do |_, settings|
7
7
  settings.title_font = :default
8
- "Test"
8
+ "Hi!"
9
9
  end
10
10
  end
11
11
  end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -0,0 +1,17 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box do |composer, settings|
7
+ settings.flow = :t2b
8
+ settings.full_border
9
+ settings.valign = :around
10
+ settings.height = 15
11
+ composer.add_text { 'A' }
12
+ composer.add_text { 'B' }
13
+ composer.add_text { 'C' }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -0,0 +1,17 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box do |composer, settings|
7
+ settings.flow = :t2b
8
+ settings.full_border
9
+ settings.valign = :between
10
+ settings.height = 15
11
+ composer.add_text { 'A' }
12
+ composer.add_text { 'B' }
13
+ composer.add_text { 'C' }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -0,0 +1,17 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box do |composer, settings|
7
+ settings.flow = :t2b
8
+ settings.full_border
9
+ settings.valign = :bottom
10
+ settings.height = 15
11
+ composer.add_text { 'A' }
12
+ composer.add_text { 'B' }
13
+ composer.add_text { 'C' }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -0,0 +1,16 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box do |composer, settings|
7
+ settings.flow = :t2b
8
+ settings.full_border
9
+ settings.height = 15
10
+ composer.add_text { 'A' }
11
+ composer.add_text { 'B' }
12
+ composer.add_text { 'C' }
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -0,0 +1,17 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box do |composer, settings|
7
+ settings.flow = :t2b
8
+ settings.full_border
9
+ settings.valign = :evenly
10
+ settings.height = 15
11
+ composer.add_text { 'A' }
12
+ composer.add_text { 'B' }
13
+ composer.add_text { 'C' }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -0,0 +1,17 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box do |composer, settings|
7
+ settings.flow = :t2b
8
+ settings.full_border
9
+ settings.valign = :middle
10
+ settings.height = 15
11
+ composer.add_text { 'A' }
12
+ composer.add_text { 'B' }
13
+ composer.add_text { 'C' }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -0,0 +1,17 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box do |composer, settings|
7
+ settings.flow = :t2b
8
+ settings.full_border
9
+ settings.valign = :top
10
+ settings.height = 15
11
+ composer.add_text { 'A' }
12
+ composer.add_text { 'B' }
13
+ composer.add_text { 'C' }
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
@@ -0,0 +1,15 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_grid('Alignment') do |composer, settings|
7
+ settings.num_cols = 1
8
+ settings.full_border
9
+ settings.height = 3
10
+ settings.valign = :bottom
11
+ composer.add_text { 'A' }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
@@ -0,0 +1,14 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_grid('Alignment') do |composer, settings|
7
+ settings.num_cols = 1
8
+ settings.full_border
9
+ settings.height = 3
10
+ composer.add_text { 'A' }
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
@@ -0,0 +1,15 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_grid('Alignment') do |composer, settings|
7
+ settings.num_cols = 1
8
+ settings.full_border
9
+ settings.height = 3
10
+ settings.valign = :middle
11
+ composer.add_text { 'A' }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
@@ -0,0 +1,15 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_grid('Alignment') do |composer, settings|
7
+ settings.num_cols = 1
8
+ settings.full_border
9
+ settings.height = 3
10
+ settings.valign = :top
11
+ composer.add_text { 'A' }
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━┛15/bor[?25h
@@ -0,0 +1,15 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box('Wide') do |_, settings|
7
+ settings.full_border
8
+ settings.set_padding(left: 3, right: 4)
9
+ settings.width = 15
10
+ settings.sizing = :border
11
+ '15/border'
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1 @@
1
+ [?25l┏━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━┛15/content[?25h
@@ -0,0 +1,15 @@
1
+ require 'whirled_peas'
2
+
3
+ class TemplateFactory
4
+ def build(*)
5
+ WhirledPeas.template do |composer|
6
+ composer.add_box('Wide') do |_, settings|
7
+ settings.full_border
8
+ settings.set_padding(left: 3, right: 4)
9
+ settings.width = 15
10
+ settings.sizing = :content
11
+ '15/content'
12
+ end
13
+ end
14
+ end
15
+ end