squib 0.10.0 → 0.11.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 +6 -0
- data/CHANGELOG.md +24 -3
- data/README.md +4 -3
- data/RELEASE TODO.md +3 -1
- data/docs/_static/css/squibdocs.css +5 -0
- data/docs/conf.py +2 -2
- data/docs/config.rst +5 -0
- data/docs/dsl/ellipse.rst +6 -0
- data/docs/dsl/mm.rst +19 -0
- data/docs/dsl/rect.rst +4 -0
- data/docs/dsl/text.rst +2 -2
- data/docs/dsl/triangle.rst +20 -8
- data/docs/guides/game_icons.rst +4 -0
- data/docs/layouts.rst +55 -0
- data/docs/units.rst +1 -1
- data/lib/squib/api/background.rb +1 -1
- data/lib/squib/api/data.rb +4 -4
- data/lib/squib/api/groups.rb +4 -4
- data/lib/squib/api/image.rb +2 -2
- data/lib/squib/api/save.rb +6 -6
- data/lib/squib/api/settings.rb +4 -4
- data/lib/squib/api/shapes.rb +13 -11
- data/lib/squib/api/text.rb +1 -1
- data/lib/squib/api/text_embed.rb +4 -29
- data/lib/squib/api/units.rb +7 -2
- data/lib/squib/args/arg_loader.rb +2 -14
- data/lib/squib/args/draw.rb +1 -1
- data/lib/squib/args/hand_special.rb +37 -37
- data/lib/squib/args/unit_conversion.rb +2 -0
- data/lib/squib/deck.rb +1 -1
- data/lib/squib/graphics/embedding_utils.rb +28 -0
- data/lib/squib/graphics/shapes.rb +6 -3
- data/lib/squib/graphics/text.rb +49 -52
- data/lib/squib/layout_parser.rb +28 -9
- data/lib/squib/layouts/economy.yml +85 -85
- data/lib/squib/layouts/fantasy.yml +101 -101
- data/lib/squib/layouts/hand.yml +62 -62
- data/lib/squib/layouts/playing-card.yml +35 -35
- data/lib/squib/layouts/tuck_box.yml +45 -45
- data/lib/squib/version.rb +1 -1
- data/samples/custom-config.yml +5 -5
- data/samples/custom_config.rb +18 -18
- data/samples/embed_text.rb +27 -9
- data/samples/layouts/_output/.gitignore +2 -0
- data/samples/{layouts_builtin.rb → layouts/builtin_layouts.rb} +74 -51
- data/samples/{custom-layout.yml → layouts/custom-layout.yml} +0 -0
- data/samples/{custom-layout2.yml → layouts/custom-layout2.yml} +0 -0
- 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.rb → layouts/layouts.rb} +0 -1
- data/samples/layouts/shiny-purse.png +0 -0
- data/samples/layouts/spanner.svg +91 -0
- data/samples/offset.svg +71 -71
- data/samples/shapes/_draw_shapes.rb +8 -2
- data/spec/api/api_units_spec.rb +37 -0
- data/spec/args/embed_key_spec.rb +13 -13
- data/spec/args/showcase_special_spec.rb +15 -15
- data/spec/args/unit_conversion_spec.rb +8 -1
- data/spec/data/csv/qty.csv +2 -2
- data/spec/data/csv/qty_named.csv +2 -2
- data/spec/data/csv/with_spaces.csv +2 -2
- data/spec/data/layouts/extends-units-mixed.yml +8 -0
- data/spec/data/layouts/extends-units.yml +8 -0
- data/spec/data/samples/autoscale_font/_autoscale_font.rb.txt +9 -0
- data/spec/data/samples/basic.rb.txt +18 -0
- data/spec/data/samples/cairo_access.rb.txt +6 -0
- data/spec/data/samples/colors/_gradients.rb.txt +6 -0
- data/spec/data/samples/config_text_markup.rb.txt +72 -72
- data/spec/data/samples/data/_csv.rb.txt +12 -0
- data/spec/data/samples/data/_excel.rb.txt +30 -0
- data/spec/data/samples/embed_text.rb.txt +70 -5
- data/spec/data/samples/hello_world.rb.txt +36 -36
- data/spec/data/samples/images/_more_load_images.rb.txt +3 -0
- data/spec/data/samples/ranges.rb.txt +9 -0
- data/spec/data/samples/saves/_hand.rb.txt +48 -0
- data/spec/data/samples/saves/_saves.rb.txt +48 -0
- data/spec/data/samples/saves/_showcase.rb.txt +12 -0
- data/spec/data/samples/shapes/_draw_shapes.rb.txt +41 -0
- data/spec/data/samples/text_options.rb.txt +1155 -1125
- data/spec/data/samples/tgc_proofs.rb.txt +6 -0
- data/spec/data/samples/units.rb.txt +9 -0
- data/spec/graphics/embedding_utils_spec.rb +73 -0
- data/spec/layout_parser_spec.rb +42 -17
- data/spec/spec_helper.rb +5 -1
- data/squib.gemspec +5 -3
- metadata +61 -15
|
File without changes
|
|
File without changes
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<svg
|
|
3
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
4
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
5
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
6
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
7
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
8
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
9
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
10
|
+
viewBox="0 0 128 128"
|
|
11
|
+
id="svg2"
|
|
12
|
+
version="1.1"
|
|
13
|
+
inkscape:version="0.48.3.1 r9886"
|
|
14
|
+
width="100%"
|
|
15
|
+
height="100%"
|
|
16
|
+
sodipodi:docname="spanner.svg">
|
|
17
|
+
<metadata
|
|
18
|
+
id="metadata18">
|
|
19
|
+
<rdf:RDF>
|
|
20
|
+
<cc:Work
|
|
21
|
+
rdf:about="">
|
|
22
|
+
<dc:format>image/svg+xml</dc:format>
|
|
23
|
+
<dc:type
|
|
24
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
25
|
+
</cc:Work>
|
|
26
|
+
</rdf:RDF>
|
|
27
|
+
</metadata>
|
|
28
|
+
<defs
|
|
29
|
+
id="defs16" />
|
|
30
|
+
<sodipodi:namedview
|
|
31
|
+
pagecolor="#ffffff"
|
|
32
|
+
bordercolor="#666666"
|
|
33
|
+
borderopacity="1"
|
|
34
|
+
objecttolerance="10"
|
|
35
|
+
gridtolerance="10"
|
|
36
|
+
guidetolerance="10"
|
|
37
|
+
inkscape:pageopacity="0"
|
|
38
|
+
inkscape:pageshadow="2"
|
|
39
|
+
inkscape:window-width="1280"
|
|
40
|
+
inkscape:window-height="1002"
|
|
41
|
+
id="namedview14"
|
|
42
|
+
showgrid="false"
|
|
43
|
+
inkscape:zoom="2.8284271"
|
|
44
|
+
inkscape:cx="98.928938"
|
|
45
|
+
inkscape:cy="62.194589"
|
|
46
|
+
inkscape:window-x="1912"
|
|
47
|
+
inkscape:window-y="-8"
|
|
48
|
+
inkscape:window-maximized="1"
|
|
49
|
+
inkscape:current-layer="g3767"
|
|
50
|
+
inkscape:document-units="in"
|
|
51
|
+
units="px"
|
|
52
|
+
showguides="true"
|
|
53
|
+
inkscape:guide-bbox="true" />
|
|
54
|
+
<g
|
|
55
|
+
id="g3767"
|
|
56
|
+
transform="matrix(0.24961486,0,0,0.24961486,0.197194,96.049335)">
|
|
57
|
+
<rect
|
|
58
|
+
ry="67.108368"
|
|
59
|
+
y="-378.68747"
|
|
60
|
+
x="5.3126979"
|
|
61
|
+
height="501.3746"
|
|
62
|
+
width="501.3746"
|
|
63
|
+
id="backdrop"
|
|
64
|
+
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:#000000;stroke-width:10.62539577;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0"
|
|
65
|
+
inkscape:label="#rect3765" />
|
|
66
|
+
<path
|
|
67
|
+
style="fill:#000000;fill-opacity:1;fill-rule:nonzero;stroke:none"
|
|
68
|
+
d="M 36.267098,-7.709219 C 16.393265,5.1318032 3.2161811,27.462365 3.2161811,52.884128 c 0,39.825874 32.2852369,72.111092 72.1110909,72.111092 23.870397,0 44.964938,-11.67699 58.089488,-29.545518 -11.26063,7.275808 -24.65607,11.517748 -39.060173,11.517748 -39.825853,0 -72.11109,-32.285221 -72.11109,-72.111095 0,-15.95546 5.248882,-30.6218942 14.021601,-42.565574 z"
|
|
69
|
+
id="path3790"
|
|
70
|
+
inkscape:connector-curvature="0" />
|
|
71
|
+
<g
|
|
72
|
+
id="g6"
|
|
73
|
+
transform="matrix(18.68858,0,0,18.68858,-3385.6437,-2608.3849)">
|
|
74
|
+
<path
|
|
75
|
+
style="fill:#ffffff"
|
|
76
|
+
inkscape:connector-curvature="0"
|
|
77
|
+
id="path8"
|
|
78
|
+
d="m 192.2325,129.3203 -10,10 v 5.5625 h 5.375 l 10.0938,-10.0938 -5.4688,-5.4688 z" />
|
|
79
|
+
<path
|
|
80
|
+
style="fill:#ffffff;stroke:#000000"
|
|
81
|
+
inkscape:connector-curvature="0"
|
|
82
|
+
id="path10"
|
|
83
|
+
d="m 181.7796,141.8591 15.6196,-15.6178 m 3.349,3.3486 -15.8051,15.8032" />
|
|
84
|
+
<path
|
|
85
|
+
style="fill:#ffffff"
|
|
86
|
+
inkscape:connector-curvature="0"
|
|
87
|
+
id="path12"
|
|
88
|
+
d="m 201.2023,119.7104 c -2.8283,-0.73 -5.9623,-0.004 -8.1759,2.2097 -3.3293,3.3292 -3.3293,8.7358 -2e-5,12.065 3.32928,3.3292 8.7358,3.3292 12.065,0 2.216,-2.216 2.9436,-5.3452 2.2097,-8.1759 l -5.6348,5.6348 -4.8172,-1.2816 -1.2816,-4.8171 5.6348,-5.6348 z" />
|
|
89
|
+
</g>
|
|
90
|
+
</g>
|
|
91
|
+
</svg>
|
data/samples/offset.svg
CHANGED
|
@@ -1,71 +1,71 @@
|
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
-
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
-
|
|
4
|
-
<svg
|
|
5
|
-
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
6
|
-
xmlns:cc="http://creativecommons.org/ns#"
|
|
7
|
-
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
8
|
-
xmlns:svg="http://www.w3.org/2000/svg"
|
|
9
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
-
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
11
|
-
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
-
width="747.59235"
|
|
13
|
-
height="747.39734"
|
|
14
|
-
id="svg2"
|
|
15
|
-
version="1.1"
|
|
16
|
-
inkscape:version="0.48.5 r10040"
|
|
17
|
-
sodipodi:docname="offset.svg">
|
|
18
|
-
<defs
|
|
19
|
-
id="defs4" />
|
|
20
|
-
<sodipodi:namedview
|
|
21
|
-
id="base"
|
|
22
|
-
pagecolor="#ffffff"
|
|
23
|
-
bordercolor="#666666"
|
|
24
|
-
borderopacity="1.0"
|
|
25
|
-
inkscape:pageopacity="0.0"
|
|
26
|
-
inkscape:pageshadow="2"
|
|
27
|
-
inkscape:zoom="0.76264655"
|
|
28
|
-
inkscape:cx="373.79617"
|
|
29
|
-
inkscape:cy="373.69867"
|
|
30
|
-
inkscape:document-units="px"
|
|
31
|
-
inkscape:current-layer="layer1"
|
|
32
|
-
showgrid="false"
|
|
33
|
-
inkscape:window-width="1440"
|
|
34
|
-
inkscape:window-height="776"
|
|
35
|
-
inkscape:window-x="0"
|
|
36
|
-
inkscape:window-y="0"
|
|
37
|
-
inkscape:window-maximized="1"
|
|
38
|
-
fit-margin-top="0"
|
|
39
|
-
fit-margin-left="0"
|
|
40
|
-
fit-margin-right="0"
|
|
41
|
-
fit-margin-bottom="0" />
|
|
42
|
-
<metadata
|
|
43
|
-
id="metadata7">
|
|
44
|
-
<rdf:RDF>
|
|
45
|
-
<cc:Work
|
|
46
|
-
rdf:about="">
|
|
47
|
-
<dc:format>image/svg+xml</dc:format>
|
|
48
|
-
<dc:type
|
|
49
|
-
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
50
|
-
<dc:title />
|
|
51
|
-
</cc:Work>
|
|
52
|
-
</rdf:RDF>
|
|
53
|
-
</metadata>
|
|
54
|
-
<g
|
|
55
|
-
inkscape:label="Layer 1"
|
|
56
|
-
inkscape:groupmode="layer"
|
|
57
|
-
id="layer1"
|
|
58
|
-
transform="translate(5.1573995,-302.70286)">
|
|
59
|
-
<path
|
|
60
|
-
sodipodi:type="arc"
|
|
61
|
-
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
62
|
-
id="thing"
|
|
63
|
-
sodipodi:cx="159.99248"
|
|
64
|
-
sodipodi:cy="152.67546"
|
|
65
|
-
sodipodi:rx="59.401001"
|
|
66
|
-
sodipodi:ry="59.401001"
|
|
67
|
-
d="m 219.39348,152.67546 c 0,32.80627 -26.59474,59.401 -59.401,59.401 -32.80627,0 -59.401,-26.59473 -59.401,-59.401 0,-32.80627 26.59473,-59.401 59.401,-59.401 32.80626,0 59.401,26.59473 59.401,59.401 z"
|
|
68
|
-
transform="matrix(0.95784259,0,0,0.95784259,531.73189,844.72627)"
|
|
69
|
-
inkscape:label="thing" />
|
|
70
|
-
</g>
|
|
71
|
-
</svg>
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
2
|
+
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
3
|
+
|
|
4
|
+
<svg
|
|
5
|
+
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
6
|
+
xmlns:cc="http://creativecommons.org/ns#"
|
|
7
|
+
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
|
8
|
+
xmlns:svg="http://www.w3.org/2000/svg"
|
|
9
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
10
|
+
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
|
11
|
+
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
|
12
|
+
width="747.59235"
|
|
13
|
+
height="747.39734"
|
|
14
|
+
id="svg2"
|
|
15
|
+
version="1.1"
|
|
16
|
+
inkscape:version="0.48.5 r10040"
|
|
17
|
+
sodipodi:docname="offset.svg">
|
|
18
|
+
<defs
|
|
19
|
+
id="defs4" />
|
|
20
|
+
<sodipodi:namedview
|
|
21
|
+
id="base"
|
|
22
|
+
pagecolor="#ffffff"
|
|
23
|
+
bordercolor="#666666"
|
|
24
|
+
borderopacity="1.0"
|
|
25
|
+
inkscape:pageopacity="0.0"
|
|
26
|
+
inkscape:pageshadow="2"
|
|
27
|
+
inkscape:zoom="0.76264655"
|
|
28
|
+
inkscape:cx="373.79617"
|
|
29
|
+
inkscape:cy="373.69867"
|
|
30
|
+
inkscape:document-units="px"
|
|
31
|
+
inkscape:current-layer="layer1"
|
|
32
|
+
showgrid="false"
|
|
33
|
+
inkscape:window-width="1440"
|
|
34
|
+
inkscape:window-height="776"
|
|
35
|
+
inkscape:window-x="0"
|
|
36
|
+
inkscape:window-y="0"
|
|
37
|
+
inkscape:window-maximized="1"
|
|
38
|
+
fit-margin-top="0"
|
|
39
|
+
fit-margin-left="0"
|
|
40
|
+
fit-margin-right="0"
|
|
41
|
+
fit-margin-bottom="0" />
|
|
42
|
+
<metadata
|
|
43
|
+
id="metadata7">
|
|
44
|
+
<rdf:RDF>
|
|
45
|
+
<cc:Work
|
|
46
|
+
rdf:about="">
|
|
47
|
+
<dc:format>image/svg+xml</dc:format>
|
|
48
|
+
<dc:type
|
|
49
|
+
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
|
50
|
+
<dc:title />
|
|
51
|
+
</cc:Work>
|
|
52
|
+
</rdf:RDF>
|
|
53
|
+
</metadata>
|
|
54
|
+
<g
|
|
55
|
+
inkscape:label="Layer 1"
|
|
56
|
+
inkscape:groupmode="layer"
|
|
57
|
+
id="layer1"
|
|
58
|
+
transform="translate(5.1573995,-302.70286)">
|
|
59
|
+
<path
|
|
60
|
+
sodipodi:type="arc"
|
|
61
|
+
style="fill:#000000;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
62
|
+
id="thing"
|
|
63
|
+
sodipodi:cx="159.99248"
|
|
64
|
+
sodipodi:cy="152.67546"
|
|
65
|
+
sodipodi:rx="59.401001"
|
|
66
|
+
sodipodi:ry="59.401001"
|
|
67
|
+
d="m 219.39348,152.67546 c 0,32.80627 -26.59474,59.401 -59.401,59.401 -32.80627,0 -59.401,-26.59473 -59.401,-59.401 0,-32.80627 26.59473,-59.401 59.401,-59.401 32.80626,0 59.401,26.59473 59.401,59.401 z"
|
|
68
|
+
transform="matrix(0.95784259,0,0,0.95784259,531.73189,844.72627)"
|
|
69
|
+
inkscape:label="thing" />
|
|
70
|
+
</g>
|
|
71
|
+
</svg>
|
|
@@ -3,8 +3,8 @@ require 'squib'
|
|
|
3
3
|
Squib::Deck.new do
|
|
4
4
|
background color: :white
|
|
5
5
|
|
|
6
|
-
grid x: 10, y: 10, width: 50, height: 50, stroke_color: '#0066FF', stroke_width: 1.5
|
|
7
|
-
grid x: 10, y: 10, width: 200, height: 200, stroke_color: '#0066FF', stroke_width: 3
|
|
6
|
+
grid x: 10, y: 10, width: 50, height: 50, stroke_color: '#0066FF', stroke_width: 1.5, angle: 0.1
|
|
7
|
+
grid x: 10, y: 10, width: 200, height: 200, stroke_color: '#0066FF', stroke_width: 3, angle: 0.1
|
|
8
8
|
|
|
9
9
|
rect x: 305, y: 105, width: 200, height: 50, dash: '4 2'
|
|
10
10
|
|
|
@@ -12,6 +12,12 @@ Squib::Deck.new do
|
|
|
12
12
|
fill_color: :blue, stroke_color: :red, stroke_width: 50.0,
|
|
13
13
|
join: 'bevel'
|
|
14
14
|
|
|
15
|
+
rect x: 550, y: 105, width: 100, height: 100,
|
|
16
|
+
stroke_width: 5, stroke_color: :orange, angle: -0.2
|
|
17
|
+
|
|
18
|
+
ellipse x: 675, y: 105, width: 65, height: 100,
|
|
19
|
+
stroke_width: 5, stroke_color: :orange, angle: -0.2
|
|
20
|
+
|
|
15
21
|
circle x: 600, y: 600, radius: 75,
|
|
16
22
|
fill_color: :gray, stroke_color: :green, stroke_width: 8.0
|
|
17
23
|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
|
|
3
|
+
describe Squib::Deck do
|
|
4
|
+
|
|
5
|
+
let(:deck) { Squib::Deck.new }
|
|
6
|
+
|
|
7
|
+
context '#in' do
|
|
8
|
+
it 'converts inches properly' do
|
|
9
|
+
expect(deck.inches(1)).to eq 300
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
it 'handles strings too' do
|
|
13
|
+
expect(deck.inches('1')).to eq 300
|
|
14
|
+
end
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
context '#cm' do
|
|
18
|
+
it 'converts inches properly' do
|
|
19
|
+
expect(deck.cm(1)).to eq 118.1102361
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
it 'handles strings too' do
|
|
23
|
+
expect(deck.cm('1')).to eq 118.1102361
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
context '#mm' do
|
|
28
|
+
it 'converts inches properly' do
|
|
29
|
+
expect(deck.mm(1)).to eq 11.81102361
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
it 'handles strings too' do
|
|
33
|
+
expect(deck.mm('1')).to eq 11.81102361
|
|
34
|
+
end
|
|
35
|
+
end
|
|
36
|
+
|
|
37
|
+
end
|
data/spec/args/embed_key_spec.rb
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'squib/args/embed_key'
|
|
3
|
-
|
|
4
|
-
describe Squib::Args::EmbedKey do
|
|
5
|
-
|
|
6
|
-
context '#validate_key' do
|
|
7
|
-
|
|
8
|
-
it 'converts to string' do
|
|
9
|
-
expect(subject.validate_key(2.5)).to eq ('2.5')
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
end
|
|
13
|
-
end
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'squib/args/embed_key'
|
|
3
|
+
|
|
4
|
+
describe Squib::Args::EmbedKey do
|
|
5
|
+
|
|
6
|
+
context '#validate_key' do
|
|
7
|
+
|
|
8
|
+
it 'converts to string' do
|
|
9
|
+
expect(subject.validate_key(2.5)).to eq ('2.5')
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
require 'spec_helper'
|
|
2
|
-
require 'squib/args/showcase_special'
|
|
3
|
-
|
|
4
|
-
describe Squib::Args::ShowcaseSpecial do
|
|
5
|
-
subject(:showcase_special) { Squib::Args::ShowcaseSpecial.new }
|
|
6
|
-
|
|
7
|
-
context '#face_right?' do
|
|
8
|
-
it 'compares face to right' do
|
|
9
|
-
opts = { face: 'LEFT ' }
|
|
10
|
-
showcase_special.load! opts
|
|
11
|
-
expect(showcase_special.face_right?).to be false
|
|
12
|
-
end
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
end
|
|
1
|
+
require 'spec_helper'
|
|
2
|
+
require 'squib/args/showcase_special'
|
|
3
|
+
|
|
4
|
+
describe Squib::Args::ShowcaseSpecial do
|
|
5
|
+
subject(:showcase_special) { Squib::Args::ShowcaseSpecial.new }
|
|
6
|
+
|
|
7
|
+
context '#face_right?' do
|
|
8
|
+
it 'compares face to right' do
|
|
9
|
+
opts = { face: 'LEFT ' }
|
|
10
|
+
showcase_special.load! opts
|
|
11
|
+
expect(showcase_special.face_right?).to be false
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
end
|
|
@@ -15,8 +15,15 @@ describe Squib::Args::UnitConversion do
|
|
|
15
15
|
expect(subject.parse('1 in')).to eq(300)
|
|
16
16
|
end
|
|
17
17
|
|
|
18
|
-
it 'does cm'
|
|
18
|
+
it 'does cm' do
|
|
19
19
|
expect(subject.parse('1cm')).to eq(118.1102361)
|
|
20
|
+
expect(subject.parse('1cm ')).to eq(118.1102361)
|
|
20
21
|
end
|
|
21
22
|
|
|
23
|
+
it 'does mm' do
|
|
24
|
+
expect(subject.parse('1mm')).to eq(11.81102361)
|
|
25
|
+
expect(subject.parse('1mm ')).to eq(11.81102361)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
|
|
22
29
|
end
|
data/spec/data/csv/qty.csv
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Name,Qty
|
|
2
|
-
Ha, 3
|
|
1
|
+
Name,Qty
|
|
2
|
+
Ha, 3
|
|
3
3
|
Ho, 1
|
data/spec/data/csv/qty_named.csv
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
Name,Quantity
|
|
2
|
-
Ha, 3
|
|
1
|
+
Name,Quantity
|
|
2
|
+
Ha, 3
|
|
3
3
|
Ho, 1
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
With Spaces ,h2,h3
|
|
2
|
-
a b c , 2,3
|
|
1
|
+
With Spaces ,h2,h3
|
|
2
|
+
a b c , 2,3
|
|
3
3
|
3 ,4
|
|
@@ -14,6 +14,9 @@ cairo: set_source_color(["white"])
|
|
|
14
14
|
cairo: paint([])
|
|
15
15
|
cairo: restore([])
|
|
16
16
|
cairo: save([])
|
|
17
|
+
cairo: translate([0, 0])
|
|
18
|
+
cairo: rotate([0])
|
|
19
|
+
cairo: translate([0, 0])
|
|
17
20
|
cairo: rounded_rectangle([0, 0, 300, 100, 0, 0])
|
|
18
21
|
cairo: set_source_color(["#0000"])
|
|
19
22
|
cairo: fill_preserve([])
|
|
@@ -25,6 +28,9 @@ cairo: set_dash([[]])
|
|
|
25
28
|
cairo: stroke([])
|
|
26
29
|
cairo: restore([])
|
|
27
30
|
cairo: save([])
|
|
31
|
+
cairo: translate([0, 0])
|
|
32
|
+
cairo: rotate([0])
|
|
33
|
+
cairo: translate([0, 0])
|
|
28
34
|
cairo: rounded_rectangle([0, 0, 300, 100, 0, 0])
|
|
29
35
|
cairo: set_source_color(["#0000"])
|
|
30
36
|
cairo: fill_preserve([])
|
|
@@ -36,6 +42,9 @@ cairo: set_dash([[]])
|
|
|
36
42
|
cairo: stroke([])
|
|
37
43
|
cairo: restore([])
|
|
38
44
|
cairo: save([])
|
|
45
|
+
cairo: translate([0, 0])
|
|
46
|
+
cairo: rotate([0])
|
|
47
|
+
cairo: translate([0, 0])
|
|
39
48
|
cairo: rounded_rectangle([0, 0, 300, 100, 0, 0])
|
|
40
49
|
cairo: set_source_color(["#0000"])
|
|
41
50
|
cairo: fill_preserve([])
|