polyrex-builder 0.1.0

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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 784be788317a4175b0d77e441c70580ccd895273
4
+ data.tar.gz: e5c7ffd429fb8902677d747ac9840932d2fc3bc5
5
+ SHA512:
6
+ metadata.gz: '08051951ffe5ec31b02540d7164823c94e50522f2732142a8bf8b9bbafd6f777116a384c936bfd083446b39966969c714b2b22eaccc0e875f9046621edf57aa5'
7
+ data.tar.gz: 2578a09d68443f85ae2dc45f8d09a71bd6fcb2fe5856aeeb5afaceecf026e7a8c390cb50ddfad6abdfdaf6b0e598e3577aa397b336b9454ba261e5ed124e3a12
checksums.yaml.gz.sig ADDED
Binary file
@@ -0,0 +1,55 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # file: polyrex-builder.rb
4
+
5
+
6
+ require 'rexle'
7
+ require 'rexle-builder'
8
+
9
+
10
+ class PolyrexBuilder
11
+
12
+ def initialize(rows=[], parents: [])
13
+
14
+ records = rows.map {|x| pxify(x, parents) }
15
+
16
+ h = {records: records }
17
+
18
+ @a = RexleBuilder.new(h).to_a
19
+
20
+ end
21
+
22
+ def to_a()
23
+ @a
24
+ end
25
+
26
+ def to_xml()
27
+ Rexle.new(@a).xml pretty: true
28
+ end
29
+
30
+ private
31
+
32
+ def pxify(a, parents=[])
33
+
34
+ name = parents.shift
35
+
36
+ raw_records = a
37
+ raw_summary = raw_records.first
38
+
39
+ record = if raw_records[1] then
40
+
41
+ {
42
+ summary: raw_records.first,
43
+ records: raw_records[1].map{|x| pxify(x,parents.clone) }
44
+ }
45
+
46
+ else
47
+
48
+ {summary: raw_records.first}
49
+
50
+ end
51
+
52
+ {name => record}
53
+ end
54
+
55
+ end
data.tar.gz.sig ADDED
@@ -0,0 +1,2 @@
1
+ +bx����������f��� Pq���lT��������&��%
2
+ ��u�&Ⱥ�k����|�`�Vr�-�RR6�Y�=�� ��\�ٕ�;G��pp��to�袗y-�����\��X�����@���$9�T�P^�/�s��Mwc
metadata ADDED
@@ -0,0 +1,108 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: polyrex-builder
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - James Robertson
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDljCCAn6gAwIBAgIBATANBgkqhkiG9w0BAQUFADBIMRIwEAYDVQQDDAlnZW1t
14
+ YXN0ZXIxHjAcBgoJkiaJk/IsZAEZFg5qYW1lc3JvYmVydHNvbjESMBAGCgmSJomT
15
+ 8ixkARkWAmV1MB4XDTE3MDIyMzIyMTIyOVoXDTE4MDIyMzIyMTIyOVowSDESMBAG
16
+ A1UEAwwJZ2VtbWFzdGVyMR4wHAYKCZImiZPyLGQBGRYOamFtZXNyb2JlcnRzb24x
17
+ EjAQBgoJkiaJk/IsZAEZFgJldTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
18
+ ggEBAKFZUy1+vhmNP57/9ckl9qG8X2rIfcJwEU/NnjUYqg2euxS3MVdyy6vWF87i
19
+ 0vWe98TKdm+0Pz+YiNTsg4tMrXOhCuoOEd1X1ir0ezH8lTEWP4CrJBubQtSU6qxA
20
+ PPSnawMkRYaJF1u5PPAzPcHh1x36TdoExxGBOw9QVPj4lMH+McuUx6evRH2X7cMy
21
+ uupNsrUgl9THowfdpFY5mC7fKdEDlqPbxx5+lgIwq8jbD35Ot9ye3LteeAB7322V
22
+ QFyO6ZGUyACKEAM/Q2AE0AjzGfg0t5zGcomrnoCufWRI1fM8DlCApOJUYe5VOLpQ
23
+ 7wCCmLpZMTgQxxR3MS4hRZGaZj8CAwEAAaOBijCBhzAJBgNVHRMEAjAAMAsGA1Ud
24
+ DwQEAwIEsDAdBgNVHQ4EFgQUPPs1t4iWiz8g8k0HPxoP46JN9+0wJgYDVR0RBB8w
25
+ HYEbZ2VtbWFzdGVyQGphbWVzcm9iZXJ0c29uLmV1MCYGA1UdEgQfMB2BG2dlbW1h
26
+ c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAXqhzeFmF
27
+ 0GobAo2sdt/rhjsZ9lF0i51ktjnV58cloyXiRsJq9v8L1n8g4V0eG/vcsZsanKR8
28
+ grdl+fBtNo7JcE5BrCPBJ4zMCCKNiruviPAnjxBKVWZ3z6To7+s7zICH/Bh6FPO+
29
+ ljw/6jIcE9L5sr61V9UPVjbEgS3iCp6eorufI5TikUMHZyklh9JI9TtJTfQqMrYW
30
+ MkKZDu5gnuycMgik9rLwLyumPkiqkOJ1cV/kPUHU76GVVVnZpgu4J414nkuV3LEt
31
+ BM6II7ZH2foO57eQrnMv+aYLJ7hI0LvZb2nzbNnzol2AwlfdhxWGAIRWhsexZNrs
32
+ QqTXvYtpJUuNHQ==
33
+ -----END CERTIFICATE-----
34
+ date: 2017-02-23 00:00:00.000000000 Z
35
+ dependencies:
36
+ - !ruby/object:Gem::Dependency
37
+ name: rexle
38
+ requirement: !ruby/object:Gem::Requirement
39
+ requirements:
40
+ - - "~>"
41
+ - !ruby/object:Gem::Version
42
+ version: '1.4'
43
+ - - ">="
44
+ - !ruby/object:Gem::Version
45
+ version: 1.4.3
46
+ type: :runtime
47
+ prerelease: false
48
+ version_requirements: !ruby/object:Gem::Requirement
49
+ requirements:
50
+ - - "~>"
51
+ - !ruby/object:Gem::Version
52
+ version: '1.4'
53
+ - - ">="
54
+ - !ruby/object:Gem::Version
55
+ version: 1.4.3
56
+ - !ruby/object:Gem::Dependency
57
+ name: rexle-builder
58
+ requirement: !ruby/object:Gem::Requirement
59
+ requirements:
60
+ - - "~>"
61
+ - !ruby/object:Gem::Version
62
+ version: '0.3'
63
+ - - ">="
64
+ - !ruby/object:Gem::Version
65
+ version: 0.3.7
66
+ type: :runtime
67
+ prerelease: false
68
+ version_requirements: !ruby/object:Gem::Requirement
69
+ requirements:
70
+ - - "~>"
71
+ - !ruby/object:Gem::Version
72
+ version: '0.3'
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 0.3.7
76
+ description:
77
+ email: james@jamesrobertson.eu
78
+ executables: []
79
+ extensions: []
80
+ extra_rdoc_files: []
81
+ files:
82
+ - lib/polyrex-builder.rb
83
+ homepage: https://github.com/jrobertson/polyrex-builder
84
+ licenses:
85
+ - MIT
86
+ metadata: {}
87
+ post_install_message:
88
+ rdoc_options: []
89
+ require_paths:
90
+ - lib
91
+ required_ruby_version: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
96
+ required_rubygems_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: '0'
101
+ requirements: []
102
+ rubyforge_project:
103
+ rubygems_version: 2.6.8
104
+ signing_key:
105
+ specification_version: 4
106
+ summary: Builds a Polyrex structure from an array of Hash objects representing summary
107
+ records.
108
+ test_files: []
metadata.gz.sig ADDED
Binary file