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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6a8633ee17ecebe2582b143347ac7d3416b6e8e57bf2b500873d6ef88bc8d34d
4
- data.tar.gz: 71009b11eb3e146379c40569e9d34642eb667b9f9ed0a0be764d16db018971bb
3
+ metadata.gz: 96dcba8ed02ce52a68cae91de8ee806f3b931b3e35431b214657605a2c574f44
4
+ data.tar.gz: 219c00e3f38d522cacd1625b03734b47c569f72e103af5f4bd76dc6449d41e36
5
5
  SHA512:
6
- metadata.gz: 42818d58c50f618e9edec92b0fe1d51a1a37ab0648ee1dfb665ee621def69adaaaed040bd47579646c3aa304682ed231a7c9f0d1681cfa2e74ed0013fd2e7505
7
- data.tar.gz: d954a18344357e3ed3683d43065c60f6a5572dcdeb3608a811eb0ba04fe656d3a5ff5019820b9064f2ab38b645b1c194e925ce65cfad0dbb5dd53d67494d3b95
6
+ metadata.gz: 1ab91ea93e2b0c86657161b45042d15e91d0c3a82dd04a374baca1fd33b7302d93f1c8b22789568908fd458f76f014915f3ebb6731099575b2e3262f69e47699
7
+ data.tar.gz: f69242a869ef990c432f3f8b16ecb3b4c72c4b44106994a440d5e94307ee4bea8daf9dd49208e7a3e475a1430f132608af0b832b38c8bf69100fdcda97755504
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -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: 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') + schema_body.gsub(/\w+(?=\[)/,'outline').sub(/\/(\w+)(?=\[)/,'/body>outline')
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.0
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: 2019-07-30 00:00:00.000000000 Z
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.1
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