pxgraphviz 0.4.1 → 0.4.2

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
  SHA1:
3
- metadata.gz: b2cdd1476fe89a2244eedc9ea4dade19352e0053
4
- data.tar.gz: ab7dfdfc0cd596feaba73b81c1303900aedb833c
3
+ metadata.gz: 8937c761f0b23537cbeb192d19a9e774b0597659
4
+ data.tar.gz: daf42ddbfaffac09e288829ffa5dc3dd5f97e705
5
5
  SHA512:
6
- metadata.gz: 892322027dc6e0c6a4f7b3cc2d547b48fc4ca00133b19af340ee1986ca2a960a029eb875f858bac62f9b00e09d469742fbd9c7d6648fa6b16cfbb28c1d2aa07b
7
- data.tar.gz: 7f5ff706f170aa1cc57b57be41f894665814883f14e3c8f55edfb9f21ae30cf648e58e1dda7f9998f5cd1015f50df7b6ef5d4f3eb20c617602e0d5063f1f696c
6
+ metadata.gz: 7e1ed3a09f79b2b0e28388c4ce14a45f8e9fce69aab901801c7ce95aaf22447645afa0e20ae7f2bf2d096ea07f98530332884adfec16bb5fc838ff0f3c7b5833
7
+ data.tar.gz: '09705e4b48ee02bd67ca2f29ed3ef2fdcc8b0f0624ce540f5af64496c0249aee29335b6ac342b6609e1c5f553d2d0f14991be82ff9e16f38339eb1531a608067'
checksums.yaml.gz.sig CHANGED
Binary file
data/lib/pxgraphviz.rb CHANGED
@@ -14,8 +14,10 @@ class PxGraphViz
14
14
  def initialize(s, style: default_stylesheet())
15
15
 
16
16
  @px = s =~ /^<\?/ ? Polyrex.new.import(s) : Polyrex.new(s)
17
+
17
18
  doc = Rexslt.new(xslt_stylesheet(), @px.to_xml)\
18
19
  .to_doc.root.element('nodes')
20
+
19
21
  doc.root.elements.first.insert_before Rexle::Element.new('style')\
20
22
  .add_text style
21
23
  @doc = doc
@@ -51,7 +53,7 @@ class PxGraphViz
51
53
  color: #ddaa66;
52
54
  fillcolor: #775533;
53
55
  fontcolor: #ffeecc;
54
- fontname: Trebuchet MS;
56
+ fontname: 'Trebuchet MS';
55
57
  fontsize: 8;
56
58
  margin: 0.0;
57
59
  penwidth: 1;
@@ -83,75 +85,87 @@ STYLE
83
85
  <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
84
86
  <xsl:output method="xml" indent="yes" />
85
87
 
86
- <xsl:template match='items'>
87
- <xsl:element name="nodes">
88
- <xsl:if test="summary/type">
89
- <xsl:attribute name="type">
90
- <xsl:value-of select="summary/type"/>
91
- </xsl:attribute>
92
- </xsl:if>
93
- <xsl:if test="summary/direction">
94
- <xsl:attribute name="direction">
95
- <xsl:value-of select="summary/direction"/>
96
- </xsl:attribute>
97
- </xsl:if>
98
- <xsl:if test="summary/layout">
99
- <xsl:attribute name="layout">
100
- <xsl:value-of select="summary/layout"/>
101
- </xsl:attribute>
102
- </xsl:if>
103
- <xsl:apply-templates select='records'/>
104
- </xsl:element>
105
- </xsl:template>
88
+ <xsl:template match='items'>
89
+ <xsl:element name="nodes">
90
+ <xsl:if test="summary/type">
91
+ <xsl:attribute name="type">
92
+ <xsl:value-of select="summary/type"/>
93
+ </xsl:attribute>
94
+ </xsl:if>
95
+ <xsl:if test="summary/direction">
96
+ <xsl:attribute name="direction">
97
+ <xsl:value-of select="summary/direction"/>
98
+ </xsl:attribute>
99
+ </xsl:if>
100
+ <xsl:if test="summary/layout">
101
+ <xsl:attribute name="layout">
102
+ <xsl:value-of select="summary/layout"/>
103
+ </xsl:attribute>
104
+ </xsl:if>
105
+ <xsl:apply-templates select='records'/>
106
+ </xsl:element>
107
+ </xsl:template>
106
108
 
107
- <xsl:template match='records/item'>
109
+ <xsl:template match='records/item'>
108
110
 
109
- <xsl:if test="summary/url and summary/url != ''">
110
- <xsl:element name="a">
111
- <xsl:attribute name="href">
112
- <xsl:value-of select="summary/url"/>
113
- </xsl:attribute>
114
- </xsl:element>
115
- </xsl:if>
116
-
117
- <xsl:element name="node">
118
-
119
- <xsl:attribute name="shape">
120
- <xsl:value-of select="summary/shape"/>
121
- </xsl:attribute>
122
-
123
- <xsl:if test="summary/id">
124
- <xsl:attribute name="id">
125
- <xsl:value-of select="summary/id"/>
126
- </xsl:attribute>
127
- </xsl:if>
128
-
129
- <xsl:if test="summary/class">
130
- <xsl:attribute name="class">
131
- <xsl:value-of select="summary/class"/>
132
- </xsl:attribute>
133
- </xsl:if>
134
-
135
- <xsl:if test="summary/connection">
136
- <xsl:attribute name="connection">
137
- <xsl:value-of select="summary/connection"/>
138
- </xsl:attribute>
139
- </xsl:if>
140
-
141
- <xsl:apply-templates select='summary'/>
142
- <xsl:apply-templates select='records'/>
111
+ <xsl:choose>
112
+ <xsl:when test="summary/url and summary/url != ''">
143
113
 
144
- </xsl:element>
145
- </xsl:template>
114
+ <xsl:element name="a">
115
+ <xsl:attribute name="href">
116
+ <xsl:value-of select="summary/url"/>
117
+ </xsl:attribute>
118
+ <xsl:call-template name='node'/>
119
+ </xsl:element>
146
120
 
147
- <xsl:template match='item/summary'>
121
+ </xsl:when>
122
+ <xsl:otherwise>
148
123
 
149
- <label><xsl:value-of select='label'/></label>
124
+ <xsl:call-template name='node'/>
150
125
 
151
- </xsl:template>
126
+ </xsl:otherwise>
152
127
 
153
- </xsl:stylesheet>
128
+ </xsl:choose>
129
+ </xsl:template>
130
+
131
+ <xsl:template match='item/summary'>
132
+
133
+ <label><xsl:value-of select='label'/></label>
134
+
135
+ </xsl:template>
154
136
 
137
+ <xsl:template name='node'>
138
+ <xsl:element name="node">
139
+
140
+ <xsl:attribute name="shape">
141
+ <xsl:value-of select="summary/shape"/>
142
+ </xsl:attribute>
143
+
144
+ <xsl:if test="summary/id">
145
+ <xsl:attribute name="id">
146
+ <xsl:value-of select="summary/id"/>
147
+ </xsl:attribute>
148
+ </xsl:if>
149
+
150
+ <xsl:if test="summary/class">
151
+ <xsl:attribute name="class">
152
+ <xsl:value-of select="summary/class"/>
153
+ </xsl:attribute>
154
+ </xsl:if>
155
+
156
+ <xsl:if test="summary/connection">
157
+ <xsl:attribute name="connection">
158
+ <xsl:value-of select="summary/connection"/>
159
+ </xsl:attribute>
160
+ </xsl:if>
161
+
162
+ <xsl:apply-templates select='summary'/>
163
+ <xsl:apply-templates select='records'/>
164
+
165
+ </xsl:element>
166
+ </xsl:template>
167
+
168
+ </xsl:stylesheet>
155
169
  XSLT
156
170
  end
157
171
 
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pxgraphviz
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.4.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  AJ2kmROiYBLscpVrfyHxtEJluJwbid/KyR/BybHL7uezZ2/EbCxCYanOIbNyctTp
32
32
  CNgZvs+F41zO7g==
33
33
  -----END CERTIFICATE-----
34
- date: 2017-09-11 00:00:00.000000000 Z
34
+ date: 2017-09-16 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: polyrex
@@ -62,7 +62,7 @@ dependencies:
62
62
  version: '0.5'
63
63
  - - ">="
64
64
  - !ruby/object:Gem::Version
65
- version: 0.5.5
65
+ version: 0.5.6
66
66
  type: :runtime
67
67
  prerelease: false
68
68
  version_requirements: !ruby/object:Gem::Requirement
@@ -72,7 +72,7 @@ dependencies:
72
72
  version: '0.5'
73
73
  - - ">="
74
74
  - !ruby/object:Gem::Version
75
- version: 0.5.5
75
+ version: 0.5.6
76
76
  description:
77
77
  email: james@jamesrobertson.eu
78
78
  executables: []
metadata.gz.sig CHANGED
Binary file