rsyntaxtree 1.1.0 → 1.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.tags +27 -0
- data/Gemfile +1 -1
- data/Rakefile +2 -1
- data/docs/assets/svg/001.svg +39 -0
- data/docs/assets/svg/002.svg +65 -0
- data/docs/assets/svg/003.svg +54 -0
- data/docs/assets/svg/004.svg +68 -0
- data/docs/assets/svg/005.svg +41 -0
- data/docs/assets/svg/006.svg +47 -0
- data/docs/assets/svg/007.svg +55 -0
- data/docs/assets/svg/008.svg +63 -0
- data/docs/assets/svg/009.svg +61 -0
- data/docs/assets/svg/010.svg +85 -0
- data/docs/assets/svg/011.svg +49 -0
- data/docs/assets/svg/012.svg +55 -0
- data/docs/assets/svg/013.svg +203 -0
- data/docs/assets/svg/014.svg +188 -0
- data/docs/assets/svg/015.svg +60 -0
- data/docs/assets/svg/016.svg +801 -0
- data/docs/assets/svg/017.svg +77 -0
- data/docs/assets/svg/018.svg +66 -0
- data/docs/assets/svg/019.svg +256 -0
- data/docs/assets/svg/020.svg +99 -0
- data/lib/rsyntaxtree/base_graph.rb +2 -2
- data/lib/rsyntaxtree/version.rb +1 -1
- data/lib/rsyntaxtree.rb +1 -2
- data/rsyntaxtree.gemspec +2 -0
- data/test/example_verify_test.rb +96 -0
- metadata +38 -3
@@ -0,0 +1,99 @@
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
3
|
+
<svg width="1840.0" height="1232.9" viewBox="-20, -20, 1860.0, 1252.9" version="1.1" xmlns="http://www.w3.org/2000/svg">
|
4
|
+
<defs>
|
5
|
+
<marker id="arrow" markerUnits="strokeWidth" markerWidth="11.200000000000001" markerHeight="11.200000000000001" viewBox="0 0 11.200000000000001 11.200000000000001" refX="5.6000000000000005" refY="0">
|
6
|
+
<polyline fill="none" stroke="purple" stroke-width="1" points="0,11.200000000000001,5.6000000000000005,0,11.200000000000001,11.200000000000001" />
|
7
|
+
</marker>
|
8
|
+
<pattern id="hatchBlack" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
9
|
+
<line x1="0" y="0" x2="0" y2="10" stroke="black" stroke-width="4"></line>
|
10
|
+
</pattern>
|
11
|
+
<pattern id="hatchForNode" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
12
|
+
<line x1="0" y="0" x2="0" y2="10" stroke="blue" stroke-width="4"></line>
|
13
|
+
</pattern>
|
14
|
+
<pattern id="hatchForLeaf" x="10" y="10" width="10" height="10" patternUnits="userSpaceOnUse" patternTransform="rotate(45)">
|
15
|
+
<line x1="0" y="0" x2="0" y2="10" stroke="green" stroke-width="4"></line>
|
16
|
+
</pattern>
|
17
|
+
</defs>
|
18
|
+
<rect x="-20" y="-20" width="1860.0" height="1252.9" stroke="none" fill="white" />"
|
19
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='293.6875' y='118.5'><tspan x='293.6875' y='118.5' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">The<tspan style='fill:none;'>■</tspan>umpires<tspan style='fill:none;'>■</tspan>talked<tspan style='fill:none;'>■</tspan>to<tspan style='fill:none;'>■</tspan>the<tspan style='fill:none;'>■</tspan>players</tspan>
|
20
|
+
</text>
|
21
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='102.75' y='387.1'><tspan x='102.75' y='387.1' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">the<tspan style='fill:none;'>■</tspan>umpires</tspan>
|
22
|
+
</text>
|
23
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='28.0' y='655.7'><tspan x='28.0' y='655.7' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">the</tspan>
|
24
|
+
</text>
|
25
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='61.5' y='924.3000000000001'><tspan x='61.5' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif"><tspan style='fill:none;'>■</tspan></tspan>
|
26
|
+
</text>
|
27
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='48.0' y='1192.9'><tspan x='48.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">ði</tspan>
|
28
|
+
</text>
|
29
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='358.0' y='655.7'><tspan x='358.0' y='655.7' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">umpires</tspan>
|
30
|
+
</text>
|
31
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='251.5' y='924.3000000000001'><tspan x='251.5' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">umpire</tspan>
|
32
|
+
</text>
|
33
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='230.0' y='1192.9'><tspan x='230.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">ʌ́mpaɪər</tspan>
|
34
|
+
</text>
|
35
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='577.0' y='924.3000000000001'><tspan x='577.0' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">s</tspan>
|
36
|
+
</text>
|
37
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='580.0' y='1192.9'><tspan x='580.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">z</tspan>
|
38
|
+
</text>
|
39
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='981.625' y='387.1'><tspan x='981.625' y='387.1' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">talked<tspan style='fill:none;'>■</tspan>to<tspan style='fill:none;'>■</tspan>the<tspan style='fill:none;'>■</tspan>players</tspan>
|
40
|
+
</text>
|
41
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='786.0' y='655.7'><tspan x='786.0' y='655.7' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">talked</tspan>
|
42
|
+
</text>
|
43
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='722.0' y='924.3000000000001'><tspan x='722.0' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">talk</tspan>
|
44
|
+
</text>
|
45
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='722.5' y='1192.9'><tspan x='722.5' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">tɔːk</tspan>
|
46
|
+
</text>
|
47
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='936.0' y='924.3000000000001'><tspan x='936.0' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">ed</tspan>
|
48
|
+
</text>
|
49
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='961.0' y='1192.9'><tspan x='961.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">t</tspan>
|
50
|
+
</text>
|
51
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1118.0' y='655.7'><tspan x='1118.0' y='655.7' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">to</tspan>
|
52
|
+
</text>
|
53
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1134.0' y='924.3000000000001'><tspan x='1134.0' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif"><tspan style='fill:none;'>■</tspan></tspan>
|
54
|
+
</text>
|
55
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='1124.0' y='1192.9'><tspan x='1124.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">tə</tspan>
|
56
|
+
</text>
|
57
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1285.0' y='655.7'><tspan x='1285.0' y='655.7' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">the</tspan>
|
58
|
+
</text>
|
59
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1318.5' y='924.3000000000001'><tspan x='1318.5' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif"><tspan style='fill:none;'>■</tspan></tspan>
|
60
|
+
</text>
|
61
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='1301.0' y='1192.9'><tspan x='1301.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">ðə</tspan>
|
62
|
+
</text>
|
63
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1577.25' y='655.7'><tspan x='1577.25' y='655.7' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">players</tspan>
|
64
|
+
</text>
|
65
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1487.0' y='924.3000000000001'><tspan x='1487.0' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">player</tspan>
|
66
|
+
</text>
|
67
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='1495.0' y='1192.9'><tspan x='1495.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">pléɪər</tspan>
|
68
|
+
</text>
|
69
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='1767.0' y='924.3000000000001'><tspan x='1767.0' y='924.3000000000001' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">s</tspan>
|
70
|
+
</text>
|
71
|
+
<text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='1770.0' y='1192.9'><tspan x='1770.0' y='1192.9' style="" text-decoration="" font-family="'WenQuanYi Zen Hei', 'Noto Sans', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">z</tspan>
|
72
|
+
</text>
|
73
|
+
<line style='stroke:black; stroke-width:2;' x1='271.75' y1='288.35' x2='773.1875' y2='167.875' />
|
74
|
+
<line style='stroke:black; stroke-width:2;' x1='1274.625' y1='288.35' x2='773.1875' y2='167.875' />
|
75
|
+
<line style='stroke:black; stroke-width:2;' x1='73.0' y1='556.95' x2='271.75' y2='436.475' />
|
76
|
+
<line style='stroke:black; stroke-width:2;' x1='470.5' y1='556.95' x2='271.75' y2='436.475' />
|
77
|
+
<line style='stroke:black; stroke-width:2;' x1='73.0' y1='825.5500000000001' x2='73.0' y2='705.075' />
|
78
|
+
<line style='stroke:black; stroke-width:2;' x1='73.0' y1='1094.15' x2='73.0' y2='973.6750000000001' />
|
79
|
+
<line style='stroke:black; stroke-width:2;' x1='347.5' y1='825.5500000000001' x2='470.5' y2='705.075' />
|
80
|
+
<line style='stroke:black; stroke-width:2;' x1='593.5' y1='825.5500000000001' x2='470.5' y2='705.075' />
|
81
|
+
<line style='stroke:black; stroke-width:2;' x1='347.5' y1='1094.15' x2='347.5' y2='973.6750000000001' />
|
82
|
+
<line style='stroke:black; stroke-width:2;' x1='593.5' y1='1094.15' x2='593.5' y2='973.6750000000001' />
|
83
|
+
<line style='stroke:black; stroke-width:2;' x1='872.0' y1='556.95' x2='1274.625' y2='436.475' />
|
84
|
+
<line style='stroke:black; stroke-width:2;' x1='1145.5' y1='556.95' x2='1274.625' y2='436.475' />
|
85
|
+
<line style='stroke:black; stroke-width:2;' x1='1330.0' y1='556.95' x2='1274.625' y2='436.475' />
|
86
|
+
<line style='stroke:black; stroke-width:2;' x1='1677.25' y1='556.95' x2='1274.625' y2='436.475' />
|
87
|
+
<line style='stroke:black; stroke-width:2;' x1='773.0' y1='825.5500000000001' x2='872.0' y2='705.075' />
|
88
|
+
<line style='stroke:black; stroke-width:2;' x1='971.0' y1='825.5500000000001' x2='872.0' y2='705.075' />
|
89
|
+
<line style='stroke:black; stroke-width:2;' x1='773.0' y1='1094.15' x2='773.0' y2='973.6750000000001' />
|
90
|
+
<line style='stroke:black; stroke-width:2;' x1='971.0' y1='1094.15' x2='971.0' y2='973.6750000000001' />
|
91
|
+
<line style='stroke:black; stroke-width:2;' x1='1145.5' y1='825.5500000000001' x2='1145.5' y2='705.075' />
|
92
|
+
<line style='stroke:black; stroke-width:2;' x1='1145.5' y1='1094.15' x2='1145.5' y2='973.6750000000001' />
|
93
|
+
<line style='stroke:black; stroke-width:2;' x1='1330.0' y1='825.5500000000001' x2='1330.0' y2='705.075' />
|
94
|
+
<line style='stroke:black; stroke-width:2;' x1='1330.0' y1='1094.15' x2='1330.0' y2='973.6750000000001' />
|
95
|
+
<line style='stroke:black; stroke-width:2;' x1='1571.0' y1='825.5500000000001' x2='1677.25' y2='705.075' />
|
96
|
+
<line style='stroke:black; stroke-width:2;' x1='1783.5' y1='825.5500000000001' x2='1677.25' y2='705.075' />
|
97
|
+
<line style='stroke:black; stroke-width:2;' x1='1571.0' y1='1094.15' x2='1571.0' y2='973.6750000000001' />
|
98
|
+
<line style='stroke:black; stroke-width:2;' x1='1783.5' y1='1094.15' x2='1783.5' y2='973.6750000000001' />
|
99
|
+
</svg>
|
@@ -78,7 +78,7 @@ module RSyntaxTree
|
|
78
78
|
parent = @element_list.get_id(target.parent)
|
79
79
|
|
80
80
|
vertical_indent = if !target.triangle &&
|
81
|
-
@leafstyle == "nothing" &&
|
81
|
+
(@leafstyle == "nothing" || @leafstyle == "none") &&
|
82
82
|
ETYPE_LEAF == target.type &&
|
83
83
|
parent.children.size == 1
|
84
84
|
parent.vertical_indent + parent.content_height
|
@@ -180,7 +180,7 @@ module RSyntaxTree
|
|
180
180
|
else
|
181
181
|
line_to_parent(parent, child)
|
182
182
|
end
|
183
|
-
when "nothing"
|
183
|
+
when "nothing", "none"
|
184
184
|
if child.triangle
|
185
185
|
triangle_to_parent(parent, child)
|
186
186
|
elsif ETYPE_LEAF != child.type
|
data/lib/rsyntaxtree/version.rb
CHANGED
data/lib/rsyntaxtree.rb
CHANGED
@@ -72,7 +72,7 @@ module RSyntaxTree
|
|
72
72
|
fontset[:cjk] = FONT_DIR + "/NotoSansJP-Regular.otf"
|
73
73
|
fontset[:emoji] = FONT_DIR + "/OpenMoji-Black.ttf"
|
74
74
|
new_params[:fontstyle] = "sans"
|
75
|
-
when "noto-serif",
|
75
|
+
when "noto-serif", "serif"
|
76
76
|
fontset[:normal] = FONT_DIR + "/NotoSerif-Regular.ttf"
|
77
77
|
fontset[:italic] = FONT_DIR + "/NotoSerif-Italic.ttf"
|
78
78
|
fontset[:bold] = FONT_DIR + "/NotoSerif-Bold.ttf"
|
@@ -115,7 +115,6 @@ module RSyntaxTree
|
|
115
115
|
@params[:fontsize] = @params[:fontsize] * FONT_SCALING
|
116
116
|
@params[:margin] = @params[:margin] * FONT_SCALING
|
117
117
|
@params[:fontset] = fontset
|
118
|
-
|
119
118
|
single_x_metrics = FontMetrics.get_metrics("X", fontset[:normal], @params[:fontsize], :normal, :normal)
|
120
119
|
@global = {}
|
121
120
|
@global[:single_x_metrics] = single_x_metrics
|
data/rsyntaxtree.gemspec
CHANGED
@@ -0,0 +1,96 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "minitest/autorun"
|
4
|
+
require "minitest/pride"
|
5
|
+
require "yaml"
|
6
|
+
require_relative '../lib/rsyntaxtree'
|
7
|
+
require_relative '../lib/rsyntaxtree/utils'
|
8
|
+
|
9
|
+
class ExampleParserTest < Minitest::Test
|
10
|
+
examples_dir = File.expand_path(File.join(__dir__, "..", "docs", "_examples"))
|
11
|
+
svg_dir = File.expand_path(File.join(__dir__, "..", "docs", "assets", "svg"))
|
12
|
+
|
13
|
+
Dir.glob("*.md", base: examples_dir).map do |md|
|
14
|
+
md = File.join(examples_dir, md)
|
15
|
+
config = YAML.load_file(md)
|
16
|
+
rst = File.read(md).scan(/```([^`]+)```/m).last.first
|
17
|
+
|
18
|
+
opts = {
|
19
|
+
format: "png",
|
20
|
+
leafstyle: "auto",
|
21
|
+
fontstyle: "sans",
|
22
|
+
fontsize: 16,
|
23
|
+
margin: 1,
|
24
|
+
vheight: 2.0,
|
25
|
+
color: "on",
|
26
|
+
symmetrize: "on",
|
27
|
+
transparent: "off",
|
28
|
+
polyline: "off"
|
29
|
+
}
|
30
|
+
name = nil
|
31
|
+
config.each do |key, value|
|
32
|
+
next if value.to_s == ""
|
33
|
+
|
34
|
+
case key
|
35
|
+
when "name"
|
36
|
+
name = value
|
37
|
+
when "colorization"
|
38
|
+
opts[:color] = value
|
39
|
+
when "polyline"
|
40
|
+
opts[:polyline] = value
|
41
|
+
when "symmetrization"
|
42
|
+
opts[:symmetrize] = value
|
43
|
+
when "connector"
|
44
|
+
opts[:leafstyle] = value
|
45
|
+
when "font"
|
46
|
+
opts[:fontstyle] = case value
|
47
|
+
when /sans/i
|
48
|
+
"sans"
|
49
|
+
when /serif/i
|
50
|
+
"serif"
|
51
|
+
when /wqy/i
|
52
|
+
"cjk"
|
53
|
+
else
|
54
|
+
"sans"
|
55
|
+
end
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
opts[:data] = rst
|
60
|
+
rsg = RSyntaxTree::RSGenerator.new(opts)
|
61
|
+
|
62
|
+
#################################
|
63
|
+
# To test SVG, run the code below
|
64
|
+
#################################
|
65
|
+
svg = rsg.draw_svg
|
66
|
+
opts[:svg] = svg
|
67
|
+
svg_path = File.join(svg_dir, "#{name}.svg")
|
68
|
+
svg_code = File.read(svg_path)
|
69
|
+
puts "Creating example SVG test case: #{name}"
|
70
|
+
|
71
|
+
define_method "test_#{name}" do
|
72
|
+
assert_equal svg_code, opts[:svg]
|
73
|
+
end
|
74
|
+
|
75
|
+
##########################################
|
76
|
+
# To create SVG for the tests, comment-out
|
77
|
+
# above block and run the code below
|
78
|
+
##########################################
|
79
|
+
# File.open(File.join(svg_dir, "#{name}.svg"), "w") do |f|
|
80
|
+
# puts "Creating svg file: #{name}.svg"
|
81
|
+
# svg = rsg.draw_svg
|
82
|
+
# f.write(svg)
|
83
|
+
# end
|
84
|
+
|
85
|
+
##########################################
|
86
|
+
# To create SVG for the documentation,
|
87
|
+
# comment-out above and run the code below
|
88
|
+
##########################################
|
89
|
+
# png_dir = File.expand_path(File.join(__dir__, "..", "docs", "assets", "img"))
|
90
|
+
# File.open(File.join(png_dir, "#{name}.png"), "w") do |f|
|
91
|
+
# puts "Creating png file: #{name}.png"
|
92
|
+
# png = rsg.draw_png
|
93
|
+
# f.write(png)
|
94
|
+
# end
|
95
|
+
end
|
96
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rsyntaxtree
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yoichiro Hasebe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-01-
|
11
|
+
date: 2023-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: optimist
|
@@ -78,6 +78,20 @@ dependencies:
|
|
78
78
|
- - ">="
|
79
79
|
- !ruby/object:Gem::Version
|
80
80
|
version: '0'
|
81
|
+
- !ruby/object:Gem::Dependency
|
82
|
+
name: yaml
|
83
|
+
requirement: !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - ">="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
version: '0'
|
88
|
+
type: :development
|
89
|
+
prerelease: false
|
90
|
+
version_requirements: !ruby/object:Gem::Requirement
|
91
|
+
requirements:
|
92
|
+
- - ">="
|
93
|
+
- !ruby/object:Gem::Version
|
94
|
+
version: '0'
|
81
95
|
description: Syntax tree generator made with Ruby
|
82
96
|
email:
|
83
97
|
- yohasebe@gmail.com
|
@@ -159,6 +173,26 @@ files:
|
|
159
173
|
- docs/assets/img/favicon/favicon-16x16.png
|
160
174
|
- docs/assets/img/favicon/favicon-32x32.png
|
161
175
|
- docs/assets/img/favicon/favicon.ico
|
176
|
+
- docs/assets/svg/001.svg
|
177
|
+
- docs/assets/svg/002.svg
|
178
|
+
- docs/assets/svg/003.svg
|
179
|
+
- docs/assets/svg/004.svg
|
180
|
+
- docs/assets/svg/005.svg
|
181
|
+
- docs/assets/svg/006.svg
|
182
|
+
- docs/assets/svg/007.svg
|
183
|
+
- docs/assets/svg/008.svg
|
184
|
+
- docs/assets/svg/009.svg
|
185
|
+
- docs/assets/svg/010.svg
|
186
|
+
- docs/assets/svg/011.svg
|
187
|
+
- docs/assets/svg/012.svg
|
188
|
+
- docs/assets/svg/013.svg
|
189
|
+
- docs/assets/svg/014.svg
|
190
|
+
- docs/assets/svg/015.svg
|
191
|
+
- docs/assets/svg/016.svg
|
192
|
+
- docs/assets/svg/017.svg
|
193
|
+
- docs/assets/svg/018.svg
|
194
|
+
- docs/assets/svg/019.svg
|
195
|
+
- docs/assets/svg/020.svg
|
162
196
|
- docs/documentation.md
|
163
197
|
- docs/documentation_ja.md
|
164
198
|
- docs/examples.html
|
@@ -193,6 +227,7 @@ files:
|
|
193
227
|
- lib/rsyntaxtree/utils.rb
|
194
228
|
- lib/rsyntaxtree/version.rb
|
195
229
|
- rsyntaxtree.gemspec
|
230
|
+
- test/example_verify_test.rb
|
196
231
|
- test/markup_parser_test.rb
|
197
232
|
homepage: http://github.com/yohasebe/rsyntaxtree
|
198
233
|
licenses:
|
@@ -213,7 +248,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
213
248
|
- !ruby/object:Gem::Version
|
214
249
|
version: '0'
|
215
250
|
requirements: []
|
216
|
-
rubygems_version: 3.4.
|
251
|
+
rubygems_version: 3.4.1
|
217
252
|
signing_key:
|
218
253
|
specification_version: 4
|
219
254
|
summary: RSyntaxTree is a graphical syntax tree generator written in Ruby
|