sevgi-showcase 0.94.0 → 0.98.2
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/CHANGELOG.md +275 -2
- data/LICENSE +672 -3
- data/README.md +9 -17
- data/lib/sevgi/showcase/dark.rb +4 -0
- data/lib/sevgi/showcase/minitest/script.rb +59 -57
- data/lib/sevgi/showcase/minitest/shell.rb +136 -113
- data/lib/sevgi/showcase/minitest/suite.rb +48 -46
- data/lib/sevgi/showcase/minitest.rb +6 -0
- data/lib/sevgi/showcase/version.rb +1 -1
- data/lib/sevgi/showcase.rb +1 -2
- data/srv/checkers.sevgi +79 -0
- data/srv/checkers.svg +117 -0
- data/srv/clover.sevgi +19 -0
- data/srv/clover.svg +11 -0
- data/srv/clover.yml +3 -0
- data/srv/copperplate.sevgi +50 -0
- data/srv/copperplate.svg +99 -0
- data/srv/copperplate.yml +5 -0
- data/srv/{gear-wheel.sevgi → gear.sevgi} +7 -9
- data/srv/gear.svg +11 -0
- data/srv/gear.yml +2 -0
- data/srv/{grid-cells.sevgi → grid.sevgi} +9 -9
- data/srv/{grid-cells.svg → grid.svg} +13 -1
- data/srv/heart.sevgi +17 -0
- data/srv/{heart-mask.svg → heart.svg} +3 -3
- data/srv/heart.yml +3 -0
- data/srv/logo.sevgi +39 -0
- data/srv/logo.svg +29 -0
- data/srv/logo.yml +4 -0
- data/srv/logos.sevgi +34 -0
- data/srv/logos.svg +38 -0
- data/srv/logos.yml +4 -0
- data/srv/{meter-face.sevgi → meter.sevgi} +6 -6
- data/srv/meter.svg +18 -0
- data/srv/pacman.sevgi +18 -0
- data/srv/pacman.svg +15 -0
- data/srv/pokey.sevgi +14 -0
- data/srv/pokey.svg +6 -0
- data/srv/{ruler-line.sevgi → ruler-.sevgi} +7 -7
- data/srv/ruler.sevgi +61 -0
- data/srv/ruler.svg +445 -0
- data/srv/{snow-flake.sevgi → snowflake.sevgi} +2 -2
- data/srv/{snow-flake.svg → snowflake.svg} +1 -1
- data/srv/snowflake.yml +2 -0
- data/srv/squared.sevgi +42 -0
- data/srv/squared.svg +71 -0
- data/srv/squared.yml +4 -0
- data/srv/stars.sevgi +19 -0
- data/srv/stars.svg +30 -0
- data/srv/stars.yml +3 -0
- data/srv/tulips.sevgi +27 -0
- data/srv/tulips.svg +19 -0
- data/srv/tulips.yml +3 -0
- metadata +57 -36
- data/srv/checker-board.sevgi +0 -96
- data/srv/checker-board.svg +0 -117
- data/srv/gear-wheel.svg +0 -12
- data/srv/gear-wheel.yml +0 -3
- data/srv/heart-mask.sevgi +0 -17
- data/srv/heart-mask.yml +0 -3
- data/srv/meter-face.svg +0 -13
- data/srv/pacman-pokey.sevgi +0 -17
- data/srv/pacman-pokey.svg +0 -9
- data/srv/pacman-single.sevgi +0 -17
- data/srv/pacman-single.svg +0 -14
- data/srv/ruler-hline.sevgi +0 -55
- data/srv/ruler-hline.svg +0 -443
- data/srv/snow-flake.yml +0 -1
- /data/srv/{checker-board.yml → checkers.yml} +0 -0
- /data/srv/{grid-cells.yml → grid.yml} +0 -0
- /data/srv/{meter-face.yml → meter.yml} +0 -0
- /data/srv/{pacman-pokey.yml → pacman.yml} +0 -0
- /data/srv/{pacman-single.yml → pokey.yml} +0 -0
- /data/srv/{ruler-line.svg → ruler-.svg} +0 -0
- /data/srv/{ruler-hline.yml → ruler-.yml} +0 -0
- /data/srv/{ruler-line.yml → ruler.yml} +0 -0
data/srv/logos.sevgi
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
#!/usr/bin/env -S ruby -S sevgi
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
logo = Decompile <<~SVG, id: "Mark"
|
|
5
|
+
<svg xmlns="http://www.w3.org/2000/svg">
|
|
6
|
+
<g id="Mark">
|
|
7
|
+
<path id="Logo" d="m 30,30 c 0,0 18.39,7.089444 18.39,15 C 48.39,52.910556 30,60 30,60 M 30,0 C 30,0 11.61,7.089442 11.61,14.999998 C 11.61,22.910556 30,30 30,30" fill="none"/>
|
|
8
|
+
<use id="SCVN" href="#Logo" class="passive" transform="matrix(-1,0,0,1,60,0)"/>
|
|
9
|
+
<use id="SCVP" href="#Logo" class="active"/>
|
|
10
|
+
</g>
|
|
11
|
+
</svg>
|
|
12
|
+
SVG
|
|
13
|
+
|
|
14
|
+
STYLE = {
|
|
15
|
+
".active" => {
|
|
16
|
+
fill: "none", stroke: "purple", "stroke-linecap": "round", "stroke-width": 2.0
|
|
17
|
+
},
|
|
18
|
+
".passive" => {
|
|
19
|
+
fill: "none", stroke: "lightgrey", "stroke-linecap": "round", "stroke-width": 2.0
|
|
20
|
+
}
|
|
21
|
+
}.freeze
|
|
22
|
+
|
|
23
|
+
opacities = [0.8, 0.86, 0.92, 0.97, 1.0].freeze
|
|
24
|
+
fade = proc do |tile, x:, y:, **|
|
|
25
|
+
tile[:opacity] = opacities.fetch(x + y)
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
SVG :minimal, width: 260, height: 135, viewBox: "0 0 260 135" do
|
|
29
|
+
css STYLE
|
|
30
|
+
rect width: 260, height: 135, fill: "white"
|
|
31
|
+
|
|
32
|
+
defs { logo.evaluate self }
|
|
33
|
+
Tile "Mark", nx: 4, dx: 65, ox: 5, ny: 2, dy: 65, oy: 5, proc: fade
|
|
34
|
+
end.Save
|
data/srv/logos.svg
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<svg width="260" height="135" viewBox="0 0 260 135">
|
|
2
|
+
<style type="text/css">
|
|
3
|
+
<![CDATA[
|
|
4
|
+
.active {
|
|
5
|
+
fill: none;
|
|
6
|
+
stroke: purple;
|
|
7
|
+
stroke-linecap: round;
|
|
8
|
+
stroke-width: 2.0;
|
|
9
|
+
}
|
|
10
|
+
.passive {
|
|
11
|
+
fill: none;
|
|
12
|
+
stroke: lightgrey;
|
|
13
|
+
stroke-linecap: round;
|
|
14
|
+
stroke-width: 2.0;
|
|
15
|
+
}
|
|
16
|
+
]]>
|
|
17
|
+
</style>
|
|
18
|
+
<rect width="260" height="135" fill="white"/>
|
|
19
|
+
<defs>
|
|
20
|
+
<g id="Mark" xmlns="http://www.w3.org/2000/svg">
|
|
21
|
+
<path
|
|
22
|
+
id="Logo"
|
|
23
|
+
d="m 30,30 c 0,0 18.39,7.089444 18.39,15 C 48.39,52.910556 30,60 30,60 M 30,0 C 30,0 11.61,7.089442 11.61,14.999998 C 11.61,22.910556 30,30 30,30"
|
|
24
|
+
fill="none"
|
|
25
|
+
/>
|
|
26
|
+
<use id="SCVN" href="#Logo" class="passive" transform="matrix(-1,0,0,1,60,0)"/>
|
|
27
|
+
<use id="SCVP" href="#Logo" class="active"/>
|
|
28
|
+
</g>
|
|
29
|
+
</defs>
|
|
30
|
+
<use id="Mark-1-1" href="#Mark" class="tile-row-1 tile-row-first tile-col-1 tile-col-first" x="5" y="5" opacity="0.8"/>
|
|
31
|
+
<use id="Mark-1-2" href="#Mark" class="tile-row-1 tile-row-first tile-col-2" x="70" y="5" opacity="0.86"/>
|
|
32
|
+
<use id="Mark-1-3" href="#Mark" class="tile-row-1 tile-row-first tile-col-3" x="135" y="5" opacity="0.92"/>
|
|
33
|
+
<use id="Mark-1-4" href="#Mark" class="tile-row-1 tile-row-first tile-col-4 tile-col-last" x="200" y="5" opacity="0.97"/>
|
|
34
|
+
<use id="Mark-2-1" href="#Mark" class="tile-row-2 tile-row-last tile-col-1 tile-col-first" x="5" y="70" opacity="0.86"/>
|
|
35
|
+
<use id="Mark-2-2" href="#Mark" class="tile-row-2 tile-row-last tile-col-2" x="70" y="70" opacity="0.92"/>
|
|
36
|
+
<use id="Mark-2-3" href="#Mark" class="tile-row-2 tile-row-last tile-col-3" x="135" y="70" opacity="0.97"/>
|
|
37
|
+
<use id="Mark-2-4" href="#Mark" class="tile-row-2 tile-row-last tile-col-4 tile-col-last" x="200" y="70" opacity="1.0"/>
|
|
38
|
+
</svg>
|
data/srv/logos.yml
ADDED
|
@@ -6,15 +6,15 @@ LED_GAP = 2
|
|
|
6
6
|
LED_WIDTH = 10
|
|
7
7
|
TOTAL_WIDTH = (LED_COUNT * (LED_WIDTH + LED_GAP)) + 8
|
|
8
8
|
|
|
9
|
+
dim = proc do |led, x:, **|
|
|
10
|
+
led[:"fill-opacity"] = 0.3 if x >= 7
|
|
11
|
+
end
|
|
12
|
+
|
|
9
13
|
SVG :minimal, width: TOTAL_WIDTH, height: 30, viewBox: "0 0 #{TOTAL_WIDTH} 30" do
|
|
10
14
|
rect x: 2, y: 2, width: TOTAL_WIDTH - 4, height: 26,
|
|
11
15
|
rx: 4, fill: "none", stroke: "#666"
|
|
12
16
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
rect x:, y: 5, width: LED_WIDTH, height: 20,
|
|
16
|
-
rx: 3, fill: "green", "fill-opacity": (i < 7 ? 1 : 0.3)
|
|
17
|
-
|
|
18
|
-
x += LED_WIDTH + LED_GAP
|
|
17
|
+
TileX "led", n: LED_COUNT, d: LED_WIDTH + LED_GAP, o: 5, proc: dim do
|
|
18
|
+
rect y: 5, width: LED_WIDTH, height: 20, rx: 3, fill: "green"
|
|
19
19
|
end
|
|
20
20
|
end.Save
|
data/srv/meter.svg
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<svg width="128" height="30" viewBox="0 0 128 30">
|
|
2
|
+
<rect x="2" y="2" width="124" height="26" rx="4" fill="none" stroke="#666"/>
|
|
3
|
+
<defs>
|
|
4
|
+
<g id="led">
|
|
5
|
+
<rect y="5" width="10" height="20" rx="3" fill="green"/>
|
|
6
|
+
</g>
|
|
7
|
+
</defs>
|
|
8
|
+
<use id="led-1" href="#led" class="tile-col-1 tile-col-first" x="5"/>
|
|
9
|
+
<use id="led-2" href="#led" class="tile-col-2" x="17"/>
|
|
10
|
+
<use id="led-3" href="#led" class="tile-col-3" x="29"/>
|
|
11
|
+
<use id="led-4" href="#led" class="tile-col-4" x="41"/>
|
|
12
|
+
<use id="led-5" href="#led" class="tile-col-5" x="53"/>
|
|
13
|
+
<use id="led-6" href="#led" class="tile-col-6" x="65"/>
|
|
14
|
+
<use id="led-7" href="#led" class="tile-col-7" x="77"/>
|
|
15
|
+
<use id="led-8" href="#led" class="tile-col-8" x="89" fill-opacity="0.3"/>
|
|
16
|
+
<use id="led-9" href="#led" class="tile-col-9" x="101" fill-opacity="0.3"/>
|
|
17
|
+
<use id="led-10" href="#led" class="tile-col-10 tile-col-last" x="113" fill-opacity="0.3"/>
|
|
18
|
+
</svg>
|
data/srv/pacman.sevgi
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
#!/usr/bin/env -S ruby -S sevgi
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
SVG :minimal, width: 180, height: 90 do
|
|
5
|
+
rect id: "frame", width: 180, height: 90, rx: 5, fill: "white"
|
|
6
|
+
|
|
7
|
+
circle id: "head", cx: 70, cy: 45, r: 40, fill: "purple"
|
|
8
|
+
circle id: "eye", cx: 80, cy: 23, r: 6, fill: "white"
|
|
9
|
+
polygon id: "mouth", points: %w[70,45 110,15 110,75], fill: "white"
|
|
10
|
+
|
|
11
|
+
Symbol "dot" do
|
|
12
|
+
circle cx: 110, cy: 45, r: 6, fill: "purple"
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
g id: "dots" do
|
|
16
|
+
TileX "dot", n: 3, d: 18
|
|
17
|
+
end
|
|
18
|
+
end.Save
|
data/srv/pacman.svg
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<svg width="180" height="90">
|
|
2
|
+
<rect id="frame" width="180" height="90" rx="5" fill="white"/>
|
|
3
|
+
<circle id="head" cx="70" cy="45" r="40" fill="purple"/>
|
|
4
|
+
<circle id="eye" cx="80" cy="23" r="6" fill="white"/>
|
|
5
|
+
<polygon id="mouth" points="70,45 110,15 110,75" fill="white"/>
|
|
6
|
+
<symbol id="dot">
|
|
7
|
+
<title>Dot</title>
|
|
8
|
+
<circle cx="110" cy="45" r="6" fill="purple"/>
|
|
9
|
+
</symbol>
|
|
10
|
+
<g id="dots">
|
|
11
|
+
<use id="dot-1" href="#dot" class="tile-col-1 tile-col-first"/>
|
|
12
|
+
<use id="dot-2" href="#dot" class="tile-col-2" x="18"/>
|
|
13
|
+
<use id="dot-3" href="#dot" class="tile-col-3 tile-col-last" x="36"/>
|
|
14
|
+
</g>
|
|
15
|
+
</svg>
|
data/srv/pokey.sevgi
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
#!/usr/bin/env -S ruby -S sevgi
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
SVG :minimal, width: 100, height: 100 do
|
|
5
|
+
rect x: 0, y: 0, width: 100, height: 100, fill: "white"
|
|
6
|
+
path fill: "purple", d: %w[
|
|
7
|
+
M10 101 V50 A40 40 0 0 1 90 50 V101
|
|
8
|
+
L76 85 L63 101 L50 85 L37 101 L24 85 Z
|
|
9
|
+
]
|
|
10
|
+
|
|
11
|
+
[25, 50].each do |x|
|
|
12
|
+
circle cx: x, cy: 40, r: 8, fill: "white"
|
|
13
|
+
end
|
|
14
|
+
end.Save
|
data/srv/pokey.svg
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
<svg width="100" height="100">
|
|
2
|
+
<rect x="0" y="0" width="100" height="100" fill="white"/>
|
|
3
|
+
<path fill="purple" d="M10 101 V50 A40 40 0 0 1 90 50 V101 L76 85 L63 101 L50 85 L37 101 L24 85 Z"/>
|
|
4
|
+
<circle cx="25" cy="40" r="8" fill="white"/>
|
|
5
|
+
<circle cx="50" cy="40" r="8" fill="white"/>
|
|
6
|
+
</svg>
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
#!/usr/bin/env -S ruby -S sevgi
|
|
2
2
|
# frozen_string_literal: true
|
|
3
3
|
|
|
4
|
-
WIDTH
|
|
5
|
-
HEIGHT
|
|
4
|
+
WIDTH = 150 # 15 cm width (ruler's length)
|
|
5
|
+
HEIGHT = 20 # 2 cm height
|
|
6
6
|
|
|
7
7
|
STYLE = {
|
|
8
|
-
".labels"
|
|
9
|
-
".majors"
|
|
10
|
-
".halves"
|
|
11
|
-
".minors"
|
|
12
|
-
".frame"
|
|
8
|
+
".labels" => { fill: "black", font: "3pt monospace" },
|
|
9
|
+
".majors" => { stroke: "black", "stroke-width": 0.2 },
|
|
10
|
+
".halves" => { stroke: "black", "stroke-width": 0.1 },
|
|
11
|
+
".minors" => { stroke: "black", "stroke-width": 0.1 },
|
|
12
|
+
".frame" => { stroke: "black", "stroke-width": 0.05, fill: "none" }
|
|
13
13
|
}.freeze
|
|
14
14
|
|
|
15
15
|
SVG width: "210mm", height: "50mm", viewBox: "0 0 210 50" do
|
data/srv/ruler.sevgi
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
#!/usr/bin/env -S ruby -S sevgi
|
|
2
|
+
# frozen_string_literal: true
|
|
3
|
+
|
|
4
|
+
WIDTH = 150 # 15 cm width (ruler's length)
|
|
5
|
+
HEIGHT = 20 # 2 cm height
|
|
6
|
+
PAGE_WIDTH = 170
|
|
7
|
+
PAGE_HEIGHT = 30
|
|
8
|
+
|
|
9
|
+
STYLE = {
|
|
10
|
+
".labels" => { fill: "black", font: "3pt monospace" },
|
|
11
|
+
".majors" => { stroke: "black", "stroke-width": 0.3 },
|
|
12
|
+
".halves" => { stroke: "black", "stroke-width": 0.15 },
|
|
13
|
+
".minors" => { stroke: "black", "stroke-width": 0.15 },
|
|
14
|
+
".frame" => { stroke: "black", "stroke-width": 0.15, fill: "none" }
|
|
15
|
+
}.freeze
|
|
16
|
+
|
|
17
|
+
SVG width: "#{PAGE_WIDTH}mm", height: "#{PAGE_HEIGHT}mm",
|
|
18
|
+
viewBox: "0 0 #{PAGE_WIDTH} #{PAGE_HEIGHT}" do
|
|
19
|
+
css STYLE
|
|
20
|
+
|
|
21
|
+
ruler = g id: "ruler" do
|
|
22
|
+
rect id: "frame", width: WIDTH, height: HEIGHT, class: "frame"
|
|
23
|
+
|
|
24
|
+
layer id: "minors" do
|
|
25
|
+
length = 2
|
|
26
|
+
|
|
27
|
+
(0..WIDTH).step(1) do |x|
|
|
28
|
+
VLineBy x:, y: 0, length:, class: "minors"
|
|
29
|
+
VLineBy x:, y: HEIGHT, length: -length, class: "minors"
|
|
30
|
+
end
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
layer id: "halves" do
|
|
34
|
+
length = 4
|
|
35
|
+
|
|
36
|
+
(0..WIDTH).step(5) do |x|
|
|
37
|
+
VLineBy x:, y: 0, length:, class: "halves"
|
|
38
|
+
VLineBy x:, y: HEIGHT, length: -length, class: "halves"
|
|
39
|
+
end
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
layer id: "majors" do
|
|
43
|
+
length = 6
|
|
44
|
+
|
|
45
|
+
(10..(WIDTH - 10)).step(10) do |x|
|
|
46
|
+
VLineBy x:, y: 0, length:, class: "majors"
|
|
47
|
+
VLineBy x:, y: HEIGHT, length: -length, class: "majors"
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
layer id: "labels" do
|
|
51
|
+
(10..(WIDTH - 10)).step(10).each_with_index do |x, i|
|
|
52
|
+
text (i + 1).to_s, "text-anchor": "middle", x:, y: length + 5.5, class: "labels"
|
|
53
|
+
end
|
|
54
|
+
end
|
|
55
|
+
end
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
offset_x = (PAGE_WIDTH - WIDTH) / 2
|
|
59
|
+
offset_y = (PAGE_HEIGHT - HEIGHT) / 2
|
|
60
|
+
ruler.Translate offset_x, offset_y
|
|
61
|
+
end.Save
|