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.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +1 -0
- data/CHANGELOG.md +31 -0
- data/README.md +748 -137
- data/Rakefile +4 -32
- data/bin/easing +33 -0
- data/bin/reset_cursor +11 -0
- data/bin/screen_test +68 -0
- data/examples/graph.rb +54 -0
- data/examples/intro.rb +52 -0
- data/examples/scrolling.rb +54 -0
- data/lib/whirled_peas.rb +4 -12
- data/lib/whirled_peas/animator.rb +5 -0
- data/lib/whirled_peas/animator/debug_consumer.rb +17 -0
- data/lib/whirled_peas/animator/easing.rb +72 -0
- data/lib/whirled_peas/animator/frame.rb +5 -0
- data/lib/whirled_peas/animator/frameset.rb +33 -0
- data/lib/whirled_peas/animator/producer.rb +35 -0
- data/lib/whirled_peas/animator/renderer_consumer.rb +31 -0
- data/lib/whirled_peas/command.rb +5 -0
- data/lib/whirled_peas/command/base.rb +86 -0
- data/lib/whirled_peas/command/config_command.rb +44 -0
- data/lib/whirled_peas/command/debug.rb +21 -0
- data/lib/whirled_peas/command/fonts.rb +22 -0
- data/lib/whirled_peas/command/frame_command.rb +34 -0
- data/lib/whirled_peas/command/frames.rb +24 -0
- data/lib/whirled_peas/command/help.rb +38 -0
- data/lib/whirled_peas/command/play.rb +108 -0
- data/lib/whirled_peas/command/record.rb +57 -0
- data/lib/whirled_peas/command/still.rb +29 -0
- data/lib/whirled_peas/command_line.rb +22 -220
- data/lib/whirled_peas/config.rb +56 -6
- data/lib/whirled_peas/device.rb +5 -0
- data/lib/whirled_peas/device/null_device.rb +8 -0
- data/lib/whirled_peas/device/output_file.rb +19 -0
- data/lib/whirled_peas/device/screen.rb +26 -0
- data/lib/whirled_peas/graphics.rb +14 -0
- data/lib/whirled_peas/graphics/box_painter.rb +48 -47
- data/lib/whirled_peas/graphics/canvas.rb +22 -11
- data/lib/whirled_peas/graphics/composer.rb +98 -0
- data/lib/whirled_peas/graphics/container_coords.rb +24 -13
- data/lib/whirled_peas/graphics/container_dimensions.rb +37 -9
- data/lib/whirled_peas/graphics/container_painter.rb +283 -36
- data/lib/whirled_peas/graphics/content_dimensions.rb +19 -0
- data/lib/whirled_peas/graphics/content_painter.rb +20 -0
- data/lib/whirled_peas/graphics/debugger.rb +10 -1
- data/lib/whirled_peas/graphics/graph_dimensions.rb +12 -0
- data/lib/whirled_peas/graphics/graph_painter.rb +95 -0
- data/lib/whirled_peas/graphics/grid_painter.rb +25 -15
- data/lib/whirled_peas/graphics/mock_screen.rb +1 -1
- data/lib/whirled_peas/graphics/painter.rb +15 -6
- data/lib/whirled_peas/graphics/renderer.rb +13 -30
- data/lib/whirled_peas/graphics/text_painter.rb +11 -13
- data/lib/whirled_peas/settings/alignment.rb +24 -0
- data/lib/whirled_peas/settings/bg_color.rb +2 -0
- data/lib/whirled_peas/settings/border.rb +16 -16
- data/lib/whirled_peas/settings/color.rb +13 -14
- data/lib/whirled_peas/settings/container_settings.rb +133 -40
- data/lib/whirled_peas/settings/debugger.rb +9 -0
- data/lib/whirled_peas/settings/display_flow.rb +13 -11
- data/lib/whirled_peas/settings/element_settings.rb +8 -3
- data/lib/whirled_peas/settings/graph_settings.rb +21 -0
- data/lib/whirled_peas/settings/grid_settings.rb +15 -0
- data/lib/whirled_peas/settings/scrollbar.rb +15 -0
- data/lib/whirled_peas/settings/sizing.rb +19 -0
- data/lib/whirled_peas/settings/spacing.rb +34 -0
- data/lib/whirled_peas/settings/text_color.rb +2 -0
- data/lib/whirled_peas/settings/vert_alignment.rb +24 -0
- data/lib/whirled_peas/utils/ansi.rb +13 -0
- data/lib/whirled_peas/utils/file_handler.rb +57 -0
- data/lib/whirled_peas/utils/title_font.rb +1 -1
- data/lib/whirled_peas/version.rb +1 -1
- data/screen_test/{rendered/elements → elements}/box.frame +1 -1
- data/screen_test/{rendered/elements → elements}/box.rb +0 -0
- data/screen_test/elements/graph.frame +1 -0
- data/screen_test/elements/graph.rb +12 -0
- data/screen_test/elements/grid.frame +1 -0
- data/screen_test/{rendered/elements → elements}/grid.rb +0 -0
- data/screen_test/elements/screen_overflow_x.frame +1 -0
- data/screen_test/{rendered/elements/screen_overflow.rb → elements/screen_overflow_x.rb} +0 -0
- data/screen_test/elements/screen_overflow_y.frame +1 -0
- data/screen_test/elements/screen_overflow_y.rb +9 -0
- data/screen_test/elements/text.frame +1 -0
- data/screen_test/{rendered/elements → elements}/text.rb +0 -0
- data/screen_test/elements/text_multiline.frame +1 -0
- data/screen_test/{rendered/elements → elements}/text_multiline.rb +0 -0
- data/screen_test/settings/align/box_around.frame +1 -0
- data/screen_test/settings/align/box_around.rb +16 -0
- data/screen_test/settings/align/box_between.frame +1 -0
- data/screen_test/settings/align/box_between.rb +16 -0
- data/screen_test/settings/align/box_center.frame +1 -0
- data/screen_test/{rendered/settings/align/box.rb → settings/align/box_center.rb} +5 -4
- data/screen_test/settings/align/box_default.frame +1 -0
- data/screen_test/{rendered/settings/align/grid.rb → settings/align/box_default.rb} +6 -6
- data/screen_test/settings/align/box_evenly.frame +1 -0
- data/screen_test/settings/align/box_evenly.rb +16 -0
- data/screen_test/settings/align/box_left.frame +1 -0
- data/screen_test/settings/align/box_left.rb +21 -0
- data/screen_test/settings/align/box_right.frame +1 -0
- data/screen_test/settings/align/box_right.rb +21 -0
- data/screen_test/settings/align/children_center.frame +1 -0
- data/screen_test/settings/align/children_center.rb +15 -0
- data/screen_test/settings/align/children_left.frame +1 -0
- data/screen_test/settings/align/children_left.rb +15 -0
- data/screen_test/settings/align/children_right.frame +1 -0
- data/screen_test/settings/align/children_right.rb +15 -0
- data/screen_test/settings/align/grid_center.frame +1 -0
- data/screen_test/settings/align/grid_center.rb +18 -0
- data/screen_test/settings/align/grid_default.frame +1 -0
- data/screen_test/settings/align/grid_default.rb +17 -0
- data/screen_test/settings/align/grid_left.frame +1 -0
- data/screen_test/settings/align/grid_left.rb +18 -0
- data/screen_test/settings/align/grid_right.frame +1 -0
- data/screen_test/settings/align/grid_right.rb +18 -0
- data/screen_test/settings/ansi/bold.frame +1 -0
- data/screen_test/{rendered/settings/width/overflow_box_t2b.rb → settings/ansi/bold.rb} +4 -5
- data/screen_test/{rendered/settings → settings}/ansi/color.frame +1 -1
- data/screen_test/{rendered/settings → settings}/ansi/color.rb +0 -0
- data/screen_test/settings/ansi/underline.frame +1 -0
- data/screen_test/{rendered/settings → settings}/ansi/underline.rb +4 -5
- data/screen_test/{rendered/settings → settings}/border.frame +1 -1
- data/screen_test/{rendered/settings → settings}/border.rb +1 -1
- data/screen_test/settings/flow/box_b2t.frame +1 -0
- data/screen_test/settings/flow/box_b2t.rb +26 -0
- data/screen_test/settings/flow/box_l2r.frame +1 -0
- data/screen_test/settings/flow/box_l2r.rb +26 -0
- data/screen_test/settings/flow/box_r2l.frame +1 -0
- data/screen_test/settings/flow/box_r2l.rb +26 -0
- data/screen_test/settings/flow/box_t2b.frame +1 -0
- data/screen_test/settings/flow/box_t2b.rb +26 -0
- data/screen_test/settings/flow/grid_b2t.frame +1 -0
- data/screen_test/settings/flow/grid_b2t.rb +14 -0
- data/screen_test/settings/flow/grid_l2r.frame +1 -0
- data/screen_test/{rendered/settings/margin.rb → settings/flow/grid_l2r.rb} +4 -4
- data/screen_test/settings/flow/grid_r2l.frame +1 -0
- data/screen_test/settings/flow/grid_r2l.rb +14 -0
- data/screen_test/settings/flow/grid_t2b.frame +1 -0
- data/screen_test/settings/flow/grid_t2b.rb +14 -0
- data/screen_test/settings/height/box.frame +1 -0
- data/screen_test/{rendered/settings → settings}/height/box.rb +0 -0
- data/screen_test/settings/height/box_border_sizing.frame +1 -0
- data/screen_test/settings/height/box_border_sizing.rb +15 -0
- data/screen_test/settings/height/grid.frame +1 -0
- data/screen_test/{rendered/settings → settings}/height/grid.rb +0 -0
- data/screen_test/settings/height/overflow_box.frame +1 -0
- data/screen_test/settings/height/overflow_box.rb +13 -0
- data/screen_test/settings/height/overflow_box_l2r.frame +1 -0
- data/screen_test/settings/height/overflow_box_l2r.rb +17 -0
- data/screen_test/settings/height/overflow_box_t2b.frame +1 -0
- data/screen_test/settings/height/overflow_box_t2b.rb +16 -0
- data/screen_test/settings/height/overflow_grid.frame +1 -0
- data/screen_test/{rendered/settings → settings}/height/overflow_grid.rb +0 -0
- data/screen_test/settings/margin.frame +1 -0
- data/screen_test/settings/margin.rb +16 -0
- data/screen_test/settings/padding.frame +1 -0
- data/screen_test/settings/padding.rb +13 -0
- data/screen_test/settings/position/box_left.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/box_left.rb +2 -2
- data/screen_test/settings/position/box_left_negative.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/box_left_negative.rb +2 -2
- data/screen_test/settings/position/box_top.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/box_top.rb +1 -1
- data/screen_test/settings/position/box_top_negative.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/box_top_negative.rb +2 -2
- data/screen_test/settings/position/grid_left.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/grid_left.rb +1 -1
- data/screen_test/settings/position/grid_left_negative.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/grid_left_negative.rb +1 -1
- data/screen_test/settings/position/grid_top.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/grid_top.rb +1 -1
- data/screen_test/settings/position/grid_top_negative.frame +1 -0
- data/screen_test/{rendered/settings → settings}/position/grid_top_negative.rb +1 -1
- data/screen_test/settings/scroll/horiz_box.frame +1 -0
- data/screen_test/settings/scroll/horiz_box.rb +17 -0
- data/screen_test/settings/scroll/horiz_box_align_center.rb +18 -0
- data/screen_test/settings/scroll/horiz_box_align_right.rb +18 -0
- data/screen_test/settings/scroll/vert_box.frame +1 -0
- data/screen_test/settings/scroll/vert_box.rb +20 -0
- data/screen_test/settings/title_font.frame +1 -0
- data/screen_test/{rendered/settings → settings}/title_font.rb +1 -1
- data/screen_test/settings/valign/box_around.frame +1 -0
- data/screen_test/settings/valign/box_around.rb +17 -0
- data/screen_test/settings/valign/box_between.frame +1 -0
- data/screen_test/settings/valign/box_between.rb +17 -0
- data/screen_test/settings/valign/box_bottom.frame +1 -0
- data/screen_test/settings/valign/box_bottom.rb +17 -0
- data/screen_test/settings/valign/box_default.frame +1 -0
- data/screen_test/settings/valign/box_default.rb +16 -0
- data/screen_test/settings/valign/box_evenly.frame +1 -0
- data/screen_test/settings/valign/box_evenly.rb +17 -0
- data/screen_test/settings/valign/box_middle.frame +1 -0
- data/screen_test/settings/valign/box_middle.rb +17 -0
- data/screen_test/settings/valign/box_top.frame +1 -0
- data/screen_test/settings/valign/box_top.rb +17 -0
- data/screen_test/settings/valign/grid_bottom.frame +1 -0
- data/screen_test/settings/valign/grid_bottom.rb +15 -0
- data/screen_test/settings/valign/grid_default.frame +1 -0
- data/screen_test/settings/valign/grid_default.rb +14 -0
- data/screen_test/settings/valign/grid_middle.frame +1 -0
- data/screen_test/settings/valign/grid_middle.rb +15 -0
- data/screen_test/settings/valign/grid_top.frame +1 -0
- data/screen_test/settings/valign/grid_top.rb +15 -0
- data/screen_test/settings/width/box_border_sizing.frame +1 -0
- data/screen_test/settings/width/box_border_sizing.rb +15 -0
- data/screen_test/settings/width/box_content.frame +1 -0
- data/screen_test/settings/width/box_content.rb +15 -0
- data/screen_test/settings/width/box_default.frame +1 -0
- data/screen_test/{rendered/settings/width/box.rb → settings/width/box_default.rb} +3 -2
- data/screen_test/settings/width/grid.frame +1 -0
- data/screen_test/{rendered/settings → settings}/width/grid.rb +2 -2
- data/screen_test/settings/width/overflow_align_center.frame +1 -0
- data/screen_test/settings/width/overflow_align_center.rb +14 -0
- data/screen_test/settings/width/overflow_align_right.frame +1 -0
- data/screen_test/settings/width/overflow_align_right.rb +14 -0
- data/screen_test/settings/width/overflow_box.frame +1 -0
- data/screen_test/settings/width/overflow_box.rb +13 -0
- data/screen_test/settings/width/overflow_box_l2r.frame +1 -0
- data/screen_test/settings/width/overflow_box_l2r.rb +16 -0
- data/screen_test/settings/width/overflow_box_t2b.frame +1 -0
- data/screen_test/settings/width/overflow_box_t2b.rb +17 -0
- data/screen_test/settings/width/overflow_grid.frame +1 -0
- data/screen_test/{rendered/settings → settings}/width/overflow_grid.rb +0 -0
- data/tools/whirled_peas/tools/screen_tester.rb +285 -0
- metadata +192 -98
- data/bin/debug +0 -35
- data/lib/whirled_peas/debugger.rb +0 -80
- data/lib/whirled_peas/frame.rb +0 -6
- data/lib/whirled_peas/frame/consumer.rb +0 -30
- data/lib/whirled_peas/frame/debug_consumer.rb +0 -30
- data/lib/whirled_peas/frame/event_loop.rb +0 -90
- data/lib/whirled_peas/frame/producer.rb +0 -67
- data/lib/whirled_peas/graphics/screen.rb +0 -65
- data/lib/whirled_peas/graphics/text_dimensions.rb +0 -15
- data/lib/whirled_peas/settings/text_align.rb +0 -19
- data/lib/whirled_peas/template.rb +0 -5
- data/lib/whirled_peas/template/box_element.rb +0 -8
- data/lib/whirled_peas/template/composer.rb +0 -68
- data/lib/whirled_peas/template/container.rb +0 -28
- data/lib/whirled_peas/template/debugger.rb +0 -34
- data/lib/whirled_peas/template/element.rb +0 -13
- data/lib/whirled_peas/template/grid_element.rb +0 -8
- data/lib/whirled_peas/template/text_element.rb +0 -24
- data/screen_test/rendered/elements/grid.frame +0 -1
- data/screen_test/rendered/elements/text.frame +0 -1
- data/screen_test/rendered/elements/text_multiline.frame +0 -1
- data/screen_test/rendered/settings/align/box.frame +0 -1
- data/screen_test/rendered/settings/align/children_center.frame +0 -1
- data/screen_test/rendered/settings/align/children_center.rb +0 -13
- data/screen_test/rendered/settings/align/children_left.frame +0 -1
- data/screen_test/rendered/settings/align/children_left.rb +0 -13
- data/screen_test/rendered/settings/align/children_right.frame +0 -1
- data/screen_test/rendered/settings/align/children_right.rb +0 -13
- data/screen_test/rendered/settings/align/grid.frame +0 -1
- data/screen_test/rendered/settings/ansi/bold.frame +0 -1
- data/screen_test/rendered/settings/ansi/bold.rb +0 -15
- data/screen_test/rendered/settings/ansi/underline.frame +0 -1
- data/screen_test/rendered/settings/flow/l2r.frame +0 -1
- data/screen_test/rendered/settings/flow/l2r.rb +0 -24
- data/screen_test/rendered/settings/flow/t2b.frame +0 -1
- data/screen_test/rendered/settings/flow/t2b.rb +0 -24
- data/screen_test/rendered/settings/height/box.frame +0 -1
- data/screen_test/rendered/settings/height/grid.frame +0 -1
- data/screen_test/rendered/settings/height/overflow_box.frame +0 -1
- data/screen_test/rendered/settings/height/overflow_box.rb +0 -13
- data/screen_test/rendered/settings/height/overflow_box_l2r.frame +0 -1
- data/screen_test/rendered/settings/height/overflow_box_l2r.rb +0 -15
- data/screen_test/rendered/settings/height/overflow_box_t2b.frame +0 -1
- data/screen_test/rendered/settings/height/overflow_box_t2b.rb +0 -14
- data/screen_test/rendered/settings/height/overflow_grid.frame +0 -1
- data/screen_test/rendered/settings/margin.frame +0 -1
- data/screen_test/rendered/settings/padding.frame +0 -1
- data/screen_test/rendered/settings/padding.rb +0 -11
- data/screen_test/rendered/settings/position/box_left.frame +0 -1
- data/screen_test/rendered/settings/position/box_left_negative.frame +0 -1
- data/screen_test/rendered/settings/position/box_top.frame +0 -1
- data/screen_test/rendered/settings/position/box_top_negative.frame +0 -1
- data/screen_test/rendered/settings/position/grid_left.frame +0 -1
- data/screen_test/rendered/settings/position/grid_left_negative.frame +0 -1
- data/screen_test/rendered/settings/position/grid_top.frame +0 -1
- data/screen_test/rendered/settings/position/grid_top_negative.frame +0 -1
- data/screen_test/rendered/settings/title_font.frame +0 -1
- data/screen_test/rendered/settings/width/box.frame +0 -1
- data/screen_test/rendered/settings/width/grid.frame +0 -1
- data/screen_test/rendered/settings/width/overflow_box.frame +0 -1
- data/screen_test/rendered/settings/width/overflow_box.rb +0 -11
- data/screen_test/rendered/settings/width/overflow_box_l2r.frame +0 -1
- data/screen_test/rendered/settings/width/overflow_box_l2r.rb +0 -14
- data/screen_test/rendered/settings/width/overflow_box_t2b.frame +0 -1
- data/screen_test/rendered/settings/width/overflow_grid.frame +0 -1
- data/screen_test/screen_tester.rb +0 -191
@@ -1,34 +0,0 @@
|
|
1
|
-
require 'whirled_peas/settings/debugger'
|
2
|
-
|
3
|
-
require_relative 'container'
|
4
|
-
require_relative 'text_element'
|
5
|
-
|
6
|
-
module WhirledPeas
|
7
|
-
module Template
|
8
|
-
class Debugger
|
9
|
-
def initialize(element)
|
10
|
-
@element = element
|
11
|
-
end
|
12
|
-
|
13
|
-
def debug(indent='')
|
14
|
-
info = [
|
15
|
-
"#{indent}* #{element.class}(#{element.name})",
|
16
|
-
]
|
17
|
-
if element.is_a?(TextElement)
|
18
|
-
info << "#{indent + ' '}- Content: #{element.content}"
|
19
|
-
end
|
20
|
-
info << "#{indent + ' '}- Settings"
|
21
|
-
info << Settings::Debugger.new(element.settings).debug(indent + ' ')
|
22
|
-
if element.is_a?(Container)
|
23
|
-
info << "#{indent + ' '}- Children"
|
24
|
-
info += element.each_child.map { |c| Debugger.new(c).debug(indent + ' ') }
|
25
|
-
end
|
26
|
-
info.join("\n")
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
attr_reader :element
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require_relative 'element'
|
2
|
-
|
3
|
-
module WhirledPeas
|
4
|
-
module Template
|
5
|
-
class TextElement < Element
|
6
|
-
# List of classes that convert nicely to a string
|
7
|
-
STRINGALBE_CLASSES = [FalseClass, Float, Integer, NilClass, String, Symbol, TrueClass]
|
8
|
-
private_constant :STRINGALBE_CLASSES
|
9
|
-
|
10
|
-
def self.stringable?(value)
|
11
|
-
STRINGALBE_CLASSES.include?(value.class)
|
12
|
-
end
|
13
|
-
|
14
|
-
attr_reader :content
|
15
|
-
|
16
|
-
def content=(val)
|
17
|
-
unless self.class.stringable?(val)
|
18
|
-
raise ArgumentError, "Unsupported type for TextElement: #{val.class}"
|
19
|
-
end
|
20
|
-
@content = val.to_s
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━┳━━━━━━┳━━━━━━┓[0m[2;1H[37m┃ ┃ ┃ ┃[0m[3;1H[37m┣━━━━━━╋━━━━━━╋━━━━━━┫[0m[4;1H[37m┃ ┃ ┃ ┃[0m[5;1H[37m┣━━━━━━╋━━━━━━╋━━━━━━┫[0m[6;1H[37m┃ ┃ ┃ ┃[0m[7;1H[37m┗━━━━━━┻━━━━━━┻━━━━━━┛[0m[2;2HItem 0[2;9HItem 1[2;16HItem 2[4;2HItem 3[4;9HItem 4[4;16HItem 5[6;2HItem 6[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1HHello, World![0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1HLine 1[2;1HLine 2[3;1HLine 3[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2HThis is an aligned box[3;2Hdefault[1;25H[37m┏━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;25H[37m┃ ┃[0m[3;25H[37m┃ ┃[0m[4;25H[37m┗━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;26HThis is an aligned box[3;26Hleft[1;49H[37m┏━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;49H[37m┃ ┃[0m[3;49H[37m┃ ┃[0m[4;49H[37m┗━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;50HThis is an aligned box[3;58Hcenter[1;73H[37m┏━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;73H[37m┃ ┃[0m[3;73H[37m┃ ┃[0m[4;73H[37m┗━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;74HThis is an aligned box[3;91Hright[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;20HThing 1[2;27HThing 2[0m[48;1H[?25h
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'whirled_peas'
|
2
|
-
|
3
|
-
class TemplateFactory
|
4
|
-
def build(*)
|
5
|
-
WhirledPeas.template do |composer, settings|
|
6
|
-
settings.align = :center
|
7
|
-
settings.width = 50
|
8
|
-
settings.full_border
|
9
|
-
composer.add_text('Text1') { 'Thing 1' }
|
10
|
-
composer.add_text('Text2') { 'Thing 2' }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2HThing 1[2;9HThing 2[0m[48;1H[?25h
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'whirled_peas'
|
2
|
-
|
3
|
-
class TemplateFactory
|
4
|
-
def build(*)
|
5
|
-
WhirledPeas.template do |composer, settings|
|
6
|
-
settings.align = :left
|
7
|
-
settings.width = 50
|
8
|
-
settings.full_border
|
9
|
-
composer.add_text('Text1') { 'Thing 1' }
|
10
|
-
composer.add_text('Text2') { 'Thing 2' }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;38HThing 1[2;45HThing 2[0m[48;1H[?25h
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require 'whirled_peas'
|
2
|
-
|
3
|
-
class TemplateFactory
|
4
|
-
def build(*)
|
5
|
-
WhirledPeas.template do |composer, settings|
|
6
|
-
settings.align = :right
|
7
|
-
settings.width = 50
|
8
|
-
settings.full_border
|
9
|
-
composer.add_text('Text1') { 'Thing 1' }
|
10
|
-
composer.add_text('Text2') { 'Thing 2' }
|
11
|
-
end
|
12
|
-
end
|
13
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┣━━━━━━━━━━━━━━━━━━━━━━━┫[0m[4;1H[37m┃ ┃[0m[5;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2HThis is an aligned grid[4;2Hdefault[1;26H[37m┏━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;26H[37m┃ ┃[0m[3;26H[37m┣━━━━━━━━━━━━━━━━━━━━━━━┫[0m[4;26H[37m┃ ┃[0m[5;26H[37m┗━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;27HThis is an aligned grid[4;27Hleft[1;51H[37m┏━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;51H[37m┃ ┃[0m[3;51H[37m┣━━━━━━━━━━━━━━━━━━━━━━━┫[0m[4;51H[37m┃ ┃[0m[5;51H[37m┗━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;52HThis is an aligned grid[4;60Hcenter[1;76H[37m┏━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;76H[37m┃ ┃[0m[3;76H[37m┣━━━━━━━━━━━━━━━━━━━━━━━┫[0m[4;76H[37m┃ ┃[0m[5;76H[37m┗━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;77HThis is an aligned grid[4;95Hright[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[1mThis is bold[0m[1;13HThis is not bold[0m[48;1H[?25h
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'whirled_peas'
|
2
|
-
|
3
|
-
class TemplateFactory
|
4
|
-
def build(*)
|
5
|
-
WhirledPeas.template do |composer|
|
6
|
-
composer.add_text('Bold') do |_, settings|
|
7
|
-
settings.bold = true
|
8
|
-
"This is bold"
|
9
|
-
end
|
10
|
-
composer.add_text('NotBold') do |_, settings|
|
11
|
-
"This is not bold"
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[4mThis is underlined[0m[1;19HThis is not underlined[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┃ ┃[0m[8;1H[37m┃ ┃[0m[9;1H[37m┃ ┃[0m[10;1H[37m┃ ┃[0m[11;1H[37m┃ ┃[0m[12;1H[37m┃ ┃[0m[13;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2H[37m┏━━━━━━━━━┓[0m[3;2H[37m┃ ┃[0m[4;2H[37m┃ ┃[0m[5;2H[37m┃ ┃[0m[6;2H[37m┃ ┃[0m[7;2H[37m┃ ┃[0m[8;2H[37m┗━━━━━━━━━┛[0m[5;3H1. MEDIUM[2;13H[37m┏━━━━━━━┓[0m[3;13H[37m┃ ┃[0m[4;13H[37m┃ ┃[0m[5;13H[37m┃ ┃[0m[6;13H[37m┃ ┃[0m[7;13H[37m┃ ┃[0m[8;13H[37m┃ ┃[0m[9;13H[37m┃ ┃[0m[10;13H[37m┃ ┃[0m[11;13H[37m┃ ┃[0m[12;13H[37m┗━━━━━━━┛[0m[7;14H2. TALL[2;22H[37m┏━━━━━━━━┓[0m[3;22H[37m┃ ┃[0m[4;22H[37m┗━━━━━━━━┛[0m[3;23H3. SHORT[0m[48;1H[?25h
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'whirled_peas'
|
2
|
-
|
3
|
-
class TemplateFactory
|
4
|
-
def build(*)
|
5
|
-
WhirledPeas.template do |composer, settings|
|
6
|
-
settings.flow = :l2r
|
7
|
-
settings.full_border
|
8
|
-
composer.add_box('Medium') do |composer, settings|
|
9
|
-
settings.set_padding(top: 2, bottom: 2)
|
10
|
-
settings.full_border
|
11
|
-
'1. MEDIUM'
|
12
|
-
end
|
13
|
-
composer.add_box('Tall') do |composer, settings|
|
14
|
-
settings.set_padding(top: 4, bottom: 4)
|
15
|
-
settings.full_border
|
16
|
-
'2. TALL'
|
17
|
-
end
|
18
|
-
composer.add_box('Short') do |composer, settings|
|
19
|
-
settings.full_border
|
20
|
-
'3. SHORT'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┃ ┃[0m[8;1H[37m┃ ┃[0m[9;1H[37m┃ ┃[0m[10;1H[37m┃ ┃[0m[11;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2H[37m┏━━━━━━━━━━━━━━━┓[0m[3;2H[37m┃ ┃[0m[4;2H[37m┗━━━━━━━━━━━━━━━┛[0m[3;6H1. MEDIUM[5;2H[37m┏━━━━━━━━━━━━━━━━━━━━━┓[0m[6;2H[37m┃ ┃[0m[7;2H[37m┗━━━━━━━━━━━━━━━━━━━━━┛[0m[6;10H2. WIDE[8;2H[37m┏━━━━━━━━━┓[0m[9;2H[37m┃ ┃[0m[10;2H[37m┗━━━━━━━━━┛[0m[9;3H3. NARROW[0m[48;1H[?25h
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require 'whirled_peas'
|
2
|
-
|
3
|
-
class TemplateFactory
|
4
|
-
def build(*)
|
5
|
-
WhirledPeas.template do |composer, settings|
|
6
|
-
settings.flow = :t2b
|
7
|
-
settings.full_border
|
8
|
-
composer.add_box('Medium') do |composer, settings|
|
9
|
-
settings.full_border
|
10
|
-
settings.set_padding(left: 3, right: 3)
|
11
|
-
'1. MEDIUM'
|
12
|
-
end
|
13
|
-
composer.add_box('Wide') do |composer, settings|
|
14
|
-
settings.full_border
|
15
|
-
settings.set_padding(left: 7, right: 7)
|
16
|
-
'2. WIDE'
|
17
|
-
end
|
18
|
-
composer.add_box('Narrow') do |composer, settings|
|
19
|
-
settings.full_border
|
20
|
-
'3. NARROW'
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┗━━━━━┛[0m[2;2HMulti[3;2HLine[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━┳━┳━┳━┓[0m[2;1H[37m┃ ┃ ┃ ┃ ┃[0m[3;1H[37m┃ ┃ ┃ ┃ ┃[0m[4;1H[37m┃ ┃ ┃ ┃ ┃[0m[5;1H[37m┃ ┃ ┃ ┃ ┃[0m[6;1H[37m┃ ┃ ┃ ┃ ┃[0m[7;1H[37m┣━╋━╋━╋━┫[0m[8;1H[37m┃ ┃ ┃ ┃ ┃[0m[9;1H[37m┃ ┃ ┃ ┃ ┃[0m[10;1H[37m┃ ┃ ┃ ┃ ┃[0m[11;1H[37m┃ ┃ ┃ ┃ ┃[0m[12;1H[37m┃ ┃ ┃ ┃ ┃[0m[13;1H[37m┣━╋━╋━╋━┫[0m[14;1H[37m┃ ┃ ┃ ┃ ┃[0m[15;1H[37m┃ ┃ ┃ ┃ ┃[0m[16;1H[37m┃ ┃ ┃ ┃ ┃[0m[17;1H[37m┃ ┃ ┃ ┃ ┃[0m[18;1H[37m┃ ┃ ┃ ┃ ┃[0m[19;1H[37m┗━┻━┻━┻━┛[0m[2;2H0[2;4H1[2;6H2[2;8H3[8;2H4[8;4H5[8;6H6[8;8H7[14;2H8[14;4H9[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┗━┛[0m[2;2H0[3;2H1[4;2H2[5;2H3[6;2H4[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┗━━━┛[0m[2;2H0[3;2H1[4;2H2[5;2H3[6;2H4[2;3H0[3;3H1[4;3H2[5;3H3[6;3H4[2;4H0[3;4H1[4;4H2[5;4H3[6;4H4[0m[48;1H[?25h
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require 'whirled_peas'
|
2
|
-
|
3
|
-
class TemplateFactory
|
4
|
-
TALL_STRING = 10.times.map(&:to_s).join("\n")
|
5
|
-
|
6
|
-
def build(*)
|
7
|
-
WhirledPeas.template do |composer, settings|
|
8
|
-
settings.full_border
|
9
|
-
settings.height = 5
|
10
|
-
3.times do |i|
|
11
|
-
composer.add_text { TALL_STRING }
|
12
|
-
end
|
13
|
-
end
|
14
|
-
end
|
15
|
-
end
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┗━━┛[0m[2;2HXO[3;2HXO[4;2HXO[5;2HXO[6;2HXO[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┗━┛[0m[2;2H0[3;2H1[4;2H2[5;2H3[6;2H4[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┃ ┃[0m[8;1H[37m┗━━━━━━━━━━━━━━━━━━━┛[0m[4;7H[37m┏━━━━━━━━━┓[0m[5;7H[37m┃ ┃[0m[6;7H[37m┗━━━━━━━━━┛[0m[5;8HInner Box[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┗━━━━━━━━━━━━━━━━━━━┛[0m[4;7HPadded Room[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┗━━━━━━━┛[0m[12;15H[31m┏━━━[0m[13;15H[31m┃ [0m[14;15H[31m┃ [0m[15;15H[31m┃ [0m[16;15H[31m┃ [0m[17;15H[31m┃ [0m[18;15H[31m┗━━━[0m[13;16H123[14;16H223[15;16H333[16;16H443[17;16H543[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┗━━━━━━━┛[0m[12;12H[31m━━━┓[0m[13;12H[31m ┃[0m[14;12H[31m ┃[0m[15;12H[31m ┃[0m[16;12H[31m ┃[0m[17;12H[31m ┃[0m[18;12H[31m━━━┛[0m[13;12H345[14;12H344[15;12H333[16;12H322[17;12H321[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┗━━━━━━━┛[0m[15;12H[31m┏━━━━━┓[0m[16;12H[31m┃ ┃[0m[17;12H[31m┃ ┃[0m[18;12H[31m┃ ┃[0m[16;13H12345[17;13H22344[18;13H33333[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┗━━━━━━━┛[0m[12;12H[31m┃ ┃[0m[13;12H[31m┃ ┃[0m[14;12H[31m┃ ┃[0m[15;12H[31m┗━━━━━┛[0m[12;13H33333[13;13H44322[14;13H54321[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┃ ┃[0m[20;11H[32m┃ ┃[0m[21;11H[32m┃ ┃[0m[22;11H[32m┃ ┃[0m[23;11H[32m┗━━━━━━━┛[0m[12;15H[31m┏━━━[0m[13;15H[31m┃ [0m[14;15H[31m┣━━━[0m[15;15H[31m┃ [0m[16;15H[31m┣━━━[0m[17;15H[31m┃ [0m[18;15H[31m┣━━━[0m[19;15H[31m┃ [0m[20;15H[31m┣━━━[0m[21;15H[31m┃ [0m[22;15H[31m┗━━━[0m[13;16H123[15;16H223[17;16H333[19;16H443[21;16H543[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┃ ┃[0m[20;11H[32m┃ ┃[0m[21;11H[32m┃ ┃[0m[22;11H[32m┃ ┃[0m[23;11H[32m┗━━━━━━━┛[0m[12;12H[31m━━━┓[0m[13;12H[31m ┃[0m[14;12H[31m━━━┫[0m[15;12H[31m ┃[0m[16;12H[31m━━━┫[0m[17;12H[31m ┃[0m[18;12H[31m━━━┫[0m[19;12H[31m ┃[0m[20;12H[31m━━━┫[0m[21;12H[31m ┃[0m[22;12H[31m━━━┛[0m[13;12H345[15;12H344[17;12H333[19;12H322[21;12H321[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┃ ┃[0m[20;11H[32m┃ ┃[0m[21;11H[32m┃ ┃[0m[22;11H[32m┃ ┃[0m[23;11H[32m┗━━━━━━━┛[0m[15;12H[31m┏━━━━━┓[0m[16;12H[31m┃ ┃[0m[17;12H[31m┣━━━━━┫[0m[18;12H[31m┃ ┃[0m[19;12H[31m┣━━━━━┫[0m[20;12H[31m┃ ┃[0m[21;12H[31m┣━━━━━┫[0m[22;12H[31m┃ ┃[0m[16;13H12345[18;13H22344[20;13H33333[22;13H44322[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[11;11H[32m┏━━━━━━━┓[0m[12;11H[32m┃ ┃[0m[13;11H[32m┃ ┃[0m[14;11H[32m┃ ┃[0m[15;11H[32m┃ ┃[0m[16;11H[32m┃ ┃[0m[17;11H[32m┃ ┃[0m[18;11H[32m┃ ┃[0m[19;11H[32m┃ ┃[0m[20;11H[32m┃ ┃[0m[21;11H[32m┃ ┃[0m[22;11H[32m┃ ┃[0m[23;11H[32m┗━━━━━━━┛[0m[12;12H[31m┃ ┃[0m[13;12H[31m┣━━━━━┫[0m[14;12H[31m┃ ┃[0m[15;12H[31m┣━━━━━┫[0m[16;12H[31m┃ ┃[0m[17;12H[31m┣━━━━━┫[0m[18;12H[31m┃ ┃[0m[19;12H[31m┗━━━━━┛[0m[12;13H22344[14;13H33333[16;13H44322[18;13H54321[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H████████╗███████╗███████╗████████╗[2;1H╚══██╔══╝██╔════╝██╔════╝╚══██╔══╝[3;1H ██║ █████╗ ███████╗ ██║ [4;1H ██║ ██╔══╝ ╚════██║ ██║ [5;1H ██║ ███████╗███████║ ██║ [6;1H ╚═╝ ╚══════╝╚══════╝ ╚═╝ [0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2HHow big is it?[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓[0m[2;1H[37m┃ ┃ ┃[0m[3;1H[37m┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫[0m[4;1H[37m┃ ┃ ┃[0m[5;1H[37m┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫[0m[6;1H[37m┃ ┃ ┃[0m[7;1H[37m┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛[0m[2;2HHow big is it?[2;33HHow big is it?[4;2HHow big is it?[4;33HHow big is it?[6;2HHow big is it?[6;33HHow big is it?[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┗━━━━━━━━━━┛[0m[2;2HABCDEFGHIJ[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┗━━━━━━━━━━┛[0m[2;2H0|[2;4H0|1|[2;8H0|1|[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┃ ┃[0m[4;1H[37m┃ ┃[0m[5;1H[37m┃ ┃[0m[6;1H[37m┃ ┃[0m[7;1H[37m┃ ┃[0m[8;1H[37m┃ ┃[0m[9;1H[37m┃ ┃[0m[10;1H[37m┃ ┃[0m[11;1H[37m┃ ┃[0m[12;1H[37m┗━━━━━━━━━━┛[0m[2;2HXO[3;2HXOXO[4;2HXOXOXO[5;2HXOXOXOXO[6;2HXOXOXOXOXO[7;2HXOXOXOXOXO[8;2HXOXOXOXOXO[9;2HXOXOXOXOXO[10;2HXOXOXOXOXO[11;2HXOXOXOXOXO[0m[48;1H[?25h
|
@@ -1 +0,0 @@
|
|
1
|
-
[?25l[1;1H[J[1;1H[37m┏━━━━━━━━━━┓[0m[2;1H[37m┃ ┃[0m[3;1H[37m┗━━━━━━━━━━┛[0m[2;2HABCDEFGHIJ[0m[48;1H[?25h
|
@@ -1,191 +0,0 @@
|
|
1
|
-
require 'bundler/setup'
|
2
|
-
require 'whirled_peas'
|
3
|
-
require 'whirled_peas/frame/event_loop'
|
4
|
-
require 'whirled_peas/frame/producer'
|
5
|
-
require 'whirled_peas/graphics/debugger'
|
6
|
-
require 'whirled_peas/graphics/renderer'
|
7
|
-
require 'whirled_peas/graphics/screen'
|
8
|
-
require 'whirled_peas/settings/text_color'
|
9
|
-
require 'whirled_peas/utils/formatted_string'
|
10
|
-
|
11
|
-
module WhirledPeas
|
12
|
-
class ScreenTester
|
13
|
-
def self.run_all
|
14
|
-
base_dir = File.dirname(__FILE__)
|
15
|
-
test_files = Dir.glob(File.join(base_dir, 'rendered', '**', '*.rb'))
|
16
|
-
failures = {}
|
17
|
-
pendings = Set.new
|
18
|
-
test_files.each do |file|
|
19
|
-
tester = new(file)
|
20
|
-
if tester.pending?
|
21
|
-
print Utils::FormattedString.new('.', Settings::TextColor::YELLOW)
|
22
|
-
pendings << file
|
23
|
-
elsif tester.failed?
|
24
|
-
print Utils::FormattedString.new('.', Settings::TextColor::RED)
|
25
|
-
failures[file] = tester.error
|
26
|
-
else
|
27
|
-
print Utils::FormattedString.new('.', Settings::TextColor::GREEN)
|
28
|
-
end
|
29
|
-
STDOUT.flush
|
30
|
-
end
|
31
|
-
puts
|
32
|
-
puts if pendings.count > 0
|
33
|
-
pendings.each do |file|
|
34
|
-
puts Utils::FormattedString.new("PENDING: #{file}", Settings::TextColor::YELLOW)
|
35
|
-
end
|
36
|
-
puts if failures.count > 0
|
37
|
-
failures.each do |file, error|
|
38
|
-
puts Utils::FormattedString.new("Failed: #{file}:\n\n #{error}\n", Settings::TextColor::RED)
|
39
|
-
end
|
40
|
-
|
41
|
-
if failures.count == 0
|
42
|
-
puts
|
43
|
-
puts Utils::FormattedString.new('No failures', Settings::TextColor::GREEN)
|
44
|
-
else
|
45
|
-
exit(1)
|
46
|
-
end
|
47
|
-
end
|
48
|
-
|
49
|
-
def self.update_all
|
50
|
-
base_dir = File.dirname(__FILE__)
|
51
|
-
test_files = Dir.glob(File.join(base_dir, 'rendered', '**', '*.rb'))
|
52
|
-
test_files.each do |file|
|
53
|
-
tester = new(file)
|
54
|
-
if tester.pending?
|
55
|
-
tester.ask_pending
|
56
|
-
elsif tester.failed?
|
57
|
-
tester.ask_failed
|
58
|
-
end
|
59
|
-
end
|
60
|
-
end
|
61
|
-
|
62
|
-
attr_reader :error
|
63
|
-
|
64
|
-
def initialize(test_file)
|
65
|
-
@full_test_file = test_file[0] == '/' ? test_file : File.join(Dir.pwd, test_file)
|
66
|
-
raise ArgumentError, "File not found: #{test_file}" unless File.exist?(@full_test_file)
|
67
|
-
@test_file = test_file.sub(File.dirname(__FILE__), '')[1..-1]
|
68
|
-
@full_output_file = @full_test_file.sub(/\.rb$/, '.frame')
|
69
|
-
@output_file = @full_output_file.sub(File.dirname(__FILE__), '')[1..-1]
|
70
|
-
end
|
71
|
-
|
72
|
-
def pending?
|
73
|
-
!File.exist?(full_output_file)
|
74
|
-
end
|
75
|
-
|
76
|
-
def failed?
|
77
|
-
if rendered != File.read(full_output_file)
|
78
|
-
@error = 'Rendered output does not match saved output'
|
79
|
-
end
|
80
|
-
!@error.nil?
|
81
|
-
end
|
82
|
-
|
83
|
-
def view
|
84
|
-
with_template_factory do |template_factory|
|
85
|
-
render_screen(template_factory, STDOUT)
|
86
|
-
end
|
87
|
-
end
|
88
|
-
|
89
|
-
def debug
|
90
|
-
with_template_factory do |template_factory|
|
91
|
-
template = template_factory.build('Test', {})
|
92
|
-
painter = Graphics::Renderer.new(template, *Graphics::Screen.current_dimensions).painter
|
93
|
-
puts Graphics::Debugger.new(painter).debug
|
94
|
-
end
|
95
|
-
end
|
96
|
-
|
97
|
-
def save
|
98
|
-
if File.exist?(full_output_file)
|
99
|
-
puts "Existing output file found: #{full_output_file}"
|
100
|
-
puts "overwriting..."
|
101
|
-
else
|
102
|
-
puts "Writing output to file: #{full_output_file}"
|
103
|
-
end
|
104
|
-
|
105
|
-
with_template_factory do |template_factory|
|
106
|
-
File.open(full_output_file, 'w') do |file|
|
107
|
-
render_screen(template_factory, file)
|
108
|
-
end
|
109
|
-
end
|
110
|
-
end
|
111
|
-
|
112
|
-
def ask_pending
|
113
|
-
puts Utils::FormattedString.new("Frame file does not exist for #{test_file}", Settings::TextColor::YELLOW)
|
114
|
-
print 'View rendered frame? [Y/n/q] '
|
115
|
-
STDOUT.flush
|
116
|
-
response = STDIN.gets.strip.downcase
|
117
|
-
case response
|
118
|
-
when 'q'
|
119
|
-
exit
|
120
|
-
when 'n'
|
121
|
-
return
|
122
|
-
end
|
123
|
-
print rendered
|
124
|
-
STDOUT.flush
|
125
|
-
ask_to_save
|
126
|
-
end
|
127
|
-
|
128
|
-
def ask_failed
|
129
|
-
puts Utils::FormattedString.new("Output from test does not match saved output for #{test_file}", Settings::TextColor::RED)
|
130
|
-
print 'View expected output? [Y/q] '
|
131
|
-
STDOUT.flush
|
132
|
-
exit if 'q' == STDIN.gets.strip.downcase
|
133
|
-
print File.read(full_output_file)
|
134
|
-
print 'View actual output? [Y/q] '
|
135
|
-
STDOUT.flush
|
136
|
-
exit if 'q' == STDIN.gets.strip.downcase
|
137
|
-
print rendered
|
138
|
-
STDOUT.flush
|
139
|
-
ask_to_save
|
140
|
-
end
|
141
|
-
|
142
|
-
private
|
143
|
-
|
144
|
-
attr_reader :full_test_file, :test_file, :full_output_file, :output_file
|
145
|
-
|
146
|
-
def ask_to_save
|
147
|
-
print "Save actual as the expected test output (#{output_file})? [y/N/q] "
|
148
|
-
STDOUT.flush
|
149
|
-
response = STDIN.gets.strip.downcase
|
150
|
-
print Utils::Ansi.cursor_pos(left: 0, top: 0)
|
151
|
-
print Utils::Ansi.clear_down
|
152
|
-
if response == 'y'
|
153
|
-
File.open(full_output_file, 'w') { |file| file.print(rendered) }
|
154
|
-
puts "Saved to #{output_file}"
|
155
|
-
elsif response == 'q'
|
156
|
-
puts 'Exiting'
|
157
|
-
exit
|
158
|
-
else
|
159
|
-
puts 'Skipped'
|
160
|
-
end
|
161
|
-
end
|
162
|
-
|
163
|
-
def rendered
|
164
|
-
@rendered ||= begin
|
165
|
-
string_io = StringIO.new
|
166
|
-
with_template_factory do |template_factory|
|
167
|
-
render_screen(template_factory, string_io)
|
168
|
-
end
|
169
|
-
string_io.string
|
170
|
-
end
|
171
|
-
end
|
172
|
-
|
173
|
-
def with_template_factory(&block)
|
174
|
-
require full_test_file
|
175
|
-
raise 'TemplateFactory must be defined' unless defined?(TemplateFactory)
|
176
|
-
yield TemplateFactory.new
|
177
|
-
ensure
|
178
|
-
Object.send(:remove_const, :TemplateFactory)
|
179
|
-
end
|
180
|
-
|
181
|
-
def render_screen(template_factory, output)
|
182
|
-
screen = Graphics::Screen.new(output)
|
183
|
-
consumer = Frame::EventLoop.new(
|
184
|
-
template_factory, screen: screen, refresh_rate: 100000
|
185
|
-
)
|
186
|
-
Frame::Producer.produce(consumer) do |producer|
|
187
|
-
producer.send_frame('test', args: {})
|
188
|
-
end
|
189
|
-
end
|
190
|
-
end
|
191
|
-
end
|