whirled_peas 0.7.0 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (220) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/CHANGELOG.md +25 -0
  4. data/README.md +467 -120
  5. data/Rakefile +1 -20
  6. data/bin/easing +33 -0
  7. data/bin/reset_cursor +11 -0
  8. data/bin/screen_test +68 -0
  9. data/examples/graph.rb +54 -0
  10. data/examples/intro.rb +3 -3
  11. data/examples/scrolling.rb +5 -4
  12. data/lib/data/themes.yaml +13 -0
  13. data/lib/whirled_peas.rb +12 -6
  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 +43 -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 +111 -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/themes.rb +76 -0
  33. data/lib/whirled_peas/command_line.rb +24 -212
  34. data/lib/whirled_peas/config.rb +56 -6
  35. data/lib/whirled_peas/device.rb +5 -0
  36. data/lib/whirled_peas/device/null_device.rb +8 -0
  37. data/lib/whirled_peas/device/output_file.rb +19 -0
  38. data/lib/whirled_peas/device/screen.rb +26 -0
  39. data/lib/whirled_peas/graphics/composer.rb +23 -2
  40. data/lib/whirled_peas/graphics/container_painter.rb +91 -0
  41. data/lib/whirled_peas/graphics/content_dimensions.rb +19 -0
  42. data/lib/whirled_peas/graphics/content_painter.rb +20 -0
  43. data/lib/whirled_peas/graphics/graph_dimensions.rb +12 -0
  44. data/lib/whirled_peas/graphics/graph_painter.rb +97 -0
  45. data/lib/whirled_peas/graphics/grid_painter.rb +1 -4
  46. data/lib/whirled_peas/graphics/painter.rb +10 -0
  47. data/lib/whirled_peas/graphics/renderer.rb +8 -2
  48. data/lib/whirled_peas/graphics/text_painter.rb +7 -11
  49. data/lib/whirled_peas/settings/border.rb +25 -4
  50. data/lib/whirled_peas/settings/container_settings.rb +2 -4
  51. data/lib/whirled_peas/settings/element_settings.rb +12 -3
  52. data/lib/whirled_peas/settings/graph_settings.rb +21 -0
  53. data/lib/whirled_peas/settings/grid_settings.rb +7 -0
  54. data/lib/whirled_peas/settings/text_settings.rb +1 -0
  55. data/lib/whirled_peas/settings/theme.rb +40 -0
  56. data/lib/whirled_peas/settings/theme_library.rb +63 -0
  57. data/lib/whirled_peas/utils/ansi.rb +13 -0
  58. data/lib/whirled_peas/utils/file_handler.rb +57 -0
  59. data/lib/whirled_peas/version.rb +1 -1
  60. data/screen_test/elements/box.frame +1 -1
  61. data/screen_test/elements/box.rb +1 -1
  62. data/screen_test/elements/graph.frame +1 -0
  63. data/screen_test/elements/graph.rb +12 -0
  64. data/screen_test/elements/grid.frame +1 -1
  65. data/screen_test/elements/grid.rb +1 -1
  66. data/screen_test/elements/screen_overflow_x.frame +1 -1
  67. data/screen_test/elements/screen_overflow_x.rb +1 -1
  68. data/screen_test/elements/screen_overflow_y.frame +1 -1
  69. data/screen_test/elements/screen_overflow_y.rb +1 -1
  70. data/screen_test/elements/text.frame +1 -1
  71. data/screen_test/elements/text.rb +1 -1
  72. data/screen_test/elements/text_multiline.frame +1 -1
  73. data/screen_test/elements/text_multiline.rb +1 -1
  74. data/screen_test/elements/theme.frame +1 -0
  75. data/screen_test/elements/theme.rb +26 -0
  76. data/screen_test/settings/align/box_around.frame +1 -1
  77. data/screen_test/settings/align/box_around.rb +1 -1
  78. data/screen_test/settings/align/box_between.frame +1 -1
  79. data/screen_test/settings/align/box_between.rb +1 -1
  80. data/screen_test/settings/align/box_center.frame +1 -1
  81. data/screen_test/settings/align/box_center.rb +1 -1
  82. data/screen_test/settings/align/box_default.frame +1 -1
  83. data/screen_test/settings/align/box_default.rb +1 -1
  84. data/screen_test/settings/align/box_evenly.frame +1 -1
  85. data/screen_test/settings/align/box_evenly.rb +1 -1
  86. data/screen_test/settings/align/box_left.frame +1 -1
  87. data/screen_test/settings/align/box_left.rb +1 -1
  88. data/screen_test/settings/align/box_right.frame +1 -1
  89. data/screen_test/settings/align/box_right.rb +1 -1
  90. data/screen_test/settings/align/children_center.frame +1 -1
  91. data/screen_test/settings/align/children_center.rb +1 -1
  92. data/screen_test/settings/align/children_left.frame +1 -1
  93. data/screen_test/settings/align/children_left.rb +1 -1
  94. data/screen_test/settings/align/children_right.frame +1 -1
  95. data/screen_test/settings/align/children_right.rb +1 -1
  96. data/screen_test/settings/align/grid_center.frame +1 -1
  97. data/screen_test/settings/align/grid_center.rb +1 -1
  98. data/screen_test/settings/align/grid_default.frame +1 -1
  99. data/screen_test/settings/align/grid_default.rb +1 -1
  100. data/screen_test/settings/align/grid_left.frame +1 -1
  101. data/screen_test/settings/align/grid_left.rb +1 -1
  102. data/screen_test/settings/align/grid_right.frame +1 -1
  103. data/screen_test/settings/align/grid_right.rb +1 -1
  104. data/screen_test/settings/ansi/bold.frame +1 -1
  105. data/screen_test/settings/ansi/bold.rb +1 -1
  106. data/screen_test/settings/ansi/color.frame +1 -1
  107. data/screen_test/settings/ansi/color.rb +1 -1
  108. data/screen_test/settings/ansi/underline.frame +1 -1
  109. data/screen_test/settings/ansi/underline.rb +1 -1
  110. data/screen_test/settings/border.frame +1 -1
  111. data/screen_test/settings/border.rb +1 -1
  112. data/screen_test/settings/flow/box_b2t.frame +1 -1
  113. data/screen_test/settings/flow/box_b2t.rb +1 -1
  114. data/screen_test/settings/flow/box_l2r.frame +1 -1
  115. data/screen_test/settings/flow/box_l2r.rb +1 -1
  116. data/screen_test/settings/flow/box_r2l.frame +1 -1
  117. data/screen_test/settings/flow/box_r2l.rb +1 -1
  118. data/screen_test/settings/flow/box_t2b.frame +1 -1
  119. data/screen_test/settings/flow/box_t2b.rb +1 -1
  120. data/screen_test/settings/flow/grid_b2t.frame +1 -1
  121. data/screen_test/settings/flow/grid_b2t.rb +2 -2
  122. data/screen_test/settings/flow/grid_l2r.frame +1 -1
  123. data/screen_test/settings/flow/grid_l2r.rb +2 -2
  124. data/screen_test/settings/flow/grid_r2l.frame +1 -1
  125. data/screen_test/settings/flow/grid_r2l.rb +2 -2
  126. data/screen_test/settings/flow/grid_t2b.frame +1 -1
  127. data/screen_test/settings/flow/grid_t2b.rb +2 -2
  128. data/screen_test/settings/height/box.frame +1 -1
  129. data/screen_test/settings/height/box.rb +1 -1
  130. data/screen_test/settings/height/box_border_sizing.frame +1 -1
  131. data/screen_test/settings/height/box_border_sizing.rb +1 -1
  132. data/screen_test/settings/height/grid.frame +1 -1
  133. data/screen_test/settings/height/grid.rb +1 -1
  134. data/screen_test/settings/height/overflow_box.frame +1 -1
  135. data/screen_test/settings/height/overflow_box.rb +1 -1
  136. data/screen_test/settings/height/overflow_box_l2r.frame +1 -1
  137. data/screen_test/settings/height/overflow_box_l2r.rb +1 -1
  138. data/screen_test/settings/height/overflow_box_t2b.frame +1 -1
  139. data/screen_test/settings/height/overflow_box_t2b.rb +1 -1
  140. data/screen_test/settings/height/overflow_grid.frame +1 -1
  141. data/screen_test/settings/height/overflow_grid.rb +1 -1
  142. data/screen_test/settings/margin.frame +1 -1
  143. data/screen_test/settings/margin.rb +1 -1
  144. data/screen_test/settings/padding.frame +1 -1
  145. data/screen_test/settings/padding.rb +1 -1
  146. data/screen_test/settings/position/box_left.frame +1 -1
  147. data/screen_test/settings/position/box_left.rb +1 -1
  148. data/screen_test/settings/position/box_left_negative.frame +1 -1
  149. data/screen_test/settings/position/box_left_negative.rb +1 -1
  150. data/screen_test/settings/position/box_top.frame +1 -1
  151. data/screen_test/settings/position/box_top.rb +1 -1
  152. data/screen_test/settings/position/box_top_negative.frame +1 -1
  153. data/screen_test/settings/position/box_top_negative.rb +1 -1
  154. data/screen_test/settings/position/grid_left.frame +1 -1
  155. data/screen_test/settings/position/grid_left.rb +1 -1
  156. data/screen_test/settings/position/grid_left_negative.frame +1 -1
  157. data/screen_test/settings/position/grid_left_negative.rb +1 -1
  158. data/screen_test/settings/position/grid_top.frame +1 -1
  159. data/screen_test/settings/position/grid_top.rb +1 -1
  160. data/screen_test/settings/position/grid_top_negative.frame +1 -1
  161. data/screen_test/settings/position/grid_top_negative.rb +1 -1
  162. data/screen_test/settings/scroll/horiz_box.frame +1 -1
  163. data/screen_test/settings/scroll/horiz_box.rb +1 -1
  164. data/screen_test/settings/scroll/horiz_box_align_center.rb +1 -1
  165. data/screen_test/settings/scroll/horiz_box_align_right.rb +1 -1
  166. data/screen_test/settings/scroll/vert_box.frame +1 -1
  167. data/screen_test/settings/scroll/vert_box.rb +1 -1
  168. data/screen_test/settings/title_font.frame +1 -1
  169. data/screen_test/settings/title_font.rb +1 -1
  170. data/screen_test/settings/valign/box_around.frame +1 -1
  171. data/screen_test/settings/valign/box_around.rb +1 -1
  172. data/screen_test/settings/valign/box_between.frame +1 -1
  173. data/screen_test/settings/valign/box_between.rb +1 -1
  174. data/screen_test/settings/valign/box_bottom.frame +1 -1
  175. data/screen_test/settings/valign/box_bottom.rb +1 -1
  176. data/screen_test/settings/valign/box_default.frame +1 -1
  177. data/screen_test/settings/valign/box_default.rb +1 -1
  178. data/screen_test/settings/valign/box_evenly.frame +1 -1
  179. data/screen_test/settings/valign/box_evenly.rb +1 -1
  180. data/screen_test/settings/valign/box_middle.frame +1 -1
  181. data/screen_test/settings/valign/box_middle.rb +1 -1
  182. data/screen_test/settings/valign/box_top.frame +1 -1
  183. data/screen_test/settings/valign/box_top.rb +1 -1
  184. data/screen_test/settings/valign/grid_bottom.frame +1 -1
  185. data/screen_test/settings/valign/grid_bottom.rb +1 -1
  186. data/screen_test/settings/valign/grid_default.frame +1 -1
  187. data/screen_test/settings/valign/grid_default.rb +1 -1
  188. data/screen_test/settings/valign/grid_middle.frame +1 -1
  189. data/screen_test/settings/valign/grid_middle.rb +1 -1
  190. data/screen_test/settings/valign/grid_top.frame +1 -1
  191. data/screen_test/settings/valign/grid_top.rb +1 -1
  192. data/screen_test/settings/width/box_border_sizing.frame +1 -1
  193. data/screen_test/settings/width/box_border_sizing.rb +1 -1
  194. data/screen_test/settings/width/box_content.frame +1 -1
  195. data/screen_test/settings/width/box_content.rb +1 -1
  196. data/screen_test/settings/width/box_default.frame +1 -1
  197. data/screen_test/settings/width/box_default.rb +1 -1
  198. data/screen_test/settings/width/grid.frame +1 -1
  199. data/screen_test/settings/width/grid.rb +1 -1
  200. data/screen_test/settings/width/overflow_align_center.frame +1 -1
  201. data/screen_test/settings/width/overflow_align_center.rb +1 -1
  202. data/screen_test/settings/width/overflow_align_right.frame +1 -1
  203. data/screen_test/settings/width/overflow_align_right.rb +1 -1
  204. data/screen_test/settings/width/overflow_box.frame +1 -1
  205. data/screen_test/settings/width/overflow_box.rb +1 -1
  206. data/screen_test/settings/width/overflow_box_l2r.frame +1 -1
  207. data/screen_test/settings/width/overflow_box_l2r.rb +1 -1
  208. data/screen_test/settings/width/overflow_box_t2b.frame +1 -1
  209. data/screen_test/settings/width/overflow_box_t2b.rb +1 -1
  210. data/screen_test/settings/width/overflow_grid.frame +1 -1
  211. data/screen_test/settings/width/overflow_grid.rb +1 -1
  212. data/tools/whirled_peas/tools/screen_tester.rb +131 -65
  213. metadata +42 -9
  214. data/lib/whirled_peas/frame.rb +0 -6
  215. data/lib/whirled_peas/frame/consumer.rb +0 -30
  216. data/lib/whirled_peas/frame/debug_consumer.rb +0 -30
  217. data/lib/whirled_peas/frame/event_loop.rb +0 -90
  218. data/lib/whirled_peas/frame/producer.rb +0 -67
  219. data/lib/whirled_peas/graphics/screen.rb +0 -70
  220. data/lib/whirled_peas/graphics/text_dimensions.rb +0 -15
@@ -2,12 +2,12 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_grid do |_, settings|
7
7
  settings.flow = :b2t
8
8
  settings.full_border
9
9
  settings.num_cols = 4
10
- 14.times.map { |i| i + 1 }
10
+ 10.times.map { |i| i + 1 }
11
11
  end
12
12
  end
13
13
  end
@@ -1 +1 @@
1
- [?25l┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛1234567891011121314[?25h
1
+ [?25l                        ┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛12345678910[?25h
@@ -2,12 +2,12 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  composer.add_grid do |_, settings|
7
7
  settings.flow = :l2r
8
8
  settings.full_border
9
9
  settings.num_cols = 4
10
- 14.times.map { |i| i + 1 }
10
+ 10.times.map { |i| i + 1 }
11
11
  end
12
12
  end
13
13
  end
@@ -1 +1 @@
1
- [?25l┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛1234567891011121314[?25h
1
+ [?25l                        ┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛12345678910[?25h
@@ -2,12 +2,12 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  composer.add_grid do |_, settings|
7
7
  settings.flow = :r2l
8
8
  settings.full_border
9
9
  settings.num_cols = 4
10
- 14.times.map { |i| i + 1 }
10
+ 10.times.map { |i| i + 1 }
11
11
  end
12
12
  end
13
13
  end
@@ -1 +1 @@
1
- [?25l┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛1234567891011121314[?25h
1
+ [?25l                        ┏━━┳━━┳━━┳━━┓┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┣━━╋━━╋━━╋━━┫┃ ┃ ┃ ┃ ┃┗━━┻━━┻━━┻━━┛12345678910[?25h
@@ -2,12 +2,12 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  composer.add_grid do |_, settings|
7
7
  settings.flow = :t2b
8
8
  settings.full_border
9
9
  settings.num_cols = 4
10
- 14.times.map { |i| i + 1 }
10
+ 10.times.map { |i| i + 1 }
11
11
  end
12
12
  end
13
13
  end
@@ -1 +1 @@
1
- [?25l┏━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━┛MultiLine[?25h
1
+ [?25l                        ┏━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━┛MultiLine[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box('Tall') do |_, settings|
7
7
  settings.full_border
8
8
  settings.height = 5
@@ -1 +1 @@
1
- [?25l┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛1122[?25h
1
+ [?25l                        ┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛1122[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box('Wide') do |_, settings|
7
7
  settings.full_border
8
8
  settings.padding.vert = 1
@@ -1 +1 @@
1
- [?25l┏━┳━┳━┳━┓┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┣━╋━╋━╋━┫┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┣━╋━╋━╋━┫┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┗━┻━┻━┻━┛0123456789[?25h
1
+ [?25l                        ┏━┳━┳━┳━┓┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┣━╋━╋━╋━┫┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┣━╋━╋━╋━┫┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┃ ┃ ┃ ┃ ┃┗━┻━┻━┻━┛0123456789[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_grid('Tall') do |_, settings|
7
7
  settings.full_border
8
8
  settings.num_cols = 4
@@ -1 +1 @@
1
- [?25l┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛XOXOXOXOXO[?25h
1
+ [?25l                        ┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛XOXOXOXOXO[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |_, settings|
7
7
  settings.full_border
8
8
  settings.height = 5
@@ -1 +1 @@
1
- [?25l┏━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━┛012340123401234[?25h
1
+ [?25l                        ┏━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━┛012340123401234[?25h
@@ -4,7 +4,7 @@ class TemplateFactory
4
4
  TALL_STRING = 10.times.map(&:to_s).join("\n")
5
5
 
6
6
  def build(*)
7
- WhirledPeas.template do |composer|
7
+ WhirledPeas.template(:test) do |composer|
8
8
  composer.add_box do |composer, settings|
9
9
  settings.full_border
10
10
  settings.height = 5
@@ -1 +1 @@
1
- [?25l┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛XOXOXOXOXO[?25h
1
+ [?25l                        ┏━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━┛XOXOXOXOXO[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |composer, settings|
7
7
  settings.flow = :t2b
8
8
  settings.height = 5
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛01234[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛01234[?25h
@@ -4,7 +4,7 @@ class TemplateFactory
4
4
  TALL_STRING = 10.times.map(&:to_s).join("\n")
5
5
 
6
6
  def build(*)
7
- WhirledPeas.template do |composer|
7
+ WhirledPeas.template(:test) do |composer|
8
8
  composer.add_grid('TallGrid') do |composer, settings|
9
9
  settings.full_border
10
10
  settings.height = 5
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━┛┏━━━━━━━━━┓┃ ┃┗━━━━━━━━━┛Inner Box[?25h
1
+ [?25l                        ┏━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━┛┏━━━━━━━━━┓┃ ┃┗━━━━━━━━━┛Inner Box[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |composer, settings|
7
7
  settings.full_border
8
8
  composer.add_box do |_, settings|
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━┛Padded Room[?25h
1
+ [?25l                        ┏━━━━━━━━━━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━━━━━━━━━━┛Padded Room[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |_, settings|
7
7
  settings.full_border
8
8
  settings.set_padding(left: 5, top: 2, right: 3, bottom: 1)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━┃ ┃ ┃ ┃ ┃ ┗━━━123223333443543[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━┃ ┃ ┃ ┃ ┃ ┗━━━123223333443543[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛━━━┓ ┃ ┃ ┃ ┃ ┃━━━┛345344333322321[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛━━━┓ ┃ ┃ ┃ ┃ ┃━━━┛345344333322321[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━━━┓┃ ┃┃ ┃┃ ┃123452234433333[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━━━┓┃ ┃┃ ┃┃ ┃123452234433333[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┃ ┃┃ ┃┃ ┃┗━━━━━┛333334432254321[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┃ ┃┃ ┃┃ ┃┗━━━━━┛333334432254321[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━┃ ┣━━━┃ ┣━━━┃ ┣━━━┃ ┣━━━┃ ┗━━━123223333443543[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━┃ ┣━━━┃ ┣━━━┃ ┣━━━┃ ┣━━━┃ ┗━━━123223333443543[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛━━━┓ ┃━━━┫ ┃━━━┫ ┃━━━┫ ┃━━━┫ ┃━━━┛345344333322321[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛━━━┓ ┃━━━┫ ┃━━━┫ ┃━━━┫ ┃━━━┫ ┃━━━┛345344333322321[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━━━┓┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃12345223443333344322[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┏━━━━━┓┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃12345223443333344322[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┗━━━━━┛22344333334432254321[?25h
1
+ [?25l                        ┏━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━┛┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┣━━━━━┫┃ ┃┗━━━━━┛22344333334432254321[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer, settings|
5
+ WhirledPeas.template(:test) do |composer, settings|
6
6
  settings.set_padding(left: 5, top: 5)
7
7
  composer.add_box do |composer, settings|
8
8
  settings.full_border(color: :green)
@@ -1 +1 @@
1
- [?25l┏━━━━━┓┃ ┃┃▗▖ ┃┗━━━━━┛EFGHI[?25h
1
+ [?25l                        ┏━━━━━┓┃ ┃┃▗▖ ┃┗━━━━━┛ EFGHI[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box('Outer') do |composer, settings|
7
7
  settings.full_border
8
8
  settings.scrollbar.horiz = true
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box('Outer') do |composer, settings|
7
7
  settings.full_border
8
8
  settings.align = :center
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box('Outer') do |composer, settings|
7
7
  settings.full_border
8
8
  settings.align = :right
@@ -1 +1 @@
1
- [?25l┏━━┓┃ ▗┃┃ ▝┃┃ ┃┃ ┃┃ ┃┗━━┛EFGHI[?25h
1
+ [?25l                        ┏━━┓┃ ▗┃┃ ▝┃┃ ┃┃ ┃┃ ┃┗━━┛     EFGHI[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box('Outer') do |composer, settings|
7
7
  settings.full_border
8
8
  settings.scrollbar.vert = true
@@ -1 +1 @@
1
- [?25l██╗ ██╗██╗██╗██║ ██║██║██║███████║██║██║██╔══██║██║╚═╝██║ ██║██║██╗╚═╝ ╚═╝╚═╝╚═╝[?25h
1
+ [?25l                        ██╗ ██╗██╗██╗██║ ██║██║██║███████║██║██║██╔══██║██║╚═╝██║ ██║██║██╗╚═╝ ╚═╝╚═╝╚═╝[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_text('Title') do |_, settings|
7
7
  settings.title_font = :default
8
8
  "Hi!"
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |composer, settings|
7
7
  settings.flow = :t2b
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |composer, settings|
7
7
  settings.flow = :t2b
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |composer, settings|
7
7
  settings.flow = :t2b
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |composer, settings|
7
7
  settings.flow = :t2b
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
@@ -2,7 +2,7 @@ require 'whirled_peas'
2
2
 
3
3
  class TemplateFactory
4
4
  def build(*)
5
- WhirledPeas.template do |composer|
5
+ WhirledPeas.template(:test) do |composer|
6
6
  composer.add_box do |composer, settings|
7
7
  settings.flow = :t2b
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━┛ABC[?25h