whirled_peas 0.9.1 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (172) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +4 -0
  3. data/README.md +65 -20
  4. data/lib/data/themes.yaml +13 -0
  5. data/lib/whirled_peas.rb +10 -2
  6. data/lib/whirled_peas/command/config_command.rb +1 -2
  7. data/lib/whirled_peas/command/play.rb +3 -0
  8. data/lib/whirled_peas/command/themes.rb +76 -0
  9. data/lib/whirled_peas/command_line.rb +3 -1
  10. data/lib/whirled_peas/graphics/composer.rb +5 -2
  11. data/lib/whirled_peas/settings/border.rb +25 -4
  12. data/lib/whirled_peas/settings/container_settings.rb +2 -2
  13. data/lib/whirled_peas/settings/element_settings.rb +8 -4
  14. data/lib/whirled_peas/settings/graph_settings.rb +1 -1
  15. data/lib/whirled_peas/settings/text_settings.rb +1 -0
  16. data/lib/whirled_peas/settings/theme.rb +40 -0
  17. data/lib/whirled_peas/settings/theme_library.rb +63 -0
  18. data/lib/whirled_peas/version.rb +1 -1
  19. data/screen_test/elements/box.frame +1 -1
  20. data/screen_test/elements/box.rb +1 -1
  21. data/screen_test/elements/graph.frame +1 -1
  22. data/screen_test/elements/graph.rb +1 -1
  23. data/screen_test/elements/grid.frame +1 -1
  24. data/screen_test/elements/grid.rb +1 -1
  25. data/screen_test/elements/screen_overflow_x.frame +1 -1
  26. data/screen_test/elements/screen_overflow_x.rb +1 -1
  27. data/screen_test/elements/screen_overflow_y.frame +1 -1
  28. data/screen_test/elements/screen_overflow_y.rb +1 -1
  29. data/screen_test/elements/text.frame +1 -1
  30. data/screen_test/elements/text.rb +1 -1
  31. data/screen_test/elements/text_multiline.frame +1 -1
  32. data/screen_test/elements/text_multiline.rb +1 -1
  33. data/screen_test/elements/theme.frame +1 -0
  34. data/screen_test/elements/theme.rb +26 -0
  35. data/screen_test/settings/align/box_around.frame +1 -1
  36. data/screen_test/settings/align/box_around.rb +1 -1
  37. data/screen_test/settings/align/box_between.frame +1 -1
  38. data/screen_test/settings/align/box_between.rb +1 -1
  39. data/screen_test/settings/align/box_center.frame +1 -1
  40. data/screen_test/settings/align/box_center.rb +1 -1
  41. data/screen_test/settings/align/box_default.frame +1 -1
  42. data/screen_test/settings/align/box_default.rb +1 -1
  43. data/screen_test/settings/align/box_evenly.frame +1 -1
  44. data/screen_test/settings/align/box_evenly.rb +1 -1
  45. data/screen_test/settings/align/box_left.frame +1 -1
  46. data/screen_test/settings/align/box_left.rb +1 -1
  47. data/screen_test/settings/align/box_right.frame +1 -1
  48. data/screen_test/settings/align/box_right.rb +1 -1
  49. data/screen_test/settings/align/children_center.frame +1 -1
  50. data/screen_test/settings/align/children_center.rb +1 -1
  51. data/screen_test/settings/align/children_left.frame +1 -1
  52. data/screen_test/settings/align/children_left.rb +1 -1
  53. data/screen_test/settings/align/children_right.frame +1 -1
  54. data/screen_test/settings/align/children_right.rb +1 -1
  55. data/screen_test/settings/align/grid_center.frame +1 -1
  56. data/screen_test/settings/align/grid_center.rb +1 -1
  57. data/screen_test/settings/align/grid_default.frame +1 -1
  58. data/screen_test/settings/align/grid_default.rb +1 -1
  59. data/screen_test/settings/align/grid_left.frame +1 -1
  60. data/screen_test/settings/align/grid_left.rb +1 -1
  61. data/screen_test/settings/align/grid_right.frame +1 -1
  62. data/screen_test/settings/align/grid_right.rb +1 -1
  63. data/screen_test/settings/ansi/bold.frame +1 -1
  64. data/screen_test/settings/ansi/bold.rb +1 -1
  65. data/screen_test/settings/ansi/color.frame +1 -1
  66. data/screen_test/settings/ansi/color.rb +1 -1
  67. data/screen_test/settings/ansi/underline.frame +1 -1
  68. data/screen_test/settings/ansi/underline.rb +1 -1
  69. data/screen_test/settings/border.frame +1 -1
  70. data/screen_test/settings/border.rb +1 -1
  71. data/screen_test/settings/flow/box_b2t.frame +1 -1
  72. data/screen_test/settings/flow/box_b2t.rb +1 -1
  73. data/screen_test/settings/flow/box_l2r.frame +1 -1
  74. data/screen_test/settings/flow/box_l2r.rb +1 -1
  75. data/screen_test/settings/flow/box_r2l.frame +1 -1
  76. data/screen_test/settings/flow/box_r2l.rb +1 -1
  77. data/screen_test/settings/flow/box_t2b.frame +1 -1
  78. data/screen_test/settings/flow/box_t2b.rb +1 -1
  79. data/screen_test/settings/flow/grid_b2t.frame +1 -1
  80. data/screen_test/settings/flow/grid_b2t.rb +1 -1
  81. data/screen_test/settings/flow/grid_l2r.frame +1 -1
  82. data/screen_test/settings/flow/grid_l2r.rb +1 -1
  83. data/screen_test/settings/flow/grid_r2l.frame +1 -1
  84. data/screen_test/settings/flow/grid_r2l.rb +1 -1
  85. data/screen_test/settings/flow/grid_t2b.frame +1 -1
  86. data/screen_test/settings/flow/grid_t2b.rb +1 -1
  87. data/screen_test/settings/height/box.frame +1 -1
  88. data/screen_test/settings/height/box.rb +1 -1
  89. data/screen_test/settings/height/box_border_sizing.frame +1 -1
  90. data/screen_test/settings/height/box_border_sizing.rb +1 -1
  91. data/screen_test/settings/height/grid.frame +1 -1
  92. data/screen_test/settings/height/grid.rb +1 -1
  93. data/screen_test/settings/height/overflow_box.frame +1 -1
  94. data/screen_test/settings/height/overflow_box.rb +1 -1
  95. data/screen_test/settings/height/overflow_box_l2r.frame +1 -1
  96. data/screen_test/settings/height/overflow_box_l2r.rb +1 -1
  97. data/screen_test/settings/height/overflow_box_t2b.frame +1 -1
  98. data/screen_test/settings/height/overflow_box_t2b.rb +1 -1
  99. data/screen_test/settings/height/overflow_grid.frame +1 -1
  100. data/screen_test/settings/height/overflow_grid.rb +1 -1
  101. data/screen_test/settings/margin.frame +1 -1
  102. data/screen_test/settings/margin.rb +1 -1
  103. data/screen_test/settings/padding.frame +1 -1
  104. data/screen_test/settings/padding.rb +1 -1
  105. data/screen_test/settings/position/box_left.frame +1 -1
  106. data/screen_test/settings/position/box_left.rb +1 -1
  107. data/screen_test/settings/position/box_left_negative.frame +1 -1
  108. data/screen_test/settings/position/box_left_negative.rb +1 -1
  109. data/screen_test/settings/position/box_top.frame +1 -1
  110. data/screen_test/settings/position/box_top.rb +1 -1
  111. data/screen_test/settings/position/box_top_negative.frame +1 -1
  112. data/screen_test/settings/position/box_top_negative.rb +1 -1
  113. data/screen_test/settings/position/grid_left.frame +1 -1
  114. data/screen_test/settings/position/grid_left.rb +1 -1
  115. data/screen_test/settings/position/grid_left_negative.frame +1 -1
  116. data/screen_test/settings/position/grid_left_negative.rb +1 -1
  117. data/screen_test/settings/position/grid_top.frame +1 -1
  118. data/screen_test/settings/position/grid_top.rb +1 -1
  119. data/screen_test/settings/position/grid_top_negative.frame +1 -1
  120. data/screen_test/settings/position/grid_top_negative.rb +1 -1
  121. data/screen_test/settings/scroll/horiz_box.frame +1 -1
  122. data/screen_test/settings/scroll/horiz_box.rb +1 -1
  123. data/screen_test/settings/scroll/horiz_box_align_center.rb +1 -1
  124. data/screen_test/settings/scroll/horiz_box_align_right.rb +1 -1
  125. data/screen_test/settings/scroll/vert_box.frame +1 -1
  126. data/screen_test/settings/scroll/vert_box.rb +1 -1
  127. data/screen_test/settings/title_font.frame +1 -1
  128. data/screen_test/settings/title_font.rb +1 -1
  129. data/screen_test/settings/valign/box_around.frame +1 -1
  130. data/screen_test/settings/valign/box_around.rb +1 -1
  131. data/screen_test/settings/valign/box_between.frame +1 -1
  132. data/screen_test/settings/valign/box_between.rb +1 -1
  133. data/screen_test/settings/valign/box_bottom.frame +1 -1
  134. data/screen_test/settings/valign/box_bottom.rb +1 -1
  135. data/screen_test/settings/valign/box_default.frame +1 -1
  136. data/screen_test/settings/valign/box_default.rb +1 -1
  137. data/screen_test/settings/valign/box_evenly.frame +1 -1
  138. data/screen_test/settings/valign/box_evenly.rb +1 -1
  139. data/screen_test/settings/valign/box_middle.frame +1 -1
  140. data/screen_test/settings/valign/box_middle.rb +1 -1
  141. data/screen_test/settings/valign/box_top.frame +1 -1
  142. data/screen_test/settings/valign/box_top.rb +1 -1
  143. data/screen_test/settings/valign/grid_bottom.frame +1 -1
  144. data/screen_test/settings/valign/grid_bottom.rb +1 -1
  145. data/screen_test/settings/valign/grid_default.frame +1 -1
  146. data/screen_test/settings/valign/grid_default.rb +1 -1
  147. data/screen_test/settings/valign/grid_middle.frame +1 -1
  148. data/screen_test/settings/valign/grid_middle.rb +1 -1
  149. data/screen_test/settings/valign/grid_top.frame +1 -1
  150. data/screen_test/settings/valign/grid_top.rb +1 -1
  151. data/screen_test/settings/width/box_border_sizing.frame +1 -1
  152. data/screen_test/settings/width/box_border_sizing.rb +1 -1
  153. data/screen_test/settings/width/box_content.frame +1 -1
  154. data/screen_test/settings/width/box_content.rb +1 -1
  155. data/screen_test/settings/width/box_default.frame +1 -1
  156. data/screen_test/settings/width/box_default.rb +1 -1
  157. data/screen_test/settings/width/grid.frame +1 -1
  158. data/screen_test/settings/width/grid.rb +1 -1
  159. data/screen_test/settings/width/overflow_align_center.frame +1 -1
  160. data/screen_test/settings/width/overflow_align_center.rb +1 -1
  161. data/screen_test/settings/width/overflow_align_right.frame +1 -1
  162. data/screen_test/settings/width/overflow_align_right.rb +1 -1
  163. data/screen_test/settings/width/overflow_box.frame +1 -1
  164. data/screen_test/settings/width/overflow_box.rb +1 -1
  165. data/screen_test/settings/width/overflow_box_l2r.frame +1 -1
  166. data/screen_test/settings/width/overflow_box_l2r.rb +1 -1
  167. data/screen_test/settings/width/overflow_box_t2b.frame +1 -1
  168. data/screen_test/settings/width/overflow_box_t2b.rb +1 -1
  169. data/screen_test/settings/width/overflow_grid.frame +1 -1
  170. data/screen_test/settings/width/overflow_grid.rb +1 -1
  171. data/tools/whirled_peas/tools/screen_tester.rb +15 -1
  172. metadata +8 -2
@@ -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
@@ -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┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?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('Alignment') do |composer, settings|
7
7
  settings.num_cols = 1
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?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('Alignment') do |composer, settings|
7
7
  settings.num_cols = 1
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?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('Alignment') do |composer, settings|
7
7
  settings.num_cols = 1
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?25h
1
+ [?25l                        ┏━┓┃ ┃┃ ┃┃ ┃┗━┛A[?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('Alignment') do |composer, settings|
7
7
  settings.num_cols = 1
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━┛15/bor[?25h
1
+ [?25l                        ┏━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━┛15/bor[?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.set_padding(left: 3, right: 4)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━┛15/content[?25h
1
+ [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━┛15/content[?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.set_padding(left: 3, right: 4)
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━┛15/default[?25h
1
+ [?25l                        ┏━━━━━━━━━━━━━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━━━━━━━━━━━━━┛15/default[?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.set_padding(left: 3, right: 4)
@@ -1 +1 @@
1
- [?25l┏━━━━━━┳━━━━━━┓┃ ┃ ┃┣━━━━━━╋━━━━━━┫┃ ┃ ┃┣━━━━━━╋━━━━━━┫┃ ┃ ┃┗━━━━━━┻━━━━━━┛666666[?25h
1
+ [?25l                        ┏━━━━━━┳━━━━━━┓┃ ┃ ┃┣━━━━━━╋━━━━━━┫┃ ┃ ┃┣━━━━━━╋━━━━━━┫┃ ┃ ┃┗━━━━━━┻━━━━━━┛666666[?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('Wide') do |_, settings|
7
7
  settings.full_border
8
8
  settings.width = 6
@@ -1 +1 @@
1
- [?25l┏━━━┓┃ ┃┗━━━┛345[?25h
1
+ [?25l                        ┏━━━┓┃ ┃┗━━━┛345[?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('Container') do |composer, settings|
7
7
  settings.width = 3
8
8
  settings.align = :center
@@ -1 +1 @@
1
- [?25l┏━━━┓┃ ┃┗━━━┛456[?25h
1
+ [?25l                        ┏━━━┓┃ ┃┗━━━┛456[?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.width = 3
8
8
  settings.align = :right
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛ABCDEFGHIJ[?25h
1
+ [?25l                        ┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛ABCDEFGHIJ[?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.width = 10
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛0|0|1|0|1|[?25h
1
+ [?25l                        ┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛0|0|1|0|1|[?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.width = 10
8
8
  settings.full_border
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━┛XOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXO[?25h
1
+ [?25l                        ┏━━━━━━━━━━┓┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┃ ┃┗━━━━━━━━━━┛XOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXOXO[?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.width = 10
8
8
  settings.flow = :t2b
@@ -1 +1 @@
1
- [?25l┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛ABCDEFGHIJ[?25h
1
+ [?25l                        ┏━━━━━━━━━━┓┃ ┃┗━━━━━━━━━━┛ABCDEFGHIJ[?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
  composer.add_grid('grid') do |_, settings|
7
7
  settings.width = 10
8
8
  settings.full_border
@@ -6,6 +6,8 @@ require 'whirled_peas/device/screen'
6
6
  require 'whirled_peas/graphics/debugger'
7
7
  require 'whirled_peas/graphics/renderer'
8
8
  require 'whirled_peas/settings/text_color'
9
+ require 'whirled_peas/settings/theme'
10
+ require 'whirled_peas/settings/theme_library'
9
11
  require 'whirled_peas/utils/ansi'
10
12
  require 'whirled_peas/utils/formatted_string'
11
13
 
@@ -47,6 +49,17 @@ module WhirledPeas
47
49
  Dir.glob(File.join(base_dir, SCREEN_TEST_DIR, '**', '*.rb'))
48
50
  end
49
51
 
52
+ def self.define_test_theme
53
+ return if @defined_theme_library
54
+ theme = Settings::Theme.new
55
+ theme.color = :bright_white
56
+ theme.bg_color = :black
57
+ theme.border_color = :bright_white
58
+ theme.axis_color = :bright_white
59
+ Settings::ThemeLibrary.add(:test, theme)
60
+ @defined_theme_library = true
61
+ end
62
+
50
63
  # Run all screen tests that exist in the screen test directory
51
64
  def self.run_all
52
65
  failures = {}
@@ -112,7 +125,7 @@ module WhirledPeas
112
125
  when 'q'
113
126
  exit
114
127
  when 'n'
115
- return
128
+ next
116
129
  end
117
130
  tester.ask_pending
118
131
  num_attempted += 1
@@ -263,6 +276,7 @@ module WhirledPeas
263
276
  end
264
277
 
265
278
  def with_template_factory(&block)
279
+ self.class.define_test_theme
266
280
  require full_test_file
267
281
  raise 'TemplateFactory must be defined' unless defined?(TemplateFactory)
268
282
  yield TemplateFactory.new
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.9.1
4
+ version: 0.10.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-29 00:00:00.000000000 Z
11
+ date: 2021-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline
@@ -78,6 +78,7 @@ files:
78
78
  - examples/intro.rb
79
79
  - examples/scrolling.rb
80
80
  - exe/whirled_peas
81
+ - lib/data/themes.yaml
81
82
  - lib/whirled_peas.rb
82
83
  - lib/whirled_peas/animator.rb
83
84
  - lib/whirled_peas/animator/debug_consumer.rb
@@ -97,6 +98,7 @@ files:
97
98
  - lib/whirled_peas/command/play.rb
98
99
  - lib/whirled_peas/command/record.rb
99
100
  - lib/whirled_peas/command/still.rb
101
+ - lib/whirled_peas/command/themes.rb
100
102
  - lib/whirled_peas/command_line.rb
101
103
  - lib/whirled_peas/config.rb
102
104
  - lib/whirled_peas/device.rb
@@ -142,6 +144,8 @@ files:
142
144
  - lib/whirled_peas/settings/spacing.rb
143
145
  - lib/whirled_peas/settings/text_color.rb
144
146
  - lib/whirled_peas/settings/text_settings.rb
147
+ - lib/whirled_peas/settings/theme.rb
148
+ - lib/whirled_peas/settings/theme_library.rb
145
149
  - lib/whirled_peas/settings/vert_alignment.rb
146
150
  - lib/whirled_peas/utils.rb
147
151
  - lib/whirled_peas/utils/ansi.rb
@@ -163,6 +167,8 @@ files:
163
167
  - screen_test/elements/text.rb
164
168
  - screen_test/elements/text_multiline.frame
165
169
  - screen_test/elements/text_multiline.rb
170
+ - screen_test/elements/theme.frame
171
+ - screen_test/elements/theme.rb
166
172
  - screen_test/settings/align/box_around.frame
167
173
  - screen_test/settings/align/box_around.rb
168
174
  - screen_test/settings/align/box_between.frame