polyrex 1.3.0 → 1.3.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.tar.gz.sig +0 -0
- data/lib/polyrex.rb +16 -2
- metadata +3 -3
- 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: 96dcba8ed02ce52a68cae91de8ee806f3b931b3e35431b214657605a2c574f44
|
4
|
+
data.tar.gz: 219c00e3f38d522cacd1625b03734b47c569f72e103af5f4bd76dc6449d41e36
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ab91ea93e2b0c86657161b45042d15e91d0c3a82dd04a374baca1fd33b7302d93f1c8b22789568908fd458f76f014915f3ebb6731099575b2e3262f69e47699
|
7
|
+
data.tar.gz: f69242a869ef990c432f3f8b16ecb3b4c72c4b44106994a440d5e94307ee4bea8daf9dd49208e7a3e475a1430f132608af0b832b38c8bf69100fdcda97755504
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/polyrex.rb
CHANGED
@@ -42,7 +42,7 @@ class Polyrex
|
|
42
42
|
attr_accessor :summary_fields, :xslt_schema, :id_counter,
|
43
43
|
:schema, :type, :delimiter, :xslt, :format_masks
|
44
44
|
|
45
|
-
def initialize(location=nil, schema: nil, id_counter: '1', debug:
|
45
|
+
def initialize(location=nil, schema: nil, id_counter: '1', debug: false)
|
46
46
|
|
47
47
|
|
48
48
|
@id_counter, @debug = id_counter, debug
|
@@ -284,7 +284,9 @@ class Polyrex
|
|
284
284
|
|
285
285
|
puts 'schema_body: ' + schema_body.inspect if @debug
|
286
286
|
puts 'schema_head: ' + schema_head.inspect if @debug
|
287
|
-
xslt_schema = schema_head.sub(/^\w+/,'opml>head') +
|
287
|
+
xslt_schema = schema_head.sub(/^\w+/,'opml>head') +
|
288
|
+
schema_body.gsub(/\w+(?=\[)/,'outline')\
|
289
|
+
.sub(/\/(\w+)(?=\[)/,'/body>outline')
|
288
290
|
|
289
291
|
puts 'xslt_schema: ' + xslt_schema.inspect if @debug
|
290
292
|
|
@@ -345,6 +347,18 @@ class Polyrex
|
|
345
347
|
header ? docheader + "\n" + out : out
|
346
348
|
|
347
349
|
end
|
350
|
+
|
351
|
+
def to_tree()
|
352
|
+
|
353
|
+
s = @schema.gsub(/(?<=\[)[^\]]+/) do |x|
|
354
|
+
x.split(/\s*,\s*/).map {|field| '@' + field + ':' + field}.join(', ')
|
355
|
+
end
|
356
|
+
|
357
|
+
xslt_schema = s.gsub(/\w+(?=\[)/,'item').sub(/^\w+/,'tree')
|
358
|
+
recxslt = RecordxXSLT.new(schema: @schema, xslt_schema: xslt_schema)
|
359
|
+
Rexslt.new(recxslt.to_xslt, self.to_xml).to_s
|
360
|
+
|
361
|
+
end
|
348
362
|
|
349
363
|
def to_xslt()
|
350
364
|
@polyrex_xslt.schema = @schema
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyrex
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -35,7 +35,7 @@ cert_chain:
|
|
35
35
|
9ub27xrXdW+WRA23u7MhkcrdY6eyNactmrRDbCMP7cIs+4V0a9/8GdKTqKcvpPH5
|
36
36
|
A6n47/gb6TRnFzkcm3JJNxg8
|
37
37
|
-----END CERTIFICATE-----
|
38
|
-
date:
|
38
|
+
date: 2020-01-13 00:00:00.000000000 Z
|
39
39
|
dependencies:
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: polyrex-objects
|
@@ -143,7 +143,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
143
143
|
- !ruby/object:Gem::Version
|
144
144
|
version: '0'
|
145
145
|
requirements: []
|
146
|
-
rubygems_version: 3.0.
|
146
|
+
rubygems_version: 3.0.3
|
147
147
|
signing_key:
|
148
148
|
specification_version: 4
|
149
149
|
summary: A flavour of XML for storing and retrieveing records in a Polyrex hierarchy
|
metadata.gz.sig
CHANGED
Binary file
|