rsyntaxtree 1.0.4 → 1.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e607ace251c646cc6fb11c4eac44834afc4dd6989ce4433b2f511f1bf8df2329
4
- data.tar.gz: 495e68852573a083b6352a7809622ef453926738dbb02f03d93220e12bac66e1
3
+ metadata.gz: cce136d3e3db23dd4e606962fbf1abb0d50f8e4a3729a68eaa178eb13b2d1a71
4
+ data.tar.gz: 178feb62854ddf6078ead5522e370ecf2b1fa300af52a950f27c5d8437f2ea00
5
5
  SHA512:
6
- metadata.gz: 5998d2729ec817aaadb60ac773acf9c846bd7d624bbb650e9e8dfb3c66e35300ae6ba6887d3cf5dfe1a45e1394fe64ce7b4ce64bfe3bfd8a73581d1c8cffafd2
7
- data.tar.gz: 354536b8f8ea955b3acad905ed9b185be1876f7da37f114c0e55753fa870dab1ec98587b5a163e97680e51c6361b861f302ed3b4b8b053b8c6171aa526108f6d
6
+ metadata.gz: d8145f85ca88e8f1be876ef6ef0eb160827548d41a02b71e5dbdf67c36d6f07c166f58524949178bcf64f26ae40dc6a93ebe2310797c5f39b869528cccae0c53
7
+ data.tar.gz: 659d79a0418d939521efed0407569cfd9967ea9f4625a9ca6b0c300a5d6451e8a6a54f87b456478374ee59d9d3f1235eedb5d9c88defa3bbadffe60f40de2569
@@ -132,6 +132,7 @@ module RSyntaxTree
132
132
  text.gsub!("\\\\", 'i')
133
133
  text.gsub!("\\", "")
134
134
  text.gsub!(" ", "x")
135
+ text.gsub!("%", "X")
135
136
  metrics = FontMetrics.get_metrics(text, font, fontsize, style, weight)
136
137
  width = metrics.width
137
138
  end
@@ -1,4 +1,4 @@
1
1
  module RSyntaxTree
2
- VERSION = "1.0.4"
2
+ VERSION = "1.0.5"
3
3
  end
4
4
 
data/lib/rsyntaxtree.rb CHANGED
@@ -149,7 +149,7 @@ module RSyntaxTree
149
149
  end
150
150
 
151
151
  def draw_svg
152
- sp = StringParser.new(@params[:data].gsub('&', '&').gsub('%', '%'), @params[:fontset], @params[:fontsize])
152
+ sp = StringParser.new(@params[:data].gsub('&', '&'), @params[:fontset], @params[:fontsize])
153
153
  sp.parse
154
154
  graph = SVGGraph.new(sp.get_elementlist, @params)
155
155
  graph.svg_data
data/syntree.png CHANGED
Binary file
data/syntree.svg CHANGED
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" standalone="no"?>
2
2
  <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
3
- <svg width="161.4" height="471.2" viewBox="-20, -20, 181.4, 491.2" version="1.1" xmlns="http://www.w3.org/2000/svg">
3
+ <svg width="722.4" height="471.2" viewBox="-20, -20, 742.4, 491.2" version="1.1" xmlns="http://www.w3.org/2000/svg">
4
4
  <defs>
5
5
  <marker id="arrow" markerUnits="strokeWidth" markerWidth="12.160000000000002" markerHeight="12.160000000000002" viewBox="0 0 12.160000000000002 12.160000000000002" refX="6.080000000000001" refY="0">
6
6
  <polyline fill="none" stroke="purple" stroke-width="1" points="0,12.160000000000002,6.080000000000001,0,12.160000000000002,12.160000000000002" />
@@ -15,10 +15,10 @@
15
15
  <line x1="0" y="0" x2="0" y2="10" stroke="green" stroke-width="4"></line>
16
16
  </pattern>
17
17
  </defs>
18
- <rect x="-20" y="-20" width="181.4" height="491.2" stroke="none" fill="white" />"
19
- <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='30.400000000000006' y='132.0'><tspan x='30.400000000000006' y='132.0' style="" text-decoration="" font-family="'Noto Sans', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">X%</tspan>
18
+ <rect x="-20" y="-20" width="742.4" height="491.2" stroke="none" fill="white" />"
19
+ <text white-space='pre' alignment-baseline='text-top' style='fill: blue; font-size: 64px;' x='319.4' y='132.0'><tspan x='319.4' y='132.0' style="" text-decoration="" font-family="'Noto Sans', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">%X</tspan>
20
20
  </text>
21
- <text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='33.400000000000006' y='431.2'><tspan x='33.400000000000006' y='431.2' style="" text-decoration="" font-family="'Noto Sans', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">X&amp;</tspan>
21
+ <text white-space='pre' alignment-baseline='text-top' style='fill: green; font-size: 64px;' x='30.399999999999977' y='431.2'><tspan x='30.399999999999977' y='431.2' style="" text-decoration="" font-family="'Noto Sans', 'Noto Sans JP', OpenMoji, 'OpenMoji Color', 'OpenMoji Black', sans-serif">%Yxxxxxxxxxxxxxxxxx</tspan>
22
22
  </text>
23
- <line style='stroke:black; stroke-width:2;' x1='75.9' y1='321.2' x2='75.9' y2='187.0' />
23
+ <line style='stroke:black; stroke-width:2;' x1='356.4' y1='321.2' x2='356.4' y2='187.0' />
24
24
  </svg>
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rsyntaxtree
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yoichiro Hasebe