sevgi-showcase 0.95.0 → 1.0.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.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +221 -2
  3. data/README.md +10 -17
  4. data/lib/sevgi/showcase/dark.rb +4 -0
  5. data/lib/sevgi/showcase/minitest/script.rb +59 -57
  6. data/lib/sevgi/showcase/minitest/suite.rb +48 -46
  7. data/lib/sevgi/showcase/minitest.rb +8 -1
  8. data/lib/sevgi/showcase/version.rb +1 -1
  9. data/lib/sevgi/showcase.rb +0 -3
  10. data/srv/arc.sevgi +29 -0
  11. data/srv/arc.svg +32 -0
  12. data/srv/arc.yml +4 -0
  13. data/srv/checkers.sevgi +78 -0
  14. data/srv/checkers.svg +118 -0
  15. data/srv/clover.sevgi +19 -0
  16. data/srv/clover.svg +12 -0
  17. data/srv/clover.yml +3 -0
  18. data/srv/copperplate.sevgi +50 -0
  19. data/srv/copperplate.svg +99 -0
  20. data/srv/copperplate.yml +5 -0
  21. data/srv/gear.sevgi +25 -0
  22. data/srv/gear.svg +12 -0
  23. data/srv/gear.yml +2 -0
  24. data/srv/grid.sevgi +23 -0
  25. data/srv/{grid-cells.svg → grid.svg} +14 -1
  26. data/srv/hatch.sevgi +9 -0
  27. data/srv/hatch.svg +30 -0
  28. data/srv/hatch.yml +4 -0
  29. data/srv/heart.sevgi +17 -0
  30. data/srv/heart.svg +9 -0
  31. data/srv/heart.yml +3 -0
  32. data/srv/logo.sevgi +39 -0
  33. data/srv/logo.svg +30 -0
  34. data/srv/logo.yml +4 -0
  35. data/srv/logos.sevgi +34 -0
  36. data/srv/logos.svg +39 -0
  37. data/srv/logos.yml +4 -0
  38. data/srv/meter.sevgi +20 -0
  39. data/srv/meter.svg +19 -0
  40. data/srv/orb.sevgi +14 -0
  41. data/srv/orb.svg +11 -0
  42. data/srv/orb.yml +4 -0
  43. data/srv/pacman.sevgi +18 -0
  44. data/srv/pacman.svg +16 -0
  45. data/srv/pokey.sevgi +14 -0
  46. data/srv/{pacman-pokey.svg → pokey.svg} +1 -3
  47. data/srv/protractor.sevgi +40 -0
  48. data/srv/protractor.svg +605 -0
  49. data/srv/ruler.sevgi +61 -0
  50. data/srv/ruler.svg +445 -0
  51. data/srv/{snow-flake.sevgi → snowflake.sevgi} +3 -3
  52. data/srv/{snow-flake.svg → snowflake.svg} +3 -2
  53. data/srv/snowflake.yml +2 -0
  54. data/srv/squared.sevgi +42 -0
  55. data/srv/squared.svg +71 -0
  56. data/srv/squared.yml +4 -0
  57. data/srv/stars.sevgi +19 -0
  58. data/srv/stars.svg +31 -0
  59. data/srv/stars.yml +3 -0
  60. data/srv/tulips.sevgi +27 -0
  61. data/srv/tulips.svg +20 -0
  62. data/srv/tulips.yml +3 -0
  63. metadata +66 -37
  64. data/lib/sevgi/showcase/minitest/shell.rb +0 -166
  65. data/srv/checker-board.sevgi +0 -96
  66. data/srv/checker-board.svg +0 -117
  67. data/srv/gear-wheel.sevgi +0 -27
  68. data/srv/gear-wheel.svg +0 -12
  69. data/srv/gear-wheel.yml +0 -3
  70. data/srv/grid-cells.sevgi +0 -24
  71. data/srv/heart-mask.sevgi +0 -17
  72. data/srv/heart-mask.svg +0 -8
  73. data/srv/heart-mask.yml +0 -3
  74. data/srv/meter-face.sevgi +0 -20
  75. data/srv/meter-face.svg +0 -13
  76. data/srv/pacman-pokey.sevgi +0 -17
  77. data/srv/pacman-single.sevgi +0 -17
  78. data/srv/pacman-single.svg +0 -14
  79. data/srv/ruler-hline.sevgi +0 -55
  80. data/srv/ruler-hline.svg +0 -443
  81. data/srv/ruler-line.sevgi +0 -52
  82. data/srv/ruler-line.svg +0 -443
  83. data/srv/snow-flake.yml +0 -1
  84. /data/srv/{checker-board.yml → checkers.yml} +0 -0
  85. /data/srv/{grid-cells.yml → grid.yml} +0 -0
  86. /data/srv/{meter-face.yml → meter.yml} +0 -0
  87. /data/srv/{pacman-pokey.yml → pacman.yml} +0 -0
  88. /data/srv/{pacman-single.yml → pokey.yml} +0 -0
  89. /data/srv/{ruler-hline.yml → protractor.yml} +0 -0
  90. /data/srv/{ruler-line.yml → ruler.yml} +0 -0
data/srv/logo.svg ADDED
@@ -0,0 +1,30 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="120" height="120" viewBox="-1 -1 62 62">
3
+ <rect x="-1" y="-1" width="62" height="62" fill="white"/>
4
+ <style type="text/css">
5
+ <![CDATA[
6
+ .active {
7
+ fill: none;
8
+ stroke: purple;
9
+ stroke-linecap: round;
10
+ stroke-width: 1.5;
11
+ }
12
+ .passive {
13
+ fill: none;
14
+ stroke: lightgrey;
15
+ stroke-linecap: round;
16
+ stroke-width: 1.5;
17
+ }
18
+ ]]>
19
+ </style>
20
+ <defs>
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
24
+ M 30,0 C 30,0 11.61,7.089442 11.61,14.999998 C 11.61,22.910556 30,30 30,30
25
+ "
26
+ />
27
+ </defs>
28
+ <use id="SCVN" href="#Logo" class="passive" transform="matrix(-1 0 0 1 60 0)"/>
29
+ <use id="SCVP" href="#Logo" class="active"/>
30
+ </svg>
data/srv/logo.yml ADDED
@@ -0,0 +1,4 @@
1
+ dark:
2
+ lightgrey: "#52525b"
3
+ purple: "#e5c39c"
4
+ white: "#222222"
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 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,39 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="260" height="135" viewBox="0 0 260 135">
3
+ <style type="text/css">
4
+ <![CDATA[
5
+ .active {
6
+ fill: none;
7
+ stroke: purple;
8
+ stroke-linecap: round;
9
+ stroke-width: 2.0;
10
+ }
11
+ .passive {
12
+ fill: none;
13
+ stroke: lightgrey;
14
+ stroke-linecap: round;
15
+ stroke-width: 2.0;
16
+ }
17
+ ]]>
18
+ </style>
19
+ <rect width="260" height="135" fill="white"/>
20
+ <defs>
21
+ <g id="Mark" xmlns="http://www.w3.org/2000/svg">
22
+ <path
23
+ id="Logo"
24
+ 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"
25
+ fill="none"
26
+ />
27
+ <use id="SCVN" href="#Logo" class="passive" transform="matrix(-1,0,0,1,60,0)"/>
28
+ <use id="SCVP" href="#Logo" class="active"/>
29
+ </g>
30
+ </defs>
31
+ <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"/>
32
+ <use id="Mark-1-2" href="#Mark" class="tile-row-1 tile-row-first tile-col-2" x="70" y="5" opacity="0.86"/>
33
+ <use id="Mark-1-3" href="#Mark" class="tile-row-1 tile-row-first tile-col-3" x="135" y="5" opacity="0.92"/>
34
+ <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"/>
35
+ <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"/>
36
+ <use id="Mark-2-2" href="#Mark" class="tile-row-2 tile-row-last tile-col-2" x="70" y="70" opacity="0.92"/>
37
+ <use id="Mark-2-3" href="#Mark" class="tile-row-2 tile-row-last tile-col-3" x="135" y="70" opacity="0.97"/>
38
+ <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"/>
39
+ </svg>
data/srv/logos.yml ADDED
@@ -0,0 +1,4 @@
1
+ dark:
2
+ lightgrey: "#52525b"
3
+ purple: "#e5c39c"
4
+ white: "#222222"
data/srv/meter.sevgi ADDED
@@ -0,0 +1,20 @@
1
+ #!/usr/bin/env -S ruby -S sevgi
2
+ # frozen_string_literal: true
3
+
4
+ LED_COUNT = 10
5
+ LED_GAP = 2
6
+ LED_WIDTH = 10
7
+ TOTAL_WIDTH = (LED_COUNT * (LED_WIDTH + LED_GAP)) + 8
8
+
9
+ dim = proc do |led, x:, **|
10
+ led[:"fill-opacity"] = 0.3 if x >= 7
11
+ end
12
+
13
+ SVG width: TOTAL_WIDTH, height: 30, viewBox: "0 0 #{TOTAL_WIDTH} 30" do
14
+ rect x: 2, y: 2, width: TOTAL_WIDTH - 4, height: 26,
15
+ rx: 4, fill: "none", stroke: "#666"
16
+
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
+ end
20
+ end.Save
data/srv/meter.svg ADDED
@@ -0,0 +1,19 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="128" height="30" viewBox="0 0 128 30">
3
+ <rect x="2" y="2" width="124" height="26" rx="4" fill="none" stroke="#666"/>
4
+ <defs>
5
+ <g id="led">
6
+ <rect y="5" width="10" height="20" rx="3" fill="green"/>
7
+ </g>
8
+ </defs>
9
+ <use id="led-1" href="#led" class="tile-col-1 tile-col-first" x="5"/>
10
+ <use id="led-2" href="#led" class="tile-col-2" x="17"/>
11
+ <use id="led-3" href="#led" class="tile-col-3" x="29"/>
12
+ <use id="led-4" href="#led" class="tile-col-4" x="41"/>
13
+ <use id="led-5" href="#led" class="tile-col-5" x="53"/>
14
+ <use id="led-6" href="#led" class="tile-col-6" x="65"/>
15
+ <use id="led-7" href="#led" class="tile-col-7" x="77"/>
16
+ <use id="led-8" href="#led" class="tile-col-8" x="89" fill-opacity="0.3"/>
17
+ <use id="led-9" href="#led" class="tile-col-9" x="101" fill-opacity="0.3"/>
18
+ <use id="led-10" href="#led" class="tile-col-10 tile-col-last" x="113" fill-opacity="0.3"/>
19
+ </svg>
data/srv/orb.sevgi ADDED
@@ -0,0 +1,14 @@
1
+ #!/usr/bin/env -S ruby -S sevgi
2
+ # frozen_string_literal: true
3
+
4
+ SVG width: 150, height: 100, viewBox: "0 0 150 100" do
5
+ defs do
6
+ radialGradient id: "orb", cx: "35%", cy: "30%", r: "65%" do
7
+ stop offset: 0, "stop-color": "#f8e6f8"
8
+ stop offset: 0.5, "stop-color": "purple"
9
+ stop offset: 1, "stop-color": "#600060"
10
+ end
11
+ end
12
+
13
+ circle cx: 75, cy: 50, r: 43, fill: "url(#orb)"
14
+ end.Save
data/srv/orb.svg ADDED
@@ -0,0 +1,11 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="150" height="100" viewBox="0 0 150 100">
3
+ <defs>
4
+ <radialGradient id="orb" cx="35%" cy="30%" r="65%">
5
+ <stop offset="0" stop-color="#f8e6f8"/>
6
+ <stop offset="0.5" stop-color="purple"/>
7
+ <stop offset="1" stop-color="#600060"/>
8
+ </radialGradient>
9
+ </defs>
10
+ <circle cx="75" cy="50" r="43" fill="url(#orb)"/>
11
+ </svg>
data/srv/orb.yml ADDED
@@ -0,0 +1,4 @@
1
+ dark:
2
+ "#600060": "#2c251e"
3
+ "#f8e6f8": "#f0d6b8"
4
+ purple: "#e5c39c"
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 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,16 @@
1
+ <?xml version="1.0" standalone="no"?>
2
+ <svg xmlns="http://www.w3.org/2000/svg" width="180" height="90">
3
+ <rect id="frame" width="180" height="90" rx="5" fill="white"/>
4
+ <circle id="head" cx="70" cy="45" r="40" fill="purple"/>
5
+ <circle id="eye" cx="80" cy="23" r="6" fill="white"/>
6
+ <polygon id="mouth" points="70,45 110,15 110,75" fill="white"/>
7
+ <symbol id="dot">
8
+ <title>Dot</title>
9
+ <circle cx="110" cy="45" r="6" fill="purple"/>
10
+ </symbol>
11
+ <g id="dots">
12
+ <use id="dot-1" href="#dot" class="tile-col-1 tile-col-first"/>
13
+ <use id="dot-2" href="#dot" class="tile-col-2" x="18"/>
14
+ <use id="dot-3" href="#dot" class="tile-col-3 tile-col-last" x="36"/>
15
+ </g>
16
+ </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 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
@@ -1,9 +1,7 @@
1
1
  <?xml version="1.0" standalone="no"?>
2
2
  <svg xmlns="http://www.w3.org/2000/svg" width="100" height="100">
3
3
  <rect x="0" y="0" width="100" height="100" fill="white"/>
4
- <circle cx="50" cy="50" r="40" fill="purple"/>
5
- <rect x="10" y="50" width="80" height="50" fill="purple"/>
4
+ <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"/>
6
5
  <circle cx="25" cy="40" r="8" fill="white"/>
7
6
  <circle cx="50" cy="40" r="8" fill="white"/>
8
- <path fill="white" d="M11 100 l13 -15 l13 15 l13 -15 l13 15 l13 -15 l13 15 Z"/>
9
7
  </svg>
@@ -0,0 +1,40 @@
1
+ #!/usr/bin/env -S ruby -S sevgi
2
+ # frozen_string_literal: true
3
+
4
+ CX = 75
5
+ CY = 75
6
+ RADIUS = 70
7
+
8
+ SVG width: "150mm", height: "85mm", viewBox: "0 0 150 85" do
9
+ ruler = Ruler brut: 180, unit: 1, multiple: 10
10
+
11
+ g fill: "none", stroke: "black", "stroke-width": 0.2 do
12
+ ArcTo x1: CX - RADIUS, y1: CY, x2: CX + RADIUS, y2: CY,
13
+ rx: RADIUS, ry: RADIUS, sweep: true
14
+ HLineBy x: CX - RADIUS, y: CY, length: 2 * RADIUS
15
+
16
+ [
17
+ [ruler.ms - ruler.ds - ruler.hs, 2],
18
+ [ruler.hs, 4],
19
+ [ruler.ds, 6]
20
+ ].each do |degrees, length|
21
+ degrees.each do |degree|
22
+ g transform: "rotate(#{degree} #{CX} #{CY})" do
23
+ HLineBy x: CX - RADIUS, y: CY, length:
24
+ end
25
+ end
26
+ end
27
+
28
+ HLineBy x: CX - 2, y: CY, length: 4
29
+ VLineBy x: CX, y: CY - 2, length: 4
30
+ end
31
+
32
+ g fill: "black", "font-family": "monospace", "font-size": "2.5pt", "text-anchor": "middle" do
33
+ ruler.ds[1...-1].each do |degree|
34
+ g transform: "rotate(#{degree} #{CX} #{CY})" do
35
+ text degree.to_i.to_s, x: 18, y: CY, dy: 1,
36
+ transform: "rotate(#{-degree} 18 #{CY})"
37
+ end
38
+ end
39
+ end
40
+ end.Save