polyrex-objects 0.9.2 → 0.9.3
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-objects.rb +38 -5
- metadata +22 -22
- 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: c49e029cceac6f6735ce1d5e685645dcf5396a22
|
4
|
+
data.tar.gz: 2a6020d4a3e4658b73335adae162e1d9fba136bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca039cfdb068e34282f9131686dbfc6ba9d59446dee1807e38865baff356221fd8d0556a7282502d97ac86c3b810ef491db2abc298ef19933db218abdcfca2ee
|
7
|
+
data.tar.gz: 0ee1a45b0d3de1dacef8038d8427242bd8d418c1d391d4ce46dc899f6562c4cb86b2f355705c70234f75e7d8197e73485fcf930dad682f480c606ad6d40906e0
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
Binary file
|
data/lib/polyrex-objects.rb
CHANGED
@@ -89,9 +89,10 @@ class PolyrexObjects
|
|
89
89
|
.sub('[','(').sub(']',')')
|
90
90
|
e.text = "%s/%s" % [e.text, child_schema]
|
91
91
|
summary.delete('format_mask')
|
92
|
-
summary.
|
92
|
+
summary.delete('recordx_type')
|
93
93
|
|
94
94
|
summary.add root.element('records/*/summary/format_mask').clone
|
95
|
+
|
95
96
|
root.xpath('records/*/summary/format_mask').each(&:delete)
|
96
97
|
|
97
98
|
xsl_buffer =<<EOF
|
@@ -118,10 +119,19 @@ xsl_buffer =<<EOF
|
|
118
119
|
</xsl:template>
|
119
120
|
</xsl:stylesheet>
|
120
121
|
EOF
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
122
|
+
|
123
|
+
File.write '/home/james/test.xsl', xsl_buffer
|
124
|
+
File.write '/home/james/test.xml', root.xml
|
125
|
+
begin
|
126
|
+
rexslt = Rexslt.new(xsl_buffer, root.xml)
|
127
|
+
buffer = rexslt.to_s
|
128
|
+
rescue
|
129
|
+
puts ($!).inspect
|
130
|
+
exit
|
131
|
+
end
|
132
|
+
|
133
|
+
r = Dynarex.new buffer
|
134
|
+
r
|
125
135
|
|
126
136
|
end
|
127
137
|
|
@@ -131,6 +141,10 @@ EOF
|
|
131
141
|
r.merge(field.capitalize => self.method(field).call)
|
132
142
|
end
|
133
143
|
end
|
144
|
+
|
145
|
+
def to_s()
|
146
|
+
build(self.records).join("\n")
|
147
|
+
end
|
134
148
|
|
135
149
|
def to_xml(options={})
|
136
150
|
@node.xml(options)
|
@@ -143,6 +157,25 @@ EOF
|
|
143
157
|
def xpath(s)
|
144
158
|
@node.xpath(s)
|
145
159
|
end
|
160
|
+
|
161
|
+
private
|
162
|
+
|
163
|
+
def build(records, indent=0)
|
164
|
+
|
165
|
+
records.map do |item|
|
166
|
+
|
167
|
+
summary = item.element 'summary'
|
168
|
+
format_mask = summary.text('format_mask').to_s
|
169
|
+
line = format_mask.gsub(/\[![^\]]+\]/){|x| summary.text(x[2..-2]).to_s}
|
170
|
+
|
171
|
+
records = item.element('records').elements.to_a
|
172
|
+
|
173
|
+
if records.length > 0 then
|
174
|
+
line = line + "\n" + build(records, indent + 1).join("\n")
|
175
|
+
end
|
176
|
+
(' ' * indent) + line
|
177
|
+
end
|
178
|
+
end
|
146
179
|
end
|
147
180
|
|
148
181
|
def initialize(schema, node=nil, id: '0')
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: polyrex-objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Robertson
|
@@ -12,26 +12,26 @@ cert_chain:
|
|
12
12
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
|
-
|
31
|
-
|
32
|
-
|
26
|
+
c3RlckBqYW1lc3JvYmVydHNvbi5ldTANBgkqhkiG9w0BAQUFAAOCAQEAfuynl6sE
|
27
|
+
moDCwW1vVh3v+gjThrAbrxdwZonbw9hSvOCcetaxm3CqrpLlLcTwoG8bbejXc//f
|
28
|
+
oQ62xVA9R6xaLYR90XyEo/KjMl194mr1x0kfMhDX9OdAOPUgvQosr2UsNsxk3Qqe
|
29
|
+
28jXhYkFFuHDncZGzXP/hqZgDpDUQiIuRbKzaBbJrTMBQq5zz5QH0IVsMQdB4mLF
|
30
|
+
PVHqVku7CAVFCfSOCdmP9gjcOGejaOORiCbvlO3eS15zXtAUhU8Q9z/Bj1TQIvWm
|
31
|
+
oXSdIUkeIE8xMnBo9hsYRTxYptr4zHbWPTQqtm/3qYXr4Fcsmov4E7uE/IPqzajB
|
32
|
+
s9lI00OyqNZ3ww==
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-
|
34
|
+
date: 2016-09-19 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: polyrex-createobject
|
@@ -39,20 +39,20 @@ dependencies:
|
|
39
39
|
requirements:
|
40
40
|
- - "~>"
|
41
41
|
- !ruby/object:Gem::Version
|
42
|
-
version: '0.
|
42
|
+
version: '0.6'
|
43
43
|
- - ">="
|
44
44
|
- !ruby/object:Gem::Version
|
45
|
-
version: 0.
|
45
|
+
version: 0.6.0
|
46
46
|
type: :runtime
|
47
47
|
prerelease: false
|
48
48
|
version_requirements: !ruby/object:Gem::Requirement
|
49
49
|
requirements:
|
50
50
|
- - "~>"
|
51
51
|
- !ruby/object:Gem::Version
|
52
|
-
version: '0.
|
52
|
+
version: '0.6'
|
53
53
|
- - ">="
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 0.
|
55
|
+
version: 0.6.0
|
56
56
|
description:
|
57
57
|
email: james@r0bertson.co.uk
|
58
58
|
executables: []
|
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
80
80
|
version: '0'
|
81
81
|
requirements: []
|
82
82
|
rubyforge_project:
|
83
|
-
rubygems_version: 2.
|
83
|
+
rubygems_version: 2.5.1
|
84
84
|
signing_key:
|
85
85
|
specification_version: 4
|
86
86
|
summary: Polyrex-objects automically builds objects from a Polyrex schema
|
metadata.gz.sig
CHANGED
Binary file
|