jstreebuilder 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data/lib/jstreebuilder.rb +27 -9
- data.tar.gz.sig +0 -0
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1fb6216a6db3b1fa2cea22ff31e25ef0011e781ad32733f72db72868274480d4
|
4
|
+
data.tar.gz: 68790d57575371e35df2c3e30fde0d4ac46202e7d56a84dcf41796c4e1eaf210
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bcec7abd75392b28dba2693978032e2b94b3ed6987672c24a725af7861793957c6f7f9b4ca28eede154088eff9fba6c920d76461b48627e00a1b7fa3f4321228
|
7
|
+
data.tar.gz: eae3a2574424004193df4d30b9cfa304eeb61847d82faa9f9aa990d9502aa27f55125873cf2c7c8cd4adf09d67bdf149ece43d4710a1944836adfd2cc5fc915f
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/lib/jstreebuilder.rb
CHANGED
@@ -11,6 +11,7 @@ require 'polyrex'
|
|
11
11
|
XSLT = %q[
|
12
12
|
<xsl:stylesheet xmlns:xsl='http://www.w3.org/1999/XSL/Transform' version='1.0'>
|
13
13
|
<xsl:output method="xml" indent="yes" omit-xml-declaration="yes" />
|
14
|
+
|
14
15
|
<xsl:template match='entries'>
|
15
16
|
|
16
17
|
<xsl:element name='ul'>
|
@@ -36,7 +37,17 @@ XSLT = %q[
|
|
36
37
|
</xsl:when>
|
37
38
|
<xsl:otherwise>
|
38
39
|
<xsl:element name='li'>
|
40
|
+
<xsl:choose>
|
41
|
+
<xsl:when test='summary/url != ""'>
|
42
|
+
<xsl:element name='a'>
|
43
|
+
<xsl:attribute name='href'><xsl:value-of select='summary/url'/></xsl:attribute>
|
44
|
+
<xsl:value-of select='summary/title'/>
|
45
|
+
</xsl:element>
|
46
|
+
</xsl:when>
|
47
|
+
<xsl:otherwise>
|
39
48
|
<xsl:value-of select='summary/title'/>
|
49
|
+
</xsl:otherwise>
|
50
|
+
</xsl:choose>
|
40
51
|
</xsl:element>
|
41
52
|
</xsl:otherwise>
|
42
53
|
</xsl:choose>
|
@@ -190,15 +201,23 @@ EOF
|
|
190
201
|
|
191
202
|
def tree(opt={})
|
192
203
|
|
193
|
-
tree = opt[:
|
204
|
+
tree = opt[:src]
|
194
205
|
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
206
|
+
s = if tree =~ /<tree>/ then
|
207
|
+
|
208
|
+
schema = 'entries/entry[title]'
|
209
|
+
xslt_schema = 'tree/item[@title:title]'
|
210
|
+
|
211
|
+
# transform the tree xml into a polyrex document
|
212
|
+
pxsl = PolyrexXSLT.new(schema: schema, xslt_schema: xslt_schema).to_xslt
|
213
|
+
puts 'pxsl: ' + pxsl if @debug
|
214
|
+
Rexslt.new(pxsl, tree).to_s
|
215
|
+
|
216
|
+
elsif tree =~ /<?polyrex /
|
217
|
+
tree
|
218
|
+
end
|
219
|
+
|
220
|
+
px = Polyrex.new(s)
|
202
221
|
|
203
222
|
# transform the polyrex xml into a nested HTML list
|
204
223
|
#@ul = Rexslt.new(px.to_xml, XSLT).to_xml
|
@@ -211,4 +230,3 @@ EOF
|
|
211
230
|
end
|
212
231
|
|
213
232
|
end
|
214
|
-
|
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jstreebuilder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
/YHvF368/KpwUw6rBLVUbFvCsNvDTe+bPAG72P5om2g/aope7mb9Qc4kATQgWiys
|
36
36
|
rqRI7UAQ3N9ojGSXl6KSySfi
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date: 2019-08-
|
38
|
+
date: 2019-08-06 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: nokogiri
|
metadata.gz.sig
CHANGED
Binary file
|