squib 0.12.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.travis.yml +3 -2
- data/CHANGELOG.md +16 -1
- data/appveyor.yml +2 -3
- data/lib/squib/args/sheet.rb +66 -34
- data/lib/squib/graphics/save_pdf.rb +1 -1
- data/lib/squib/import/data_frame.rb +7 -7
- data/lib/squib/version.rb +1 -1
- data/samples/autoscale_font/_autoscale_font.rb +1 -1
- data/samples/build_groups/build_groups.rb +3 -3
- data/samples/colors/_colors.rb +1 -0
- data/samples/{config_text_markup.rb → config/config_text_markup.rb} +0 -0
- data/samples/{custom_config.rb → config/custom_config.rb} +0 -0
- data/samples/{cairo_access.rb → images/_cairo_access.rb} +0 -0
- data/samples/images/_images.rb +1 -1
- data/samples/{unicode.rb → images/_unicode.rb} +0 -0
- data/samples/intro/01_hello.rb +1 -2
- data/samples/intro/02_options.rb +1 -2
- data/samples/intro/03_layout.rb +1 -2
- data/samples/intro/04_arrays.rb +1 -2
- data/samples/intro/05_excel.rb +3 -4
- data/samples/{tgc_proofs.rb → proofs/_tgc_proofs.rb} +1 -4
- data/samples/saves/_save_pdf.rb +7 -0
- data/samples/{embed_text.rb → text/_embed_text.rb} +1 -0
- data/samples/text/_text.rb +1 -1
- data/samples/{text_options.rb → text/_text_options.rb} +1 -1
- data/samples/{bug134.rb → text/bug134.rb} +0 -0
- data/squib.gemspec +17 -16
- metadata +90 -596
- data/benchmarks/antialias_best.rb +0 -13
- data/benchmarks/antialias_best.yml +0 -1
- data/benchmarks/antialias_fast.rb +0 -13
- data/benchmarks/antialias_fast.yml +0 -1
- data/benchmarks/backend-svg.yml +0 -4
- data/benchmarks/backend_memory.rb +0 -14
- data/benchmarks/backend_svg.rb +0 -14
- data/benchmarks/shiny-purse.png +0 -0
- data/benchmarks/spanner.svg +0 -91
- data/benchmarks/tons_of_png.rb +0 -6
- data/benchmarks/tons_of_svg.rb +0 -7
- data/benchmarks/tons_of_text.rb +0 -8
- data/docs/Makefile +0 -216
- data/docs/_static/css/squibdocs.css +0 -23
- data/docs/args/draw.rst +0 -36
- data/docs/args/expansion.rst +0 -3
- data/docs/args/layout.rst +0 -6
- data/docs/args/output_dir.rst +0 -6
- data/docs/args/range.rst +0 -6
- data/docs/args/transform.rst +0 -51
- data/docs/args/trim.rst +0 -11
- data/docs/args/wh.rst +0 -12
- data/docs/args/xy.rst +0 -12
- data/docs/arrays.rst +0 -80
- data/docs/backends.rst +0 -20
- data/docs/bleed.rst +0 -13
- data/docs/build_groups.rst +0 -45
- data/docs/colors.rst +0 -90
- data/docs/conf.py +0 -287
- data/docs/config.rst +0 -135
- data/docs/data.rst +0 -26
- data/docs/dsl/background.rst +0 -20
- data/docs/dsl/build.rst +0 -32
- data/docs/dsl/build_groups.rst +0 -23
- data/docs/dsl/circle.rst +0 -27
- data/docs/dsl/cm.rst +0 -19
- data/docs/dsl/configure.rst +0 -18
- data/docs/dsl/csv.rst +0 -81
- data/docs/dsl/curve.rst +0 -63
- data/docs/dsl/data_frame.rst +0 -85
- data/docs/dsl/deck.rst +0 -45
- data/docs/dsl/disable_build.rst +0 -25
- data/docs/dsl/disable_build_globally.rst +0 -46
- data/docs/dsl/ellipse.rst +0 -23
- data/docs/dsl/enable_build.rst +0 -25
- data/docs/dsl/enable_build_globally.rst +0 -44
- data/docs/dsl/grid.rst +0 -31
- data/docs/dsl/hand.rst +0 -40
- data/docs/dsl/hint.rst +0 -15
- data/docs/dsl/inches.rst +0 -19
- data/docs/dsl/index.rst +0 -9
- data/docs/dsl/line.rst +0 -52
- data/docs/dsl/mm.rst +0 -19
- data/docs/dsl/png.rst +0 -49
- data/docs/dsl/polygon.rst +0 -28
- data/docs/dsl/rect.rst +0 -22
- data/docs/dsl/save.rst +0 -23
- data/docs/dsl/save_pdf.rst +0 -89
- data/docs/dsl/save_png.rst +0 -46
- data/docs/dsl/save_sheet.rst +0 -55
- data/docs/dsl/showcase.rst +0 -76
- data/docs/dsl/star.rst +0 -35
- data/docs/dsl/svg.rst +0 -119
- data/docs/dsl/text.rst +0 -292
- data/docs/dsl/triangle.rst +0 -50
- data/docs/dsl/use_layout.rst +0 -16
- data/docs/dsl/xlsx.rst +0 -56
- data/docs/guides/game_icons.rst +0 -126
- data/docs/guides/getting-started/index.rst +0 -5
- data/docs/guides/getting-started/part_0_learning_ruby.rst +0 -145
- data/docs/guides/getting-started/part_1_zero_to_game.rst +0 -217
- data/docs/guides/getting-started/part_2_iconography.rst +0 -228
- data/docs/guides/getting-started/part_3_workflows.rst +0 -46
- data/docs/guides/getting-started/part_4_ruby_power.rst +0 -18
- data/docs/guides/git.rst +0 -14
- data/docs/guides/guard.rst +0 -84
- data/docs/guides/hello_world.rst +0 -65
- data/docs/guides/projects.rst +0 -35
- data/docs/help.rst +0 -157
- data/docs/index.rst +0 -35
- data/docs/install.rst +0 -68
- data/docs/layouts.rst +0 -290
- data/docs/learning.rst +0 -12
- data/docs/make.bat +0 -263
- data/docs/parameters.rst +0 -34
- data/docs/server.bat +0 -1
- data/docs/text_feature.rst +0 -115
- data/docs/units.rst +0 -14
- data/samples/autoscale_font/.gitignore +0 -2
- data/samples/autoscale_font/card_00_expected.png +0 -0
- data/samples/backend/.gitignore +0 -1
- data/samples/backend/_backend-config.yml +0 -5
- data/samples/backend/backend_00_expected.png +0 -0
- data/samples/backend/backend_01_expected.png +0 -0
- data/samples/backend/backend_vectorized_expected.pdf +0 -0
- data/samples/backend/backend_vectors_00_expected.svg +0 -84
- data/samples/backend/backend_vectors_01_expected.svg +0 -84
- data/samples/backend/shiny-purse.png +0 -0
- data/samples/backend/showcase_expected.png +0 -0
- data/samples/backend/spanner.svg +0 -91
- data/samples/ball.png +0 -0
- data/samples/build_groups/.gitignore +0 -1
- data/samples/build_groups/Rakefile +0 -25
- data/samples/colors/.gitignore +0 -1
- data/samples/colors/color_constants_00_expected.png +0 -0
- data/samples/colors/colors_00_expected.png +0 -0
- data/samples/colors/gradient_00_expected.png +0 -0
- data/samples/config_disable_quotes.yml +0 -3
- data/samples/config_text_markup.yml +0 -9
- data/samples/custom-config.yml +0 -5
- data/samples/customconfig-imgdir/shiny-purse2.png +0 -0
- data/samples/customconfig-imgdir/spanner2.svg +0 -91
- data/samples/data/.gitignore +0 -1
- data/samples/data/explode_quantities.xlsx +0 -0
- data/samples/data/quantity_explosion.csv +0 -3
- data/samples/data/sample.csv +0 -3
- data/samples/data/sample.xlsx +0 -0
- data/samples/data/sample_csv_00_expected.png +0 -0
- data/samples/data/sample_csv_01_expected.png +0 -0
- data/samples/data/sample_csv_qty_00_expected.png +0 -0
- data/samples/data/sample_excel_00_expected.png +0 -0
- data/samples/data/sample_excel_01_expected.png +0 -0
- data/samples/data/sample_excel_02_expected.png +0 -0
- data/samples/data/sample_excel_resources_00_expected.png +0 -0
- data/samples/data/sample_excel_resources_01_expected.png +0 -0
- data/samples/data/sample_xlsx_qty_00_expected.png +0 -0
- data/samples/glass-heart.svg +0 -52
- data/samples/grit.png +0 -0
- data/samples/images/.gitignore +0 -8
- data/samples/images/_images_00_expected.png +0 -0
- data/samples/images/angler-fish.png +0 -0
- data/samples/images/ball.png +0 -0
- data/samples/images/glass-heart.svg +0 -52
- data/samples/images/grit.png +0 -0
- data/samples/images/offset.svg +0 -85
- data/samples/images/robot-golem.svg +0 -1
- data/samples/images/shiny-purse.png +0 -0
- data/samples/images/spanner.svg +0 -91
- data/samples/images/sprites.png +0 -0
- data/samples/images/with-alpha.png +0 -0
- data/samples/intro/.gitignore +0 -2
- data/samples/intro/auto-repair.svg +0 -1
- data/samples/intro/crawling.svg +0 -1
- data/samples/intro/data.xlsx +0 -0
- data/samples/intro/humans.svg +0 -1
- data/samples/intro/ninja-mask.svg +0 -1
- data/samples/intro/part1_00_expected.png +0 -0
- data/samples/intro/part2_00_expected.png +0 -0
- data/samples/intro/part3_00_expected.png +0 -0
- data/samples/intro/part3_layout.yml +0 -34
- data/samples/intro/part4_00_expected.png +0 -0
- data/samples/intro/part4_01_expected.png +0 -0
- data/samples/intro/part5_00_expected.png +0 -0
- data/samples/intro/part5_01_expected.png +0 -0
- data/samples/intro/part5_02_expected.png +0 -0
- data/samples/intro/part5_03_expected.png +0 -0
- data/samples/intro/part5_hand_expected.png +0 -0
- data/samples/intro/part5_showcase_expected.png +0 -0
- data/samples/intro/pirate-skull.svg +0 -1
- data/samples/intro/robot-golem.svg +0 -1
- data/samples/layouts/custom-layout.yml +0 -60
- data/samples/layouts/custom-layout2.yml +0 -15
- data/samples/layouts/expected_layouts_builtin_economy_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_fantasy_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_hand_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_playing_card_00.png +0 -0
- data/samples/layouts/expected_layouts_builtin_tuck_box_00.png +0 -0
- data/samples/layouts/shiny-purse.png +0 -0
- data/samples/layouts/spanner.svg +0 -91
- data/samples/load_images_config.yml +0 -1
- data/samples/offset.svg +0 -71
- data/samples/pokercard.png +0 -0
- data/samples/project/Gemfile +0 -6
- data/samples/project/Guardfile +0 -18
- data/samples/project/Rakefile +0 -25
- data/samples/project/bw/robot-golem.svg +0 -53
- data/samples/project/color/robot-golem.svg +0 -1
- data/samples/project/config.yml +0 -2
- data/samples/project/layouts/characters.yml +0 -3
- data/samples/project/layouts/skills.yml +0 -3
- data/samples/ranges/glass-heart.svg +0 -52
- data/samples/ranges/ranges_00_expected.png +0 -0
- data/samples/saves/.gitignore +0 -1
- data/samples/saves/hand_expected.png +0 -0
- data/samples/saves/hand_pretty_expected.png +0 -0
- data/samples/saves/save-pdf-small_expected.pdf +0 -0
- data/samples/saves/save-pdf_expected.pdf +0 -0
- data/samples/saves/save_png_00_expected.png +0 -0
- data/samples/saves/save_png_trimmed_00_expected.png +0 -0
- data/samples/saves/save_sheet_00_expected.png +0 -0
- data/samples/saves/save_sheet_01_expected.png +0 -0
- data/samples/saves/save_sheet_range_00_expected.png +0 -0
- data/samples/saves/save_sheet_range_01_expected.png +0 -0
- data/samples/saves/save_single_sheet_00_expected.png +0 -0
- data/samples/saves/saves_notrim_01_expected.png +0 -0
- data/samples/saves/showcase2_expected.png +0 -0
- data/samples/saves/showcase_expected.png +0 -0
- data/samples/saves/showcase_individual_00_expected.png +0 -0
- data/samples/saves/showcase_individual_01_expected.png +0 -0
- data/samples/saves/showcase_individual_02_expected.png +0 -0
- data/samples/saves/showcase_individual_03_expected.png +0 -0
- data/samples/saves/spanner.svg +0 -91
- data/samples/shapes/.gitignore +0 -1
- data/samples/shapes/shape_00_expected.png +0 -0
- data/samples/shiny-purse.png +0 -0
- data/samples/spanner.svg +0 -91
- data/samples/sprites.png +0 -0
- data/samples/text/.gitignore +0 -2
- data/samples/text/README.md +0 -1
- data/samples/text/_text_00_expected.png +0 -0
- data/samples/text/config.yml +0 -2
- data/samples/units/units_00_expected.png +0 -0
- data/samples/units/using_units.yml +0 -10
- data/spec/api/api_data_spec.rb +0 -172
- data/spec/api/api_groups_spec.rb +0 -49
- data/spec/api/api_settings_spec.rb +0 -38
- data/spec/api/api_units_spec.rb +0 -37
- data/spec/args/box_spec.rb +0 -127
- data/spec/args/draw_spec.rb +0 -101
- data/spec/args/embed_key_spec.rb +0 -13
- data/spec/args/input_file_spec.rb +0 -21
- data/spec/args/paint_spec.rb +0 -22
- data/spec/args/paragraph_spec.rb +0 -153
- data/spec/args/range_spec.rb +0 -41
- data/spec/args/save_batch_spec.rb +0 -51
- data/spec/args/scale_box_spec.rb +0 -71
- data/spec/args/sheet_spec.rb +0 -80
- data/spec/args/showcase_special_spec.rb +0 -15
- data/spec/args/transform_spec.rb +0 -25
- data/spec/args/typographer_spec.rb +0 -71
- data/spec/args/unit_conversion_spec.rb +0 -29
- data/spec/card_spec.rb +0 -11
- data/spec/commands/new_spec.rb +0 -48
- data/spec/conf_spec.rb +0 -47
- data/spec/data/conf/basic.yml +0 -1
- data/spec/data/conf/empty.yml +0 -1
- data/spec/data/conf/unrecognized.yml +0 -4
- data/spec/data/csv/basic.csv +0 -3
- data/spec/data/csv/custom_opts.csv +0 -2
- data/spec/data/csv/dup_cols.csv +0 -3
- data/spec/data/csv/newline.csv +0 -3
- data/spec/data/csv/qty.csv +0 -3
- data/spec/data/csv/qty_named.csv +0 -3
- data/spec/data/csv/with_spaces.csv +0 -3
- data/spec/data/csv/yield.csv +0 -3
- data/spec/data/layouts/easy-circular-extends.yml +0 -6
- data/spec/data/layouts/empty-rule.yml +0 -1
- data/spec/data/layouts/empty.yml +0 -1
- data/spec/data/layouts/extends-nonexists.yml +0 -3
- data/spec/data/layouts/extends-units-mixed.yml +0 -8
- data/spec/data/layouts/extends-units.yml +0 -8
- data/spec/data/layouts/hard-circular-extends.yml +0 -9
- data/spec/data/layouts/multi-extends-single-entry.yml +0 -14
- data/spec/data/layouts/multi-level-extends.yml +0 -10
- data/spec/data/layouts/multifile-a.yml +0 -4
- data/spec/data/layouts/multifile-b.yml +0 -4
- data/spec/data/layouts/multifile-extends-a.yml +0 -8
- data/spec/data/layouts/multifile-extends-b.yml +0 -9
- data/spec/data/layouts/no-extends.yml +0 -5
- data/spec/data/layouts/pre-extends.yml +0 -7
- data/spec/data/layouts/self-circular-extends.yml +0 -3
- data/spec/data/layouts/single-extends.yml +0 -7
- data/spec/data/layouts/single-level-multi-extends.yml +0 -12
- data/spec/data/samples/autoscale_font/_autoscale_font.rb.txt +0 -133
- data/spec/data/samples/basic.rb.txt +0 -248
- data/spec/data/samples/cairo_access.rb.txt +0 -59
- data/spec/data/samples/colors/_gradients.rb.txt +0 -84
- data/spec/data/samples/config_text_markup.rb.txt +0 -74
- data/spec/data/samples/custom_config.rb.txt +0 -59
- data/spec/data/samples/data/_csv.rb.txt +0 -231
- data/spec/data/samples/data/_excel.rb.txt +0 -704
- data/spec/data/samples/embed_text.rb.txt +0 -431
- data/spec/data/samples/hello_world.rb.txt +0 -38
- data/spec/data/samples/images/_more_load_images.rb.txt +0 -335
- data/spec/data/samples/layouts.rb.txt +0 -489
- data/spec/data/samples/ranges/_ranges.rb.txt +0 -484
- data/spec/data/samples/saves/_hand.rb.txt +0 -594
- data/spec/data/samples/saves/_portrait_landscape.rb.txt +0 -57
- data/spec/data/samples/saves/_save_pdf.rb.txt +0 -1601
- data/spec/data/samples/saves/_saves.rb.txt +0 -873
- data/spec/data/samples/saves/_showcase.rb.txt +0 -5942
- data/spec/data/samples/shapes/_draw_shapes.rb.txt +0 -757
- data/spec/data/samples/text_options.rb.txt +0 -1158
- data/spec/data/samples/tgc_proofs.rb.txt +0 -102
- data/spec/data/samples/units/_units.rb.txt +0 -53
- data/spec/data/xlsx/basic.xlsx +0 -0
- data/spec/data/xlsx/explode_quantities.xlsx +0 -0
- data/spec/data/xlsx/formulas.xlsx +0 -0
- data/spec/data/xlsx/whitespace.xlsx +0 -0
- data/spec/data/xlsx/with_macros.xlsm +0 -0
- data/spec/deck_spec.rb +0 -73
- data/spec/graphics/cairo_context_wrapper_spec.rb +0 -104
- data/spec/graphics/embedding_utils_spec.rb +0 -73
- data/spec/graphics/graphics_save_doc_spec.rb +0 -74
- data/spec/import/data_frame_spec.rb +0 -251
- data/spec/layout_parser_spec.rb +0 -226
- data/spec/logger_spec.rb +0 -12
- data/spec/samples/_diffs/gitkeep.txt +0 -0
- data/spec/samples/diff-with-css.example.html +0 -39
- data/spec/samples/expected/autoscale_00.png +0 -0
- data/spec/samples/expected/autoscale_01.png +0 -0
- data/spec/samples/expected/autoscale_02.png +0 -0
- data/spec/samples/expected/backend_00.png +0 -0
- data/spec/samples/expected/backend_00.svg +0 -78
- data/spec/samples/expected/backend_01.png +0 -0
- data/spec/samples/expected/backend_01.svg +0 -78
- data/spec/samples/expected/basic_00.png +0 -0
- data/spec/samples/expected/basic_01.png +0 -0
- data/spec/samples/expected/basic_02.png +0 -0
- data/spec/samples/expected/cairo_access_00.png +0 -0
- data/spec/samples/expected/cairo_access_01.png +0 -0
- data/spec/samples/expected/card_00.png +0 -0
- data/spec/samples/expected/card_01.png +0 -0
- data/spec/samples/expected/colors_00.png +0 -0
- data/spec/samples/expected/config_disable_text_00.png +0 -0
- data/spec/samples/expected/config_text_00.png +0 -0
- data/spec/samples/expected/custom-config_00.png +0 -0
- data/spec/samples/expected/embed_00.png +0 -0
- data/spec/samples/expected/embed_multisheet_00.png +0 -0
- data/spec/samples/expected/gitkeep.txt +0 -0
- data/spec/samples/expected/gradient_00.png +0 -0
- data/spec/samples/expected/hand.png +0 -0
- data/spec/samples/expected/hand_pretty.png +0 -0
- data/spec/samples/expected/landscape_00.png +0 -0
- data/spec/samples/expected/layout2_00.png +0 -0
- data/spec/samples/expected/layout_00.png +0 -0
- data/spec/samples/expected/layout_builtin_hand_00.png +0 -0
- data/spec/samples/expected/layout_builtin_playing_card_00.png +0 -0
- data/spec/samples/expected/load_images_00.png +0 -0
- data/spec/samples/expected/portrait_00.png +0 -0
- data/spec/samples/expected/ranges_00.png +0 -0
- data/spec/samples/expected/sample_csv_00.png +0 -0
- data/spec/samples/expected/sample_csv_01.png +0 -0
- data/spec/samples/expected/sample_excel_00.png +0 -0
- data/spec/samples/expected/sample_excel_01.png +0 -0
- data/spec/samples/expected/sample_excel_02.png +0 -0
- data/spec/samples/expected/save_sheet_00.png +0 -0
- data/spec/samples/expected/save_sheet_01.png +0 -0
- data/spec/samples/expected/save_sheet_range_00.png +0 -0
- data/spec/samples/expected/save_sheet_range_01.png +0 -0
- data/spec/samples/expected/save_single_sheet_00.png +0 -0
- data/spec/samples/expected/saves_notrim_01.png +0 -0
- data/spec/samples/expected/shape_00.png +0 -0
- data/spec/samples/expected/showcase.png +0 -0
- data/spec/samples/expected/showcase2.png +0 -0
- data/spec/samples/expected/showcase_individual_00.png +0 -0
- data/spec/samples/expected/showcase_individual_01.png +0 -0
- data/spec/samples/expected/showcase_individual_02.png +0 -0
- data/spec/samples/expected/showcase_individual_03.png +0 -0
- data/spec/samples/expected/text_00.png +0 -0
- data/spec/samples/expected/text_01.png +0 -0
- data/spec/samples/expected/text_02.png +0 -0
- data/spec/samples/expected/tgc_sample_00.png +0 -0
- data/spec/samples/expected/units_00.png +0 -0
- data/spec/samples/run_samples_spec.rb +0 -17
- data/spec/samples/samples_regression_spec.rb +0 -71
- data/spec/samples/sanity.html.erb +0 -28
- data/spec/samples/sanity.rb +0 -70
- data/spec/sanity/.gitignore +0 -1
- data/spec/sanity/sanity.html.erb +0 -42
- data/spec/sanity/sanity_test.rb +0 -42
- data/spec/sanity/tests.yml +0 -12
- data/spec/spec_helper.rb +0 -159
data/spec/sanity/.gitignore
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
sanity.html
|
data/spec/sanity/sanity.html.erb
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html>
|
|
3
|
-
<head>
|
|
4
|
-
<meta name="viewport" content="width=device-width">
|
|
5
|
-
<meta charset="utf-8">
|
|
6
|
-
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
|
7
|
-
<title>Diff with CSS Example</title>
|
|
8
|
-
<style>
|
|
9
|
-
body{
|
|
10
|
-
/*background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAHElEQVQYlWO4ePFiAzGY4eLFiw0MxIBRhVRRCADsljgKUbBKPgAAAABJRU5ErkJggg==) repeat;*/
|
|
11
|
-
}
|
|
12
|
-
img{
|
|
13
|
-
height: 6in;
|
|
14
|
-
}
|
|
15
|
-
.diff {
|
|
16
|
-
width: 4in;
|
|
17
|
-
height: 6in;
|
|
18
|
-
background-repeat: none, none;
|
|
19
|
-
background-size: contain, contain;
|
|
20
|
-
background-blend-mode: difference;
|
|
21
|
-
display: inline-block;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
</style>
|
|
25
|
-
</head>
|
|
26
|
-
<body>
|
|
27
|
-
|
|
28
|
-
<% images.each_with_index do |(expected, actual), i| %>
|
|
29
|
-
|
|
30
|
-
<img src="<%= expected %>"/>
|
|
31
|
-
<img src="<%= actual %>"/>
|
|
32
|
-
<style>
|
|
33
|
-
.mine<%= i %> {
|
|
34
|
-
background-image: url(<%= expected %>), url(<%= actual %>);"
|
|
35
|
-
}
|
|
36
|
-
</style>
|
|
37
|
-
<div class="diff mine<%= i %>"/>
|
|
38
|
-
|
|
39
|
-
<% end %>
|
|
40
|
-
|
|
41
|
-
</body>
|
|
42
|
-
</html>
|
data/spec/sanity/sanity_test.rb
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
require 'launchy'
|
|
2
|
-
require 'erb'
|
|
3
|
-
require 'yaml'
|
|
4
|
-
|
|
5
|
-
# An pixel-by-pixel comparison of sample images for visual regression testing
|
|
6
|
-
class SanityTest
|
|
7
|
-
|
|
8
|
-
@@ERB = "#{File.expand_path(File.dirname(__FILE__))}/sanity.html.erb"
|
|
9
|
-
@@HTML = "#{File.expand_path(File.dirname(__FILE__))}/sanity.html"
|
|
10
|
-
@@COMPARES = "#{File.expand_path(File.dirname(__FILE__))}/tests.yml"
|
|
11
|
-
@@SAMPLES = "file:///#{File.expand_path("samples/")}"
|
|
12
|
-
|
|
13
|
-
def images
|
|
14
|
-
require 'pp'
|
|
15
|
-
comps = YAML.load_file(@@COMPARES)
|
|
16
|
-
pp comps
|
|
17
|
-
comps.each do | test, data |
|
|
18
|
-
pp data
|
|
19
|
-
end
|
|
20
|
-
[
|
|
21
|
-
["#{@@SAMPLES}/images/_images_00_expected.png", "#{@@SAMPLES}/images/_images_00.png"]
|
|
22
|
-
]
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def run
|
|
26
|
-
puts @@SAMPLES
|
|
27
|
-
puts 'Building sanity test...'
|
|
28
|
-
process_erb(File.read(@@ERB))
|
|
29
|
-
Launchy.open('file:///' + @@HTML)
|
|
30
|
-
puts 'Done.'
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
private
|
|
34
|
-
|
|
35
|
-
def process_erb(sanity_template)
|
|
36
|
-
renderer = ERB.new(sanity_template)
|
|
37
|
-
File.open(@@HTML, 'w+') do |html|
|
|
38
|
-
html.write(renderer.result(binding))
|
|
39
|
-
end
|
|
40
|
-
end
|
|
41
|
-
|
|
42
|
-
end
|
data/spec/sanity/tests.yml
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
images:
|
|
2
|
-
dir: images
|
|
3
|
-
expected: _images_00_expected.png
|
|
4
|
-
actual: _images_00.png
|
|
5
|
-
text:
|
|
6
|
-
dir: text
|
|
7
|
-
expected: _text_00_expected.png
|
|
8
|
-
actual: _text_00.png
|
|
9
|
-
autoscale_font:
|
|
10
|
-
dir: autoscale_font
|
|
11
|
-
expected: card_00_expected.png
|
|
12
|
-
actual: card_00.png
|
data/spec/spec_helper.rb
DELETED
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
require 'simplecov'
|
|
2
|
-
require 'coveralls'
|
|
3
|
-
# require 'byebug'
|
|
4
|
-
|
|
5
|
-
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter.new([
|
|
6
|
-
SimpleCov::Formatter::HTMLFormatter,
|
|
7
|
-
Coveralls::SimpleCov::Formatter
|
|
8
|
-
])
|
|
9
|
-
SimpleCov.start
|
|
10
|
-
|
|
11
|
-
require 'squib'
|
|
12
|
-
|
|
13
|
-
RSpec.configure do |config|
|
|
14
|
-
config.mock_with :rspec do |mocks|
|
|
15
|
-
mocks.verify_partial_doubles = true
|
|
16
|
-
end
|
|
17
|
-
config.tty = true
|
|
18
|
-
config.color = true
|
|
19
|
-
end
|
|
20
|
-
|
|
21
|
-
def tmp_dir
|
|
22
|
-
"#{File.expand_path(File.dirname(__FILE__))}/../tmp"
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
def samples_dir
|
|
26
|
-
File.expand_path("#{File.dirname(__FILE__)}/../samples")
|
|
27
|
-
end
|
|
28
|
-
|
|
29
|
-
def layout_file(str)
|
|
30
|
-
"#{File.expand_path(File.dirname(__FILE__))}/data/layouts/#{str}"
|
|
31
|
-
end
|
|
32
|
-
|
|
33
|
-
def sample_file(file)
|
|
34
|
-
"#{File.expand_path(File.dirname(__FILE__))}/../samples/#{file}"
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
def sample_regression_file(file)
|
|
38
|
-
"#{File.expand_path(File.dirname(__FILE__))}/data/samples/#{file}.txt"
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
def csv_file(file)
|
|
42
|
-
"#{File.expand_path(File.dirname(__FILE__))}/data/csv/#{file}"
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
def xlsx_file(file)
|
|
46
|
-
"#{File.expand_path(File.dirname(__FILE__))}/data/xlsx/#{file}"
|
|
47
|
-
end
|
|
48
|
-
|
|
49
|
-
def project_template(file)
|
|
50
|
-
"#{File.expand_path(File.dirname(__FILE__))}/../lib/squib/project_template/#{file}"
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
def conf(file)
|
|
54
|
-
"#{File.expand_path(File.dirname(__FILE__))}/data/conf/#{file}"
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
def overwrite_sample(sample_name, log)
|
|
58
|
-
# Use this to overwrite the regression with current state
|
|
59
|
-
File.open(sample_regression_file(sample_name), 'w+:UTF-8') do |f|
|
|
60
|
-
f.write(log.string)
|
|
61
|
-
end
|
|
62
|
-
end
|
|
63
|
-
|
|
64
|
-
def scrub_hex(str)
|
|
65
|
-
str.gsub(/0x\w{1,8}/, '')
|
|
66
|
-
.gsub(/ptr=\w{1,8}/, '')
|
|
67
|
-
.gsub(/#<Pango::FontDescription:.*>/, '')
|
|
68
|
-
.gsub(/#<Pango::AttrList:.*>/, 'Pango::AttrList')
|
|
69
|
-
.gsub(/#<Cairo::ImageSurface:.*>/, 'ImageSurface')
|
|
70
|
-
.gsub(/#<Cairo::LinearPattern:.*>/, 'LinearPattern')
|
|
71
|
-
.gsub(/#<Cairo::RadialPattern:.*>/, 'RadialPattern')
|
|
72
|
-
.gsub(/#<Cairo::Matrix:.*>/, 'Matrix')
|
|
73
|
-
.gsub(/#<RSVG::Handle.*>/, 'RSVG::Handle')
|
|
74
|
-
.gsub(/#<RSpec::Mocks::Double:.*>/, 'MockDouble')
|
|
75
|
-
.gsub(/#<Double .*>/, 'MockDouble')
|
|
76
|
-
.gsub(/RGB:\w{1,8}/, 'RGB:')
|
|
77
|
-
end
|
|
78
|
-
|
|
79
|
-
# Build a mock cairo instance that allows basically any method
|
|
80
|
-
# and logs that call to the string buffer
|
|
81
|
-
def mock_cairo(strio)
|
|
82
|
-
cxt = double(Cairo::Context)
|
|
83
|
-
surface = double(Cairo::ImageSurface)
|
|
84
|
-
pango = double(Pango::Layout)
|
|
85
|
-
|
|
86
|
-
font = double(Pango::FontDescription)
|
|
87
|
-
iter = double('pango_iter')
|
|
88
|
-
pango_cxt = double('pango_cxt')
|
|
89
|
-
allow(Squib.logger).to receive(:warn) {}
|
|
90
|
-
allow(ProgressBar).to receive(:create).and_return(Squib::DoNothing.new)
|
|
91
|
-
allow(Cairo::ImageSurface).to receive(:new).and_return(surface)
|
|
92
|
-
allow(surface).to receive(:width).and_return(100)
|
|
93
|
-
allow(surface).to receive(:height).and_return(101)
|
|
94
|
-
allow(surface).to receive(:ink_extents).and_return([0, 0, 100, 100])
|
|
95
|
-
allow(Cairo::Context).to receive(:new).and_return(cxt)
|
|
96
|
-
allow(cxt).to receive(:create_pango_layout).and_return(pango)
|
|
97
|
-
allow(cxt).to receive(:target).and_return(surface)
|
|
98
|
-
allow(cxt).to receive(:matrix).and_return(Cairo::Matrix.new(1, 0, 0, 1, 0, 0))
|
|
99
|
-
allow(pango).to receive(:height).and_return(25)
|
|
100
|
-
allow(pango).to receive(:width).and_return(25)
|
|
101
|
-
allow(pango).to receive(:index_to_pos).and_return(Pango::Rectangle.new(0, 0, 0, 0))
|
|
102
|
-
allow(pango).to receive(:extents).and_return([Pango::Rectangle.new(0, 0, 0, 0)] * 2)
|
|
103
|
-
allow(pango).to receive(:iter).and_return(iter)
|
|
104
|
-
allow(pango).to receive(:alignment).and_return(Pango::Layout::Alignment::LEFT)
|
|
105
|
-
allow(pango).to receive(:text).and_return('foo')
|
|
106
|
-
allow(pango).to receive(:context).and_return(pango_cxt)
|
|
107
|
-
allow(pango).to receive(:attributes).and_return(nil)
|
|
108
|
-
allow(pango_cxt).to receive(:set_shape_renderer)
|
|
109
|
-
allow(pango_cxt).to receive(:font_options=)
|
|
110
|
-
allow(iter).to receive(:next_char!).and_return(false)
|
|
111
|
-
allow(iter).to receive(:char_extents).and_return(Pango::Rectangle.new(5, 5, 5, 5))
|
|
112
|
-
allow(iter).to receive(:index).and_return(1000)
|
|
113
|
-
allow(Pango::FontDescription).to receive(:new).and_return(font)
|
|
114
|
-
allow(Cairo::PDFSurface).to receive(:new).and_return(nil)
|
|
115
|
-
|
|
116
|
-
%w(save set_source_color paint restore translate rotate move_to
|
|
117
|
-
update_pango_layout width height show_pango_layout rounded_rectangle
|
|
118
|
-
set_line_width stroke fill set_source scale render_rsvg_handle circle
|
|
119
|
-
triangle line_to operator= show_page clip transform mask rectangle
|
|
120
|
-
reset_clip antialias= curve_to matrix= pango_layout_path stroke_preserve
|
|
121
|
-
fill_preserve close_path set_dash set_line_cap set_line_join).each do |m|
|
|
122
|
-
allow(cxt).to receive(m) { |*args| strio << scrub_hex("cairo: #{m}(#{args})\n") }
|
|
123
|
-
end
|
|
124
|
-
|
|
125
|
-
%w(font_description= text= width= height= wrap= ellipsize= alignment=
|
|
126
|
-
justify= spacing= markup= ellipsized? attributes=
|
|
127
|
-
set_shape_renderer).each do |m|
|
|
128
|
-
allow(pango).to receive(m) {|*args| strio << scrub_hex("pango: #{m}(#{args})\n") }
|
|
129
|
-
end
|
|
130
|
-
|
|
131
|
-
%w(size=).each do |m|
|
|
132
|
-
allow(font).to receive(m) { |*args| strio << scrub_hex("pango font: #{m}(#{args})\n") }
|
|
133
|
-
end
|
|
134
|
-
|
|
135
|
-
%w(write_to_png finish).each do |m|
|
|
136
|
-
allow(surface).to receive(m) { |*args| strio << scrub_hex("surface: #{m}(#{args})\n") }
|
|
137
|
-
end
|
|
138
|
-
|
|
139
|
-
%w(next_char!).each do |m|
|
|
140
|
-
allow(iter).to receive(m) { |*args| strio << scrub_hex("pango_iter: #{m}(#{args})\n") }
|
|
141
|
-
end
|
|
142
|
-
|
|
143
|
-
end
|
|
144
|
-
|
|
145
|
-
# Refine Squib to allow setting the logger and progress bar
|
|
146
|
-
module Squib
|
|
147
|
-
def logger=(l)
|
|
148
|
-
@logger = l
|
|
149
|
-
end
|
|
150
|
-
module_function :logger=
|
|
151
|
-
|
|
152
|
-
class Deck
|
|
153
|
-
attr_accessor :progress_bar
|
|
154
|
-
end
|
|
155
|
-
end
|
|
156
|
-
|
|
157
|
-
def output_dir
|
|
158
|
-
File.expand_path('../samples/_output', File.dirname(__FILE__))
|
|
159
|
-
end
|