pxgraphviz 0.4.1 → 0.4.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
- checksums.yaml.gz.sig +0 -0
- data/lib/pxgraphviz.rb +76 -62
- data.tar.gz.sig +0 -0
- metadata +4 -4
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8937c761f0b23537cbeb192d19a9e774b0597659
|
4
|
+
data.tar.gz: daf42ddbfaffac09e288829ffa5dc3dd5f97e705
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
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
|
-
|
110
|
-
|
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
|
-
|
145
|
-
|
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
|
-
|
121
|
+
</xsl:when>
|
122
|
+
<xsl:otherwise>
|
148
123
|
|
149
|
-
|
124
|
+
<xsl:call-template name='node'/>
|
150
125
|
|
151
|
-
</xsl:
|
126
|
+
</xsl:otherwise>
|
152
127
|
|
153
|
-
</xsl:
|
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.
|
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-
|
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.
|
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.
|
75
|
+
version: 0.5.6
|
76
76
|
description:
|
77
77
|
email: james@jamesrobertson.eu
|
78
78
|
executables: []
|
metadata.gz.sig
CHANGED
Binary file
|